Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeing An Issue Downloading External Terraform Modules #136

Open
dptaf opened this issue May 16, 2023 · 4 comments
Open

Seeing An Issue Downloading External Terraform Modules #136

dptaf opened this issue May 16, 2023 · 4 comments

Comments

@dptaf
Copy link

dptaf commented May 16, 2023

Starting this morning, we started seeing the following in our github actions workflows:

image

checkov -d . --output sarif --soft-fail --download-external-modules true
Error: -16 16:25:59,538 [MainThread ] [ERROR] Exception traceback:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/checkov/main.py", line 498, in run
exit_codes.append(self.print_results(
File "/usr/local/lib/python3.10/site-packages/checkov/main.py", line 651, in print_results
return runner_registry.print_reports(
File "/usr/local/lib/python3.10/site-packages/checkov/common/runners/runner_registry.py", line 408, in print_reports
print(report.print_console(
File "/usr/local/lib/python3.10/site-packages/checkov/common/output/report.py", line 306, in print_console
output_data += record.to_string(compact=is_compact, use_bc_ids=use_bc_ids)
File "/usr/local/lib/python3.10/site-packages/checkov/common/output/record.py", line 207, in to_string
"\tFile: {}:{}\n".format(self.file_path, "-".join([str(x) for x in self.file_line_range])), "magenta"
TypeError: 'NoneType' object is not iterable
Traceback (most recent call last):
File "/usr/local/bin/checkov", line 9, in
sys.exit(Checkov().run())
File "/usr/local/lib/python3.10/site-packages/checkov/main.py", line 498, in run
exit_codes.append(self.print_results(
File "/usr/local/lib/python3.10/site-packages/checkov/main.py", line 651, in print_results
return runner_registry.print_reports(
File "/usr/local/lib/python3.10/site-packages/checkov/common/runners/runner_registry.py", line 408, in print_reports
print(report.print_console(
File "/usr/local/lib/python3.10/site-packages/checkov/common/output/report.py", line 306, in print_console
output_data += record.to_string(compact=is_compact, use_bc_ids=use_bc_ids)
File "/usr/local/lib/python3.10/site-packages/checkov/common/output/record.py", line 207, in to_string
"\tFile: {}:{}\n".format(self.file_path, "-".join([str(x) for x in self.file_line_range])), "magenta"
TypeError: 'NoneType' object is not iterable

@thepoppingone
Copy link

checkov -d .    --quiet    --output sarif      --download-external-modules true         
Error: -16 04:53:06,712 [MainThread  ] [ERROR]  Exception traceback:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/checkov/main.py", line 501, in run
    exit_codes.append(self.print_results(
  File "/usr/local/lib/python3.10/site-packages/checkov/main.py", line 690, in print_results
    return runner_registry.print_reports(
  File "/usr/local/lib/python3.10/site-packages/checkov/common/runners/runner_registry.py", line 428, in print_reports
    sarif = Sarif(reports=sarif_reports, tool=self.tool)
  File "/usr/local/lib/python3.10/site-packages/checkov/common/output/sarif.py", line 40, in __init__
    self.json = self.create_json()
  File "/usr/local/lib/python3.10/site-packages/checkov/common/output/sarif.py", line 46, in create_json
    "runs": self._create_runs(),
  File "/usr/local/lib/python3.10/site-packages/checkov/common/output/sarif.py", line 52, in _create_runs
    results = self._create_results()
  File "/usr/local/lib/python3.10/site-packages/checkov/common/output/sarif.py", line 2[26](https://github.com/SPHTech-Platform/gcp-management/actions/runs/5286348175/jobs/9565692550?pr=23#step:7:27), in _create_results
    "startLine": int(record.file_line_range[0]) or 1,
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Traceback (most recent call last):

Having same issue here

@thepoppingone
Copy link

@dptaf

For anyone hitting the same issue, the latest docker image tag is problematic, this one works
pinning to #135 's suggested docker image tag version

      - name: Run Checkov action
        id: checkov
        uses: bridgecrewio/checkov-action@94be32d33f46ce5f2f07200bb5df4f5036b7296c
        with:
          output_format: sarif
          download_external_modules: true

@thepoppingone
Copy link

btw this only occurs for external modules for GCP related, not sure if its their codes that are problematic as well

@dptaf
Copy link
Author

dptaf commented Jun 22, 2023

that looks to work for me @thepoppingone -- thx for the suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants