Skip to content

feat(general): Add the protect-check option that forces specific checks to always run#7489

Open
deese wants to merge 3 commits intobridgecrewio:mainfrom
deese:protect_checks
Open

feat(general): Add the protect-check option that forces specific checks to always run#7489
deese wants to merge 3 commits intobridgecrewio:mainfrom
deese:protect_checks

Conversation

@deese
Copy link
Copy Markdown

@deese deese commented Apr 2, 2026

Description

Add a new --protect-check option that forces specific checks to always run, even if they have been skipped via --skip-check, the YAML config file (skip-check:), or inline code comments (#checkov:skip=). This is useful in enforcement scenarios where certain security checks must never be suppressed by developers.

The option is available via:

  • CLI flag: --protect-check CKV_AWS_1,CKV_AWS_2
  • YAML config file: protect-check: [CKV_AWS_1, CKV_AWS_2]
  • Environment variable: CKV_PROTECT_CHECK

Checklist:

  • 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

Regarding the tests when I pull from the repo tons of tests are failing, so I'm not sure what to answer :). I've checked the ones I created and it works.

if should_skip_check:
if is_protected:
result = True
logging.debug(f'protect_check override {check_id}: {result}')
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

In previous lines the bc_check_id is logged. Is the check_id considered secret? (I can change it if needed).

@deese deese changed the title feat: Add the protect-check option that forces specific checks to always run feat (general): Add the protect-check option that forces specific checks to always run Apr 6, 2026
@deese deese changed the title feat (general): Add the protect-check option that forces specific checks to always run feat(general): Add the protect-check option that forces specific checks to always run Apr 7, 2026
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.

2 participants