Skip to content

Add release immutability verfiicaton and attestation - #473

Open
simongdavies wants to merge 1 commit into
mainfrom
add-release-attestation
Open

simongdavies wants to merge 1 commit into
mainfrom
add-release-attestation

Conversation

@simongdavies

Copy link
Copy Markdown
Member

This pull request enhances the release process for Rust crates and GitHub releases by introducing automated provenance verification, attestation, and stricter integrity checks. It updates the workflows to enforce that published crate archives match those built by CI, generates and verifies provenance bundles, and documents the new verification procedures for end users.

Workflow and Security Improvements:

  • Added permissions for attestations: write and artifact-metadata: write in .github/workflows/CreateRelease.yml and .github/workflows/cargo-publish.yml to enable provenance attestation and artifact metadata management. [1] [2]
  • Introduced steps to the cargo-publish.yml workflow to validate crate versions, check that published .crate archives match CI-built archives, generate and upload provenance bundles, and recover or verify provenance as needed. [1] [2]
  • Updated the release workflow to require successful publishing of npm packages and Rust crates before finalizing the GitHub release, and to verify the provenance and integrity of all release assets before publishing. [1] [2]

Documentation Updates:

  • Added a new section to README.md describing how to verify GitHub release attestations using the GitHub CLI, and referenced more detailed documentation.
  • Expanded docs/release.md with a detailed explanation of immutable releases, provenance requirements, and the verification process for both crates and GitHub releases.

Workflow Naming Correction:

  • Renamed the cargo-publish.yml workflow from "Publish npm packages" to "Publish Rust crates" to accurately reflect its purpose.

Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
@simongdavies simongdavies added the kind/enhancement New feature or improvement label Dec 1, 2026

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

LGTM overall. We previously checked npm packages immediately after publishing, but propagation delays caused failures even when publishing succeeded. I removed that check in #401. Is the check nessary you think? Maybe could attest the local .crate archives after cargo publish succeeds.

bundle="release-crates/sha256:$digest.jsonl"
(
cd release-crates
gh attestation download "$archive" --repo "$GH_REPO" \

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.

Could this skip recovery when a crate has an SBOM attestation but no build provenance? The CLI errors when nothing matches the predicate. A server-side filter might let us distinguish missing provenance from request failures.

contents: read
id-token: write
attestations: write
artifact-metadata: write

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.

Is artifact-metadata: write needed for file attestations?

GH_REPO: ${{ github.repository }}
TAG: v${{ inputs.version }}
run: |
draft=$(gh api --paginate "repos/$GH_REPO/releases" \

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.

nit: Maybe somethign like gh release view "$TAG" --json isDraft --jq '.isDraft' is simpler?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants