Repository navigation
feat(python-sbom)!: cut over runtime CVE gate from Trivy to Grype (#152) - #229
Conversation
|
Warning Review limit reached
More reviews will be available in 11 minutes and 50 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?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 credits. 🚦 How do rate 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 see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ESCALATEClassification: substantive -- changes under Escalation triggers:
Checks performed (substantive class): logic errors, swallowed failures, expression injection into Findings
No injection risk found. fail-build and severity-cutoff are passed via action with inputs, not run shell interpolation. Input values that reach shell steps go through env-var boundaries. No permission widening. Promoted job retains contents:read + security-events:write. parity-summary job removal is a net reduction. Description vs diff. All claimed changes (trivyignore-path removal, continue-on-error removal, if state-guard addition, fail-build promotion, job-name preservation, parity-summary and compare_scanner_parity.py deletion, CHANGELOG update) are confirmed in the diff. Async reviewer status
CI statusCompleted and passing: Dependency Review, PR Title Format, Pre-Commit, Qlty Gate, REUSE Compliance, Security Analysis Gate, actionlint, shellcheck, Bats Tests, Python Tests, GitGuardian, Socket Security. Still running at review time: CodeQL Analyze (python), SonarCloud Scan, Security Gate Validation (secondary run). needs-deep-review label: already present on the PR -- no label add required. |
|
| Tier | Count |
|---|---|
| Critical | 0 |
| Important | 1 |
| Suggested | 5 |
| Informational | 4 |
The PR is mergeable. IMP-1 (stale template header) should be fixed in a companion commit or immediate follow-up PR.
Generated by /pr-review (Claude Sonnet 4.6)
Promotes the Grype scan job to gating and removes Trivy, completing the issue #152 cutover. The parallel-run window confirmed package- and severity-level detection parity (Grype missed nothing Trivy caught, identical CVSS scores including HIGH findings). Changes: remove the scan-runtime (Trivy) job; promote scan-runtime-grype to gating (fail-build mirrors fail-on-vulnerabilities, drop the job-level continue-on-error, add the SBOM-state guard the Trivy job had); the promoted job keeps the 'Scan Runtime Dependencies' check name so consumer rulesets are unaffected; remove the trivyignore-path input (verified no caller passes it); remove the parity-summary job and scripts/compare_scanner_parity.py plus its test. OSV-Scanner remains a second keyless gate. Motivation: Trivy's release infrastructure was compromised in March 2026 with vulnerability DB updates suspended, making the scanner itself a supply-chain risk. Grype (Anchore) is unaffected. BREAKING CHANGE: trivyignore-path input removed; use grype-config-path for CVE suppression. Gating scanner is now Grype, not Trivy. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
workflow-templates/python-sbom.yml header still described Trivy as the gating scanner and listed three SARIF categories (trivy, grype, osv-sbom-runtime-deps). After the #152 cutover, Grype is the sole gating scanner and only two SARIF categories remain (grype-runtime-deps, osv-sbom-runtime-deps). workflow-templates/python-release.yml release-notes template still offered trivy sbom as a suggested local scan command. Removed it because the CHANGELOG documents Trivy's March 2026 supply-chain compromise as the migration rationale; recommending Trivy to downstream users after flagging it as compromised sends mixed signals. Closes the IMP-1 and SUG-1 findings from /pr-review. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
d5b34d7 to
1ac5730
Compare
|
Fixes a collection of security and correctness gaps across promote-core,
consume-verify, and mirror-verify.
supply-chain-promote-core.yml:
- Fix Snyk dead gate: if: env.SNYK_TOKEN != '' evaluated step-level env which
GHA never exposes to if: expressions; Snyk never ran. Add check-snyk-token
step writing has-token to step outputs and gate on steps output (correct).
- Pin Snyk CLI to SNYK_CLI_VERSION; remove || true output suppression.
- Add masking for AUTH_B64 and AUTH_HEADER after GH_TOKEN masking; the log
scrubber masks exact strings only and does not redact base64 derivatives.
- Add source_ref digest shape-guard before crane pull to enforce the verified
digest trust model (rejects mutable tags).
- Add lock_file path traversal guard before any git operations on the file.
- Change workflow-level permissions from contents: read to {}.
- Add CRITICAL RAD marker on the Trivy re-introduction (Trivy was removed in
PR #229 due to confirmed supply-chain compromise; this re-introduction requires
ADR-012 and documented re-vetting before merge -- human action required).
supply-chain-consume-verify.yml:
- Propagate lock membership failure to the verified output in WARN mode: a
digest not in the lock wrote only a warning and exited 0, then cosign could
write verified=true, masking the lock failure. Now lock-check step outputs
lock_passed; verify step demotes verified to false when lock failed.
- Fix expected_issuer_regexp default to anchored and dot-escaped form; an
unescaped dot matched any character in the issuer URL.
supply-chain-mirror-verify.yml:
- Fix semantic inversion: when require_upstream_signature=false the output
contract documents true when verified OR not required, but code wrote
verified=false. Change to verified=true.
- Add UPSTREAM_REGISTRY and UPSTREAM_NAME shape-guards before GITHUB_OUTPUT
writes to prevent newline injection into the output file.
- Fix expected_issuer_regexp default to anchored and dot-escaped form.
- Change workflow-level permissions from contents: read to {}.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The v1 tag froze at the v1.1.0 commit (6f71aec) when the org tag-protection ruleset made all v* tags immutable, while main advanced to v7.0.1. Docs still sold v1 as a moving tag, renovate.json followed it (freezing SHA-pin updates), the starter templates and this repo's own scorecard/security-analysis callers were SHA-pinned to the frozen commit, and @v1 callers silently ran v1.1.0-era code, including the Trivy scanner that PR #229 replaced after Trivy's release infrastructure was compromised. Commit fully to point-tag/SHA pinning (CI-005): - renovate.json: drop followTag "v1" so Renovate advances org workflow SHA pins to the latest immutable release tag - USAGE_EXAMPLES.md: rewrite Version Pinning around @<sha> # vX.Y.Z (recommended, Renovate-managed) and immutable @vX.Y.Z point tags - CHANGELOG.md: correct the intro that claimed v1 is re-pointed as changes land; document the retirement under Unreleased - sweep all @v1 usage examples (workflow headers, docs/workflows, examples, migration guides, READMEs) to the v7.0.1 SHA pin form - bump workflow-templates/*.yml and this repo's scorecard.yml and security-analysis.yml off the frozen 6f71aec pin to v7.0.1 - add no-floating-v1 pre-commit guard (scripts/check-no-floating-v1.sh) blocking org-workflow @v1 references and followTag reintroduction Intentionally untouched: tests/fixtures (negative fixtures), tests/libs (vendored), docs/audits (historical record), and third-party action examples (qlty-action, pr-size-labeler). The stale v1 tag itself is deleted separately by an org admin; tag deletion requires a ruleset bypass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* fix(supply-chain): retire the frozen v1 floating tag The v1 tag froze at the v1.1.0 commit (6f71aec) when the org tag-protection ruleset made all v* tags immutable, while main advanced to v7.0.1. Docs still sold v1 as a moving tag, renovate.json followed it (freezing SHA-pin updates), the starter templates and this repo's own scorecard/security-analysis callers were SHA-pinned to the frozen commit, and @v1 callers silently ran v1.1.0-era code, including the Trivy scanner that PR #229 replaced after Trivy's release infrastructure was compromised. Commit fully to point-tag/SHA pinning (CI-005): - renovate.json: drop followTag "v1" so Renovate advances org workflow SHA pins to the latest immutable release tag - USAGE_EXAMPLES.md: rewrite Version Pinning around @<sha> # vX.Y.Z (recommended, Renovate-managed) and immutable @vX.Y.Z point tags - CHANGELOG.md: correct the intro that claimed v1 is re-pointed as changes land; document the retirement under Unreleased - sweep all @v1 usage examples (workflow headers, docs/workflows, examples, migration guides, READMEs) to the v7.0.1 SHA pin form - bump workflow-templates/*.yml and this repo's scorecard.yml and security-analysis.yml off the frozen 6f71aec pin to v7.0.1 - add no-floating-v1 pre-commit guard (scripts/check-no-floating-v1.sh) blocking org-workflow @v1 references and followTag reintroduction Intentionally untouched: tests/fixtures (negative fixtures), tests/libs (vendored), docs/audits (historical record), and third-party action examples (qlty-action, pr-size-labeler). The stale v1 tag itself is deleted separately by an org admin; tag deletion requires a ruleset bypass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(supply-chain): harden the no-floating-v1 guard and cover it with bats Strengthen the guard added for the v1 tag retirement: - widen the pattern from @v1 to any bare @vn major (a future @v7 would freeze callers the same way) and match the org name case-insensitively, since GitHub resolves uses: owners case-insensitively - fail closed: route the staged-file listing through a temp file so a git failure cannot read as "no staged files", and treat grep exit >= 2 (unreadable file) as a hook failure instead of a silent pass - extend the followTag check to all Renovate config basenames (renovate.json5, .renovaterc variants), tolerate unquoted JSON5 keys, and line-anchor the key match so prose like "No followTag: ..." in a rule description does not trip the guard (caught by the guard itself blocking this very commit) - anchor renovate.json matchPackageNames as regex patterns so the rule cannot match forks or lookalike repos - clarify in USAGE_EXAMPLES that the # vX.Y.Z release comment is not part of the uses: path - add tests/check-no-floating-v1.bats (16 cases: bare-major blocking, allowed pin forms, path exclusions, followTag key variants vs prose, fail-closed git behavior) and correct the CLAUDE.md script/coverage inventory, which had also drifted on sync-secrets.bats Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * fix(hooks): use structural context for the followTag key match The line-anchored key match missed compact single-line JSON ({"followTag": "v1"}), where the key sits mid-line; bats cases 10-11 caught the false negative. Match on structural context instead: a real key is preceded by an object opener, a separator, or line start ({, comma, or ^), while prose like "No followTag: ..." in a rule description is preceded by a word and space, so both false positives and false negatives are covered. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>



Summary
Completes the issue #152 Trivy-to-Grype cutover. Promotes the Grype scan job in
python-sbom.ymlto gating and removes Trivy and its parallel-run scaffolding. The blocking precondition (detection parity) was validated on the post-repair window and recorded in #152: zero divergence in either direction across 7 repos with comparable data, and identical CVSS scores on every shared finding (including a gate-relevantcryptographyHIGH).Motivation: Trivy's release infrastructure was compromised in March 2026 with vulnerability-DB updates suspended, making the SBOM scanner itself a supply-chain risk. Grype (Anchore) is unaffected.
What changed
scan-runtime(Trivy) job.scan-runtime-grypeto gating:fail-buildnow mirrorsfail-on-vulnerabilities, the job-levelcontinue-on-erroris gone, and it gains the samegenerate-sbomstate guard the Trivy job had.name: Scan Runtime Dependencies(what the Trivy job used), so consumer rulesets requiring that status-check context keep passing without per-repo changes.trivyignore-pathinput. Verified no consumer passes it (checked every org SBOM caller), so noworkflow_callinput-validation startup_failure can occur. Grype CVE suppression uses the existinggrype-config-path(.grype.yaml).parity-summaryjob andscripts/compare_scanner_parity.py(+ its test): parallel-run-only scaffolding.### Changed+### Breaking Changes).What did NOT change
python-container-security.yml/python-docker.ymluse a separate Trivy callsite (container image scanning); out of scope per the Migrate python-sbom.yml from Trivy to Grype (improvement plan S-6) #152 plan.workflow-templates/python-sbom.ymlcaller surface stays backwards-compatible.Validation
actionlintclean (no new warnings; shellcheck-info andjob.workflow_*counts both went down vsorigin/mainbecause removed code carried them).pre-commit run --all-filespasses.Before #152 can close (follow-ups, not in this PR)
workflow_dispatchsmoke test against ~3 representative callers on this branch (clean repo, repo with a known HIGH like rag-processor, repo with.grype.yaml); confirm theScan Runtime Dependenciescheck reports and gates.~/.claude: updatedocs/reference/renovate-architecture.md§ "Relationship to SBOM Generation" (criterion 4).Refs #152.