feat(build): attach a provenance attestation beside the SBOM

An image built with SBOM=1 says what is in it and nothing about how it
was built: BUILDX_ARGS set --provenance=false for every build, from when
any attestation broke the single-platform stitch.

SBOM=1 now also passes --attest type=provenance,mode=min, which BuildKit
writes into the same attestation manifest as the SBOM, so the index
shape the stitch and the gate read since #4997 is unchanged and a
signature over the index covers it. mode=min records the build times,
the platform, the frontend and the BuildKit version and leaves out build
arguments and secrets, which is what lets it ride every release image.
A build without SBOM=1 keeps --provenance=false: the default docker
driver cannot attach it, and a PR image turned into an index would buy
nothing.

Refs #3278

Assisted-by: LLM
Signed-off-by: Marian Koreniuk <moriarti@cp.if.ua>
This commit is contained in:
Marian Koreniuk committed 2026-11-02 06:49:13 +01:00
1 parent d32092ac9a
commit 662fcf83de
3 files changed
+24 -11

No files matched your search

+1 -1
View File
@@ -355,7 +355,7 @@ The script runs the same `cosign verify-blob` before it returns, so a signature
### SBOM of the container images
The container images a release pins by digest each carry an SPDX SBOM of the packages in them, which BuildKit attaches at build time as an attestation (`SBOM=1` in `tags.yaml`, scanner and flags in [`hack/common-envs.mk`](../hack/common-envs.mk)). The attestation is an entry of the image's index, so the digest the release pins names both, and promotion copies it with the image. Read it with `docker buildx imagetools inspect <image>@<digest> --format '{{ json .SBOM }}'`, which prints one document per platform. The attestations are not signed. A release cut before `SBOM=1` was set has none, and neither has the Talos installer image, which the imager builds and `skopeo` pushes, nor the third-party images `packages/` vendors by digest.
The container images a release pins by digest each carry an SPDX SBOM of the packages in them, which BuildKit attaches at build time as an attestation (`SBOM=1` in `tags.yaml`, scanner and flags in [`hack/common-envs.mk`](../hack/common-envs.mk)). The attestation is an entry of the image's index, so the digest the release pins names both, and promotion copies it with the image. Read it with `docker buildx imagetools inspect <image>@<digest> --format '{{ json .SBOM }}'`, which prints one document per platform. The same attestation manifest carries a SLSA provenance statement of the build, in BuildKit's `mode=min` (build times, platform, frontend and BuildKit version, no build arguments and no secrets), which `docker buildx imagetools inspect <image>@<digest> --format '{{ json .Provenance }}'` prints. The attestations are not signed. A release cut before `SBOM=1` was set has none, and neither has the Talos installer image, which the imager builds and `skopeo` pushes, nor the third-party images `packages/` vendors by digest.
## Nightly builds