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

platform(general): Handle SAST suppressions (suppressions V2) #6109

Merged
merged 17 commits into from
May 9, 2024

Conversation

mikeurbanski1
Copy link
Contributor

@mikeurbanski1 mikeurbanski1 commented Mar 20, 2024

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

  • Adds logic to get and apply suppressions V2 (currently SAST) for file, repo, and policy suppressions. Findings cannot be suppressed due to no way to map a finding ID in a suppression to a checkov finding.
  • Adds logic to save policy suppressions for use in filtering out checks in the runner filter and handling cloned policies

Also adds logic that is somewhat related (still related to customizations) to pass sast check metadata (severities) to sast core, so that the right severity gets used. See also https://code.pan.run/bridgecrew/sast-core/-/merge_requests/655

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@mikeurbanski1 mikeurbanski1 marked this pull request as draft March 20, 2024 22:27
@mikeurbanski1 mikeurbanski1 marked this pull request as ready for review March 21, 2024 14:51
@mikeurbanski1 mikeurbanski1 merged commit 4cc9f25 into main May 9, 2024
37 of 38 checks passed
@mikeurbanski1 mikeurbanski1 deleted the handle-sast-suppressions branch May 9, 2024 22:04
boring-repos bot pushed a commit to harryzcy/checkov that referenced this pull request May 10, 2024
…crewio#6109)

* add logic to handle the new suppression format

* log suppressions v2

* handle policy, repo, and file suppressions v2

* add tests and handle cloned policies

* fix typing

* add helper methods

* fix line indentation

* remove unnecessary null check

* pass prisma severity to sast core

* use get to handle old suppressions

* remove extra iteration of values
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

Successfully merging this pull request may close these issues.

4 participants