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

CKV2_AWS_38/39 produce empty helpUri in sarif output #3540

Closed
ankon opened this issue Sep 20, 2022 · 0 comments · Fixed by #3542
Closed

CKV2_AWS_38/39 produce empty helpUri in sarif output #3540

ankon opened this issue Sep 20, 2022 · 0 comments · Fixed by #3542
Labels

Comments

@ankon
Copy link
Contributor

ankon commented Sep 20, 2022

Describe the issue

We're producing sarif output from checkov in a github action. This started failing now because the sarif contains helpUri: null fields, which aren't valid (https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/sarif-v2.1.0-os.html#_Toc34317848).
image

I can reproduce this locally with checkov 2.1.216, and in my case it's the rules CKV2_AWS_38 and CKV2_AWS_39 with invalid content:
image

Additional context

Possibly caused by: #3492 adding helpUri
A similar issue existed in cfn-lint, where the fix was to ensure that helpUri is pointing to something sane in all cases: aws-cloudformation/cfn-lint#2276

Workaround

We filter the content before uploading now:

      - name: "Band-aid: Remove empty helpUri in sarif"
        run: jq 'del(.runs[].tool.driver.rules[].helpUri|select(.=="" or .==null))' <results.sarif >results-fixed.sarif

      - name: Upload SARIF file
        uses: github/codeql-action/upload-sarif@v2
        with:
          sarif_file: results-fixed.sarif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant