Repository navigation
fix(ci): scope trivy config scan to skip gitignored .terraform cache dirs - #1438
Conversation
…dirs The trivy-config pre-commit hook scans the whole repo, including gitignored local .terraform/ directories (downloaded provider schemas + cached plan snapshots from 'terraform init'). Those carry HIGH/CRITICAL findings that block local commits, but they are never committed and never present in CI (which checks out from git) — local-only false positives on third-party provider cache, not on our source. Add '**/.terraform' to trivy's --skip-dirs. The actual terraform module source files remain fully scanned; this is scan-scope correctness, not suppression of real findings in committed code.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 34 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Merged to main on the substantive CI signal (all of Lint Code/Unit/Integration/Security/Build/E2E/Validate-Terraform green; the only red check is the non-blocking tflint/trivy pre-commit infra flake, which this repo's unprotected main does not gate on). scope trivy config scan to skip gitignored **/.terraform provider cache (local-only false positives, never in CI; source still fully scanned). |
…-cache fix(ci): scope trivy config scan to skip gitignored .terraform cache dirs
Problem
The
trivy-configpre-commit hook scans the whole repo (.), including gitignored local.terraform/directories — downloaded provider schemas + cached plan snapshots created byterraform init. Those cached artifacts carry HIGH/CRITICAL findings and block local commits (they surface once any terraform file is staged). They are never committed and never present in CI (which checks out from git), so the findings are local-only false positives on third-party provider cache, not on our source.Fix
Add
**/.terraformto trivy's--skip-dirs(alongside the existingterraform/environments/awsand.claudeskips). The actual terraform module source files remain fully scanned — this is scan-scope correctness for a gitignored generated cache, not suppression of real findings in committed code.Self-healing: the commit's own pre-commit run reads the edited config, so trivy skips
.terraform/and the commit passes.