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

fix(sca): changes on cve suppressions to match package and image scan #3502

Merged
merged 4 commits into from
Sep 19, 2022

Conversation

NoaAzoulay
Copy link
Contributor

@NoaAzoulay NoaAzoulay commented Sep 13, 2022

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

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

New/Edited policies (Delete if not relevant)

Description

Include a description of what makes it a violation and any relevant external links.

Fix

How does someone fix the issue in code and/or in runtime?

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

@NoaAzoulay NoaAzoulay marked this pull request as draft September 13, 2022 12:34
@gruebel gruebel changed the title changes on cve suppressions to match package and image scan fix(sca): changes on cve suppressions to match package and image scan Sep 13, 2022
# Conflicts:
#	checkov/common/bridgecrew/integration_features/features/suppressions_integration.py
@NoaAzoulay NoaAzoulay marked this pull request as ready for review September 19, 2022 08:52
Copy link
Contributor

@Saarett Saarett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎖️

for cve in suppression['cves'])
if self.bc_integration.repo_id in suppression['accountIds']:
repo_name = self.bc_integration.repo_id.replace('\\', '/').split('/')[-1] # type: ignore
suppression_path = suppression['cves'][0]['id'].replace('\\', '/')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you just moved it here, but do you know why we use only the index 0 of suppression['cves']?
in some cases (specifically in the UTs) there are more than 1 items in the list

Copy link
Contributor Author

@NoaAzoulay NoaAzoulay Sep 19, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, there can be more than one cve, but each suppression represent one file, so if we have few cves that were suppressed for the same file, the 'id' which is the file path will be the same for all of them

@NoaAzoulay NoaAzoulay merged commit adb06c7 into master Sep 19, 2022
@NoaAzoulay NoaAzoulay deleted the bug_fix_cves_suppression branch September 19, 2022 10:57
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.

3 participants