Sub topic 3
Inspecting SBOM and Provenance of a Pushed Image
Assume you can build and push images, understand image digests and indexes, and read JSON with jq. An SBOM is a list of software components in an image. Provenance is evidence about how and where the image was built.
Inspecting pushed attestations
After a BuildKit build pushes attestations, inspect them from the registry:
docker buildx imagetools inspect registry.example.com/demo/app:1.0 \
--format '{{ json .SBOM }}' | jq .
docker buildx imagetools inspect registry.example.com/demo/app:1.0 \
--format '{{ json .Provenance }}' | jq .The SBOM can list packages such as curl, their versions, and their ecosystem. Provenance can identify the builder, source information, build arguments, and build steps. The registry stores these attestations beside the image manifests in the image index, rather than inside the application filesystem.
Choosing provenance mode
Buildx commonly emits minimal provenance by default. Minimal mode provides core build identity and source details. Maximum mode records more build configuration and intermediate information:
docker buildx build \
--sbom=true \
--provenance=mode=max \
--tag registry.example.com/demo/app:1.0 \
--push .Use maximum mode when audits need detailed reproducibility data. Review the output first because build arguments, source paths, or other metadata can reveal sensitive information. Use --provenance=mode=min when the consumer needs less detail.
Scanner coverage and build stages
The SBOM scanner examines the filesystem of the final image. It may miss tools installed only in earlier stages, packages copied in unusual ways, language dependencies outside recognized locations, or files excluded before the final stage. BuildKit can also scan intermediate stages or the build context with build arguments, depending on the scanner and BuildKit version. Treat these options as coverage improvements, not proof that every dependency was found.
Verification and trust limits
An attestation describes a result, but an unsigned attestation does not prove who created it. A registry compromise or untrusted builder could replace it. Sign attestations and verify their signatures in deployment or admission policy. Then check the signer, image digest, source repository, build workflow, and required SBOM fields.
Exercise
When should you prefer provenance mode max over mode min?
Show answer
Prefer mode max when detailed audit or reproducibility data is required, after checking that the extra metadata does not disclose sensitive build information.