ci: harden release SBOM job per security review (follow-up to #201)#202
Merged
Conversation
Security review of #201 found the SBOM was generated correctly but with hardening gaps. Apply all four findings: (1) isolate syft (third-party) into a credential-less 'sbom' job so the OIDC signing token in 'attest' is never exposed to untrusted code; (2) exclude tests/** via .github/syft.yaml so the BOM describes shipped deps, not the test harness (syft was cataloging tests/integration/saas/requirements.txt); (3) jq guard fails closed on a valid-but-empty SBOM; (4) disable the action's upload-artifact/upload-release-assets side-effects, handing the SBOM to attest via an explicit artifact. Also gate publish on needs.attest.result=='success': required now that attest is *skipped* (not failed) when sbom fails, which a plain !failure() check would let publish through unattested.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughA new ChangesSBOM Pipeline Restructure
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Follow-up to #201 — security-review hardening
#201 fixed the silently-broken SBOM attestation (syft replacing the dead cyclonedx-py pipeline) and is merged. A
security-specialistreview of #201 returned APPROVE-WITH-NITS: the SBOM was generated correctly but with four hardening gaps. This PR closes all four (plus a gating fix the job-split makes mandatory).Note
None of these are regressions — #201 is already a strict improvement over the prior fake-green/no-SBOM state. This is defense-in-depth for a product whose SBOM is the compliance artifact.
Changes
.github/syft.yamlexcludestests/**(+rust/fuzz/**) — syft was catalogingtests/integration/saas/requirements.txt, so the attested SBOM falsely claimed the wheel depends on SaaS integration-test packages.anchore/syft@mainat runtime) is moved into its ownsbomjob with noid-token/attestations/contents:write. Theattestjob now runs first-party actions only and consumes the SBOM as an artifact, so the OIDC signing token never shares a runner with third-party code.jqguard rejects a valid-but-empty SBOM (syft can exit 0 yet catalog nothing) before it gets attested.upload-artifact/upload-release-assets; the SBOM is handed toattestvia an explicit pinnedactions/upload-artifact.needs.attest.result == 'success'instead of!failure(). Withattestnow depending onsbom, a failedsbomskipsattest(not fails), and a plain!failure()would letpublishship unattested.Verification
actionlintcleanuv.lock+Cargo.lockcataloging confirmed (bundled syft v1.42.3; uv.lock cataloger since v1.18.0)anchore/sbom-action@…v0.24.0,actions/upload-artifact@…v7.0.1)sbomfail →attestskipped →publishskipped (fail-closed)workflow_dispatch— by design.ci:typed — workflow only, no release.Summary by CodeRabbit
Release Notes
Chores