checkov-vscode icon indicating copy to clipboard operation
checkov-vscode copied to clipboard

Infinite scans

Open jasonckeating opened this issue 2 years ago • 5 comments

Scans have started scanning infinitely. The checkov indicator at the bottom of vscode spins without ever succeeding on even small terraform files that previously produced results.

Because it doesn't fail, I don't get an option to check the logs.

jasonckeating avatar Mar 31 '22 13:03 jasonckeating

Hi @jasonckeating, can you specify some more data about whats happening? Did you try to reboot you VsCode? this might dump the logs to the file, logs would be helpful. what version of checkov is installed? and also whats the version of the extension?

orhovy avatar Mar 31 '22 14:03 orhovy

checkov v2.0.1020 extension v1.0.76

I have tried a few reboots of vsCode, and the plugin

jasonckeating avatar Mar 31 '22 14:03 jasonckeating

These are the logs captured after checkov runs for a while and spins.

[debug]: Log from Checkov: 2022-03-31 14:59:25,852 [MainThread  ] [INFO ]  Found working version of helm dependancies: v3.8.1
2022-03-31 14:59:25,853 [MainThread  ] [DEBUG]  dockerfile_runner declares no system dependency checks required.
2022-03-31 14:59:25,853 [MainThread  ] [DEBUG]  secrets_runner declares no system dependency checks required.
2022-03-31 14:59:25,853 [MainThread  ] [DEBUG]  json_runner declares no system dependency checks required.
2022-03-31 14:59:25,853 [MainThread  ] [DEBUG]  yaml_runner declares no system dependency checks required.
2022-03-31 14:59:25,853 [MainThread  ] [DEBUG]  github_configuration_runner declares no system dependency checks required.
 
[debug]: Log from Checkov: 2022-03-31 14:59:25,853 [MainThread  ] [DEBUG]  gitlab_configuration_runner declares no system dependency checks required.
 
[debug]: Log from Checkov: 2022-03-31 14:59:25,854 [MainThread  ] [DEBUG]  bitbucket_configuration_runner declares no system dependency checks required.
 
[debug]: Log from Checkov: 2022-03-31 14:59:25,854 [MainThread  ] [INFO ]  Checking necessary system dependancies for kustomize checks.
 
[debug]: Log from Checkov: 2022-03-31 14:59:25,911 [MainThread  ] [INFO ]  Found working version of kustomize dependancy kustomize: v4.5.4
 
[debug]: Log from Checkov: 2022-03-31 14:59:25,913 [MainThread  ] [DEBUG]  sca_package_runner declares no system dependency checks required. 
[debug]: Log from Checkov: 
2022-03-31 14:59:25,914 [MainThread  ] [DEBUG]  github_actions_runner declares no system dependency checks required.
 
[debug]: Log from Checkov: 2022-03-31 14:59:25,915 [MainThread  ] [DEBUG]  bicep_runner declares no system dependency checks required.
2022-03-31 14:59:25,915 [MainThread  ] [DEBUG]  Using API key ending with RZloWHg=
2022-03-31 14:59:25,915 [MainThread  ] [DEBUG]  BC_SOURCE = vscode, version = 1.0.76
 
[debug]: Log from Checkov: 2022-03-31 14:59:25,915 [MainThread  ] [INFO ]  Using Prisma API URL: https://api3.prismacloud.io
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,399 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,409 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,410 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,413 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,419 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,420 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
2022-03-31 14:59:26,421 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,422 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Response from version command: 2.0.1020
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,619 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,620 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
2022-03-31 14:59:26,620 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,621 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
2022-03-31 14:59:26,621 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,624 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,625 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,629 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,636 [MainThread  ] [DEBUG]  Checkov version: 2.0.1020
2022-03-31 14:59:26,636 [MainThread  ] [DEBUG]  Python executable: /usr/local/bin/python
2022-03-31 14:59:26,637 [MainThread  ] [DEBUG]  Python version: 3.10.2 (main, Feb 25 2022, 22:40:35) [GCC 10.3.1 20211027]
2022-03-31 14:59:26,637 [MainThread  ] [DEBUG]  Checkov executable (argv[0]): /usr/local/bin/checkov
2022-03-31 14:59:26,637 [MainThread  ] [DEBUG]  Command Line Args:   -f aws_root/account_base/organization-cloudtrail.tf -s --bc-api-key **** --repo-id _git/tfbase_master -o json
Environment Variables:
  PRISMA_API_URL:    https://api3.prismacloud.io
Defaults:
  --framework:       ['all']
  --branch:          master
  --download-external-modules:False
  --external-modules-download-path:.external_modules
  --evaluate-variables:True

2022-03-31 14:59:26,637 [MainThread  ] [INFO ]  Resultant set of frameworks (removing skipped frameworks): all
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,638 [MainThread  ] [DEBUG]  terraform_runner declares no system dependency checks required.
2022-03-31 14:59:26,638 [MainThread  ] [DEBUG]  cloudformation_runner declares no system dependency checks required.
2022-03-31 14:59:26,638 [MainThread  ] [DEBUG]  kubernetes_runner declares no system dependency checks required.
2022-03-31 14:59:26,638 [MainThread  ] [DEBUG]  serverless_runner declares no system dependency checks required.
2022-03-31 14:59:26,638 [MainThread  ] [DEBUG]  arm_runner declares no system dependency checks required.
2022-03-31 14:59:26,638 [MainThread  ] [DEBUG]  terraform_plan_runner declares no system dependency checks required.
2022-03-31 14:59:26,638 [MainThread  ] [INFO ]  Checking necessary system dependancies for helm checks.
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,711 [MainThread  ] [INFO ]  Found working version of helm dependancies: v3.8.1
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,712 [MainThread  ] [DEBUG]  dockerfile_runner declares no system dependency checks required.
2022-03-31 14:59:26,712 [MainThread  ] [DEBUG]  secrets_runner declares no system dependency checks required.
2022-03-31 14:59:26,712 [MainThread  ] [DEBUG]  json_runner declares no system dependency checks required.
2022-03-31 14:59:26,712 [MainThread  ] [DEBUG]  yaml_runner declares no system dependency checks required.
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,712 [MainThread  ] [DEBUG]  github_configuration_runner declares no system dependency checks required.
2022-03-31 14:59:26,713 [MainThread  ] [DEBUG]  gitlab_configuration_runner declares no system dependency checks required.
2022-03-31 14:59:26,713 [MainThread  ] [DEBUG]  bitbucket_configuration_runner declares no system dependency checks required.
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,713 [MainThread  ] [INFO ]  Checking necessary system dependancies for kustomize checks.
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,736 [MainThread  ] [INFO ]  Found working version of kustomize dependancy kustomize: v4.5.4
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,736 [MainThread  ] [DEBUG]  sca_package_runner declares no system dependency checks required.
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,737 [MainThread  ] [DEBUG]  github_actions_runner declares no system dependency checks required.
2022-03-31 14:59:26,737 [MainThread  ] [DEBUG]  bicep_runner declares no system dependency checks required.
2022-03-31 14:59:26,738 [MainThread  ] [DEBUG]  Using API key ending with RZloWHg=
 
[debug]: Log from Checkov: 2022-03-31 14:59:26,738 [MainThread  ] [DEBUG]  BC_SOURCE = vscode, version = 1.0.76
2022-03-31 14:59:26,738 [MainThread  ] [INFO ]  Using Prisma API URL: https://api3.prismacloud.io
 
[info]: Cancellation token invoked, aborting checkov run. 

jasonckeating avatar Mar 31 '22 15:03 jasonckeating

@mikeurbanski1 let us know if there is any progress 🙏

SteveVaknin avatar Apr 03 '22 13:04 SteveVaknin

Infinite scans here too.

In my case here is the error:

[info]: Running checkov: 
[info]: checkov -s --bc-api-key **** --repo-id _git/PROJECT -f "c:\Users\USER\GitProjects\PROJECT\variables.tf" -o json 
[debug]: Version command: checkov -v 
[warn]: Checkov stderr: Asociaci�n de archivo no encontrada para la extensi�n .py
 
[debug]: Response from version command: 2.0.1037
 
[warn]: Checkov stderr: Traceback (most recent call last):
  File "<string>", line 1, in <module>
 
[warn]: Checkov stderr:   File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 116, in spawn_main
 
[warn]: Checkov stderr:     exitcode = _main(fd, parent_sentinel)
  File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 125, in _main
 
[warn]: Checkov stderr:     prepare(preparation_data)
  File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 236, in prepare
 
[warn]: Checkov stderr:     _fixup_main_from_path(data['init_main_from_path'])
  File "C:\Program Files\Python310\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path
 
[warn]: Checkov stderr:     main_content = runpy.run_path(main_path,
  File "C:\Program Files\Python310\lib\runpy.py", line 268, in run_path
 
[warn]: Checkov stderr:     code, fname = _get_code_from_file(run_name, path_name)
  File "C:\Program Files\Python310\lib\runpy.py", line 242, in _get_code_from_file
 
[warn]: Checkov stderr:     code = compile(f.read(), fname, 'exec')
  File "C:\Users\USER\AppData\Roaming\Python\Python310\Scripts\checkov.cmd", line 1
 
[warn]: Checkov stderr:     @echo OFF
     ^^^^^^^^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

If I execute this command " checkov -s --bc-api-key **** --repo-id _git/PROJECT -f "c:\Users\USER\GitProjects\PROJECT\variables.tf" -o json" on the VSCode terminal is working.

trapacampo avatar Apr 06 '22 11:04 trapacampo