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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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:

Enhance the BaseContextParser to support skipping multiple checks with a single comment in Terraform files. Modify the COMMENT_REGEX in enum.py to recognize multiple check IDs separated by commas. Update the BaseContextParser to handle these multiple IDs and enrich the context accordingly. Add test cases in test_base_parser.py to validate the new functionality using mock Terraform files.

TopicDetails
Testing Enhancements Test the new multi-check skipping functionality in Terraform context parsers.
Modified files (2)
  • tests/terraform/context_parsers/test_base_parser.py
  • tests/terraform/context_parsers/mock_tf_files/inline_suppression.tf
Latest Contributors(2)
UserCommitDate
[email protected]...Use-new-runconfig-endp...February 21, 2022
gruebelfix-computation-of-end...January 01, 2022
Multi-Check Skipping Enable skipping multiple checks with a single comment in Terraform files.
Modified files (2)
  • checkov/terraform/context_parsers/base_parser.py
  • checkov/common/comment/enum.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 🚀

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