feat: add supply chain attestations to Docker image builds#884
Conversation
Add SLSA provenance (mode=max) and SBOM generation to both amd64 and arm64 Docker image builds. Add id-token:write permission so BuildKit can request a GitHub OIDC token for signed provenance attestations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
CI Security Review
Critical / High
None.
Medium
-
.github/workflows/release.yml— workflow-levelpermissions: contents: write: Permissions are set at the workflow level (line 13-14), meaning all jobs inheritcontents: write, including thedockerjob which only needscontents: read. Thedockerjob correctly overrides this at the job level (line 173-175), so this is not exploitable, but it would be cleaner to remove the workflow-level permissions and set them per-job. This is a pre-existing issue, not introduced by this PR. -
Third-party actions pinned by tag, not SHA:
docker/build-push-action@v6,docker/setup-qemu-action@v3,docker/setup-buildx-action@v3,docker/login-action@v3, andpeter-evans/repository-dispatch@v3are pinned to major version tags rather than commit SHAs. A compromised tag could inject malicious code into this privileged release workflow. This is pre-existing and not introduced by this PR.
Low
None.
Verdict
PASS — The changes add id-token: write permission to the docker job (needed for SLSA provenance attestations) and enable provenance: mode=max and sbom: true on both Docker build-push steps. These are security improvements — they add supply chain attestation (SLSA provenance) and software bill of materials (SBOM) to the published container images. The id-token: write permission is correctly scoped at the job level and is required for the sigstore-based provenance generation used by docker/build-push-action. No new vulnerabilities introduced.
There was a problem hiding this comment.
Code Review
Blocking Issues
None.
Suggestions
- Attestation propagation to multi-arch manifest: The
docker buildx imagetools createstep (line 236) should correctly propagate provenance and SBOM attestations from the per-platform images into the merged manifest. This is the expected behavior withbuild-push-action@v6, but worth verifying after the first release by running theimagetools inspectcommands from the test plan against both the platform-specific tags and the multi-arch tag.
Overall: Clean, minimal change. The id-token: write scope is appropriate and safe, and adding provenance + SBOM to both platform builds is the correct approach.
Summary
mode=max) and SBOM generation to both amd64 and arm64 Docker image buildsid-token: writepermission to the docker job for OIDC-signed provenanceImpact
Docker Hub will now receive full supply chain attestations alongside each image push:
This improves the Docker Hub security score and gives consumers verifiable proof of image origin.
Why this is safe
The
id-token: writepermission only allows the job to request a short-lived OIDC token from GitHub's token endpoint. It cannot access repo contents, secrets, or the GitHub API. The token is scoped to the workflow run and expires immediately after.Test plan
🤖 Generated with Claude Code