Skip to content

Attach build provenance attestations to release artifacts - #347

Merged
masutaka merged 2 commits into
mainfrom
build-provenance
Aug 13, 2026
Merged

masutaka merged 2 commits into
mainfrom
build-provenance

Conversation

@masutaka

@masutaka masutaka commented Aug 13, 2026 •

Copy link
Copy Markdown
Owner

Closes #338

Attach SLSA build provenance to the release artifacts so that users can verify a binary was actually built by this repository's CI.

Changes

  • Add actions/attest-build-provenance to the release job (with id-token: write and attestations: write)
    • subject-checksums points at dist/github-nippou_<tag>_checksums.txt, which groups every zip listed in the checksum file into a single attestation
  • Document gh attestation verify in README.md and README_ja.md
    • The example uses placeholders instead of a concrete version, so it will not go stale between releases
  • Also switch the GitHub Docs links in README_ja.md from /en/ to /ja/ (separate commit)

Verification

Notes

Provenance only proves that the upstream CI produced the artifact. If the release workflow itself or one of its build dependencies is compromised, a tainted artifact still gets a valid signature. Blocking direct injection into release assets is still worth having.

This stays a manual step for Homebrew users. Homebrew's attestation support is limited to bottles and the signing repository is hardcoded to Homebrew/homebrew-core, so a third-party tap never reaches that code path.

@masutaka
masutaka merged commit 721b098 into main Aug 13, 2026
10 checks passed
@masutaka
masutaka deleted the build-provenance branch August 13, 2026 04:34
@masutaka

masutaka commented Aug 13, 2026 •

Copy link
Copy Markdown
Owner Author

Verified against the v4.3.2 release.

The attestation is registered by the release workflow (run 31683011385) with the 5 zips from checksums.txt as its subjects, and the command documented in the README exits 0:

$ gh attestation verify github-nippou_v4.3.2_darwin_arm64.zip \
    --repo masutaka/github-nippou \
    --signer-workflow masutaka/github-nippou/.github/workflows/release.yml

The signer is .github/workflows/release.yml@refs/heads/main and the predicate type is https://slsa.dev/provenance/v1. Appending a single byte to the zip makes the same command exit 1 with HTTP 404, since no attestation exists for the modified digest.

One thing worth noting: GitHub also generates a https://in-toto.io/attestation/release/v0.2 attestation for the release itself, whose subjects are the 6 release assets including checksums.txt. So each digest ends up with two attestations of different predicate types.

This second one is not visible anywhere in the UI — the Attestations page lists SLSA provenance only. It shows up through the API:

$ digest=sha256:a7598c33787c7070f93505e4566939a551032a13be55b9f1bcba0cb6cba8a8d7  # darwin_arm64.zip of v4.3.2

$ gh api --method GET "repos/masutaka/github-nippou/attestations/${digest}" \
    --jq '.attestations[].bundle.dsseEnvelope.payload | @base64d | fromjson | .predicateType'
https://slsa.dev/provenance/v1
https://in-toto.io/attestation/release/v0.2

Since --signer-workflow keeps the auto-generated one out of the verification result, no change is needed on our side.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attach build provenance attestations to release artifacts

1 participant