fix(terraform_plan): apply inline skip comments when deep analysis is enabled - #7644
Draft
pszypowicz wants to merge 1 commit into
Draft
fix(terraform_plan): apply inline skip comments when deep analysis is enabled#7644pszypowicz wants to merge 1 commit into
pszypowicz wants to merge 1 commit into
Conversation
… enabled _handle_report gated the whole plan enrichment block on deep analysis being off, and that block is the only place inline checkov:skip comments get applied to plan scans, so combining --repo-root-for-plan-enrichment with --deep-analysis dropped every inline suppression. Apply handle_skipped_checks in both modes and keep the file path, line range and code block rewriting on the non-deep path, where records are not already mapped through the merged graph.
pszypowicz
requested a deployment
to
scan-security
August 11, 2026 11:30 — with
GitHub Actions
Waiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description
RunnerRegistry._handle_reportgated the whole plan enrichment block on deep analysis being off, and that block is the only place where inlinecheckov:skipcomments get applied to plan scans. Running--repo-root-for-plan-enrichmenttogether with--deep-analysistherefore dropped every inline suppression, while the same scan without--deep-analysishonored them.This change parses the enrichment repo root and applies
Report.handle_skipped_checksin both modes. The file path, line range and code block rewriting ofReport.enrich_plan_reportstays on the non-deep path, because deep analysis reports records against the plan file through the merged graph and existing tests pin that behavior.The new test mirrors the existing
test_skip_checkwithdeep_analysis=Trueand fails without the fix.Fixes #7643 (previously reported in #6815 and #7225, both closed by the stale bot without a fix)
Checklist: