fix: Block releases with mismatched attestation digests#1819
Conversation
Download each uploaded asset and its attached bundle, then require every verified source repository digest to match the tagged release commit before the draft is made public. This blocks releases whose artifacts were attested by a different workflow run.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe publish workflow verifies remote release attestations, confirms their repository digests match the release tag commit, and blocks publishing on missing or mismatched data. Workflow tests cover the new gate, its conditions, ordering, and SHA mismatch handling. ChangesRemote attestation verification
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant PublishJob
participant GitHubRelease
participant GHAttestation
PublishJob->>GitHubRelease: download release asset and .sigstore.json bundle
PublishJob->>GHAttestation: verify asset attestation
GHAttestation-->>PublishJob: return sourceRepositoryDigest values
PublishJob->>PublishJob: compare digests with RELEASE_TAG commit SHA
PublishJob->>GitHubRelease: publish draft release when checks pass
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/native-cli-publish.yml:
- Around line 430-451: Constrain remote attestation verification to the trusted
publish workflow. In .github/workflows/native-cli-publish.yml lines 430-451, add
SIGNER_WORKFLOW to the environment and pass --repo "${GITHUB_REPOSITORY}" and
--signer-workflow "${SIGNER_WORKFLOW}" to gh attestation verify. Update the
assert_contains expectation in scripts/test-native-cli-publish-workflow.sh line
178 to match the expanded command.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: a2b4300d-c3d1-4307-aec9-51c6ff3b3792
📒 Files selected for processing (2)
.github/workflows/native-cli-publish.ymlscripts/test-native-cli-publish-workflow.sh
Require each downloaded bundle to verify against the repository and trusted publish workflow so matching digests from an unrelated signer cannot satisfy the release gate.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
scripts/test-native-cli-publish-workflow.sh (1)
172-186: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winAssert that digest mismatches fail the workflow.
These assertions only check that the comparison statements exist. They would still pass if either mismatch branch merely logged an error and continued to
Publish draft release, allowing a fail-open regression in this security gate. Validate the extracted verification block and assert that both mismatch paths terminate non-zero.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/test-native-cli-publish-workflow.sh` around lines 172 - 186, Update test_remote_attestation_digests_match_the_release_tag_before_publishing to validate the extracted verification block, not just the comparison statements. Assert that both tag_sha versus RELEASE_SHA and digest versus tag_sha mismatch branches terminate non-zero before the Publish draft release step, preventing either path from continuing after a failed security check.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@scripts/test-native-cli-publish-workflow.sh`:
- Around line 172-186: Update
test_remote_attestation_digests_match_the_release_tag_before_publishing to
validate the extracted verification block, not just the comparison statements.
Assert that both tag_sha versus RELEASE_SHA and digest versus tag_sha mismatch
branches terminate non-zero before the Publish draft release step, preventing
either path from continuing after a failed security check.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4171895d-62fa-48bd-8aa8-7a50d779f6ab
📒 Files selected for processing (2)
.github/workflows/native-cli-publish.ymlscripts/test-native-cli-publish-workflow.sh
🚧 Files skipped from review as they are similar to previous changes (1)
- .github/workflows/native-cli-publish.yml
Verify the extracted publish gate exits for both tag and digest mismatches so future edits cannot silently continue to publication after a failed attestation check.
Move the signer workflow setting into the step that consumes it and verify the complete step environment so future edits cannot leave the release gate with an unset variable.
df6f7f2
into
feature/release-pipeline-hardening-integration
Summary
User Impact
Changes
Verification
px --yes js-yaml .github/workflows/native-cli-publish.yml
Refs: release pipeline recurrence-prevention plan, PR-1