Repository navigation
Add release immutability verfiicaton and attestation - #473
simongdavies wants to merge 1 commit into
Conversation
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
ludfjig
left a comment
There was a problem hiding this comment.
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" \ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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" \ |
There was a problem hiding this comment.
nit: Maybe somethign like gh release view "$TAG" --json isDraft --jq '.isDraft' is simpler?
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:
attestations: writeandartifact-metadata: writein.github/workflows/CreateRelease.ymland.github/workflows/cargo-publish.ymlto enable provenance attestation and artifact metadata management. [1] [2]cargo-publish.ymlworkflow to validate crate versions, check that published.cratearchives match CI-built archives, generate and upload provenance bundles, and recover or verify provenance as needed. [1] [2]Documentation Updates:
README.mddescribing how to verify GitHub release attestations using the GitHub CLI, and referenced more detailed documentation.docs/release.mdwith a detailed explanation of immutable releases, provenance requirements, and the verification process for both crates and GitHub releases.Workflow Naming Correction:
cargo-publish.ymlworkflow from "Publish npm packages" to "Publish Rust crates" to accurately reflect its purpose.