Sign published container images - #227
Conversation
acidghost
left a comment
There was a problem hiding this comment.
LGTM!
You could also sign the SBOM as attestations: extract the SBOM and issue cosign attest over the file. I ended up updating my repo after opening the issue here 😅 (ref1, ref2). Downstream consumers might require the signature on the attestations before trusting the predicate (eg extractPayload from Kyverno).
9c7b6ef to
dc5c7fd
Compare
|
Rebased onto main (picks up #230 multi-arch and #232 login-action bump; dropped the now-duplicate Opened #236 to track |
Extract each platform's SPDX document from the BuildKit SBOM attestation and sign it as a cosign spdxjson attestation against the manifest-list digest, so downstream consumers (e.g. Kyverno image-verification policies) can verify the predicate signature rather than relying on the unsigned BuildKit attachment.
There was a problem hiding this comment.
Pull request overview
Adds Sigstore Cosign-based keyless signing and BuildKit-generated provenance/SBOM attestations to the container publish workflow, aligning the repo’s GHCR publishing with supply-chain metadata expectations from #225.
Changes:
- Grants the workflow OIDC permissions and installs Cosign for keyless signing.
- Enables Buildx provenance (
mode=max) and SBOM generation during image build/push. - Verifies BuildKit attestations are present in GHCR and publishes SPDX SBOM predicates as Cosign attestations.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| set -euo pipefail | ||
| reference="${IMAGE}@${DIGEST}" | ||
| docker buildx imagetools inspect "$reference" --format '{{ json .Provenance }}' > provenance.json | ||
| docker buildx imagetools inspect "$reference" --format '{{ json .SBOM }}' > sbom.json |
Adds keyless Cosign signing for published container images. Enables full provenance and SBOM attestations in Buildx, then verifies both are present in GHCR.
Closes #225