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

feat(terraform): Add multi skip inline suppression #6860

Merged
merged 1 commit into from
Dec 5, 2024

Conversation

talazuri
Copy link
Contributor

@talazuri talazuri commented Nov 21, 2024

User description

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

Description

Add the ability to skip multiple checks with a single comment

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:

  • 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

Generated description

Below is a concise technical summary of the changes proposed in this PR:

Implements multi-check inline suppression for Checkov. Modifies the comment regex to allow multiple check IDs, updates the base parser to handle multiple identifiers, and adds test cases for various suppression scenarios. Enhances the flexibility of skipping checks in Terraform files.

TopicDetails
Inline Suppression Implements multi-check inline suppression functionality for Checkov
Modified files (4)
  • checkov/terraform/context_parsers/base_parser.py
  • checkov/common/comment/enum.py
  • tests/terraform/context_parsers/mock_tf_files/inline_suppression.tf
  • tests/terraform/context_parsers/test_base_parser.py
Latest Contributors(2)
UserCommitDate
bo156feat-terraform-Remove-...August 16, 2023
lirshindalmanfeat-general-enrich-te...July 24, 2023
This pull request is reviewed by Baz. Join @talazuri and the rest of your team on (Baz).

Copy link
Contributor

@SteveVaknin SteveVaknin left a comment

Choose a reason for hiding this comment

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

Nice 🚀

@talazuri talazuri force-pushed the inline-comment-multi-suppression branch from f724938 to b2527d7 Compare December 5, 2024 07:34
@talazuri talazuri merged commit 918a894 into main Dec 5, 2024
38 checks passed
@talazuri talazuri deleted the inline-comment-multi-suppression branch December 5, 2024 07:53
Saarett pushed a commit that referenced this pull request Dec 5, 2024
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