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(general): Custom Policies integration must run before Suppresion integration #3701

Merged
merged 6 commits into from
Oct 20, 2022

Conversation

Saarett
Copy link
Contributor

@Saarett Saarett commented Oct 19, 2022

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Let's assume we have an OOTB policy with a suppression rule for it, and a clone of it.
If by any chance Suppression integration is loaded into the list before Custom Policies, the OOTB policy will be suppressed, and then the clone would be as well.

Currently the order ID of these 2 integrations is the same, so we rely on the mercy of the globs method to load the files in the right order, in the file checkov/common/bridgecrew/integration_features/features/__init__.py
https://stackoverflow.com/questions/6773584/how-are-glob-globs-return-values-ordered
https://stackoverflow.com/a/6774404

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

@Saarett Saarett changed the title Suppression integration will be before the policies integration fix(general): Suppression integration must run before Custom Policies integration Oct 19, 2022
@Saarett Saarett changed the title fix(general): Suppression integration must run before Custom Policies integration fix(general): Custom Policies integration must run before Suppresion integration Oct 19, 2022
Copy link
Contributor

@gruebel gruebel left a comment

Choose a reason for hiding this comment

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

@Saarett Saarett merged commit 21d2da2 into master Oct 20, 2022
@Saarett Saarett deleted the fix_order branch October 20, 2022 11:44
Floodnut pushed a commit to init-cloud/checkov that referenced this pull request Oct 20, 2022
…integration (bridgecrewio#3701)

* suppression integration will come before the policies integration

* Added comment

* comment

* added more logs

* added more comments

* fixed flake8 error
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