Skip to content

fix: Block releases with mismatched attestation digests#1819

Merged
hatayama merged 4 commits into
feature/release-pipeline-hardening-integrationfrom
fix/verify-release-attestation-tag
Jul 17, 2026
Merged

fix: Block releases with mismatched attestation digests#1819
hatayama merged 4 commits into
feature/release-pipeline-hardening-integrationfrom
fix/verify-release-attestation-tag

Conversation

@hatayama

@hatayama hatayama commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Prevent a draft native CLI release from becoming public unless every uploaded asset's attestation digest matches its release tag.

User Impact

  • A release published from a workflow run for a different commit is stopped before users can install it.
  • This would have blocked the beta.48 artifact/tag mismatch before the draft was published.

Changes

  • Download each remote asset and its attached Sigstore bundle after upload.
  • Verify all source repository digests against the release tag and approved release commit.
  • Add static workflow coverage for the mandatory ordering and fail-closed checks.

Verification

  • C:\Program Files\Git\bin\bash.exe scripts/test-native-cli-publish-workflow.sh

px --yes js-yaml .github/workflows/native-cli-publish.yml

  • C:\Program Files\Git\bin\bash.exe -n scripts/test-native-cli-publish-workflow.sh
  • git diff --check

Refs: release pipeline recurrence-prevention plan, PR-1

Review in cubic

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.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9146f7ed-4ca3-47fe-83a6-06324fe5e3b5

📥 Commits

Reviewing files that changed from the base of the PR and between ab0c5ce and c577e0a.

📒 Files selected for processing (2)
  • .github/workflows/native-cli-publish.yml
  • scripts/test-native-cli-publish-workflow.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/native-cli-publish.yml

📝 Walkthrough

Walkthrough

The 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.

Changes

Remote attestation verification

Layer / File(s) Summary
Attestation verification publish gate
.github/workflows/native-cli-publish.yml
The publish job configures the signer workflow, verifies the release tag SHA, downloads remote assets and Sigstore bundles, validates attestation JSON, checks digest counts and values, and runs before draft publication.
Publish gate workflow tests
scripts/test-native-cli-publish-workflow.sh
Tests cover publishing and dry-run conditions, remote attestation verification, digest comparisons, mismatch guards, step ordering, and execution wiring.

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
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: blocking release publication when attestation digests do not match.
Description check ✅ Passed The description is directly related to the workflow and test changes, and matches the pull request objectives.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/verify-release-attestation-tag

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between c772112 and 4048110.

📒 Files selected for processing (2)
  • .github/workflows/native-cli-publish.yml
  • scripts/test-native-cli-publish-workflow.sh

Comment thread .github/workflows/native-cli-publish.yml Outdated
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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Assert 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

📥 Commits

Reviewing files that changed from the base of the PR and between 4048110 and ad4444e.

📒 Files selected for processing (2)
  • .github/workflows/native-cli-publish.yml
  • scripts/test-native-cli-publish-workflow.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/native-cli-publish.yml

hatayama added 2 commits July 17, 2026 22:55
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.
@hatayama
hatayama merged commit df6f7f2 into feature/release-pipeline-hardening-integration Jul 17, 2026
2 checks passed
@hatayama
hatayama deleted the fix/verify-release-attestation-tag branch July 17, 2026 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant