Sub topic 14
Limitations and the trust model of unsigned attestations
This chapter assumes you can build and push images with docker buildx build, read JSON with jq, and know what an image digest and an image index are. It also assumes you have seen SBOM and provenance attestations in the earlier chapters. Here you learn what those attestations prove, what they don't, and what to do next.
What an unsigned attestation is
BuildKit writes SBOM and provenance attestations as in-toto statements and stores them in the image index, next to the image manifests. By default these statements are not signed. They are JSON documents that the build produced and the registry stores.
Anyone who can push to the repository can push a new index with different attestations. A reader who pulls the attestations sees only what is stored, so reading them does not show that they are authentic.
Where the trust comes from
The attestations are only as trustworthy as the system that created them and the channel they travel through. The diagram shows the points where trust can break.
Two separate risks follow from this:
- Builder risk. BuildKit generates the attestation, so a compromised or misconfigured builder can describe a build that did not happen.
- Storage risk. Without a signature, nothing ties the attestation to a trusted identity. Someone with push rights can replace it.
What the SBOM does not tell you
The SBOM scanner works by static analysis. It reports what it can detect, so treat the list as a best-effort inventory and not as a guarantee.
- It can miss software that is not installed through a known package manager or a recognized language manifest, such as a binary you downloaded with
curland copied in. - It does not tell you whether a package is vulnerable. You must match the SBOM against a vulnerability database, and that data changes after the build.
- Scanning intermediate stages or the build context is off by default. Without the build arguments covered earlier, the SBOM describes only the final image.
What provenance does not tell you
Provenance records how the image was built. It does not show that the build was safe.
- In
minmode, it omits details such as the build arguments and the Dockerfile content. Less detail means fewer checks you can run later. - In
maxmode, it can include sensitive data, such as build arguments, so review it before you publish it. Never pass secrets as build arguments. - Provenance describes the inputs by reference, such as a source URL and a base image digest. It does not prove that those inputs were free of malicious code.
- Some self-reported fields, such as the builder identity, come from the builder itself.
Checking what you can
You can already do useful checks without signatures. Compare the image digest in the attestation with the digest you deployed, and confirm that the base image digest is the one you expect. Look at the source repository and revision.
docker buildx imagetools inspect registry.example.com/demo/app:1.0 \
--format '{{ json .Provenance }}' | jq .These checks catch mistakes and drift. They do not stop an attacker who can write to the registry, because that attacker can also write matching metadata.
The next step: signing and verification
To turn attestations into evidence, sign them and verify them against a policy. A signature binds the statement to an identity, such as a CI workflow, and to a specific image digest. A verifier then refuses images whose attestations are missing, unsigned, or signed by an unexpected identity. Tools in the Sigstore family (for example cosign) and policy engines serve this role, and the next chapter covers them.
Exercise
A teammate says, "The image has a max-mode provenance attestation, so we can trust where it came from." Give two reasons this is not yet justified, and name one thing that would improve it.
Show answer
First, the attestation is unsigned, so anyone with push access to the repository could replace it, and nothing binds it to a trusted identity. Second, the builder generates the attestation itself, so a compromised builder could record false data. Signing the attestation in CI and verifying the signature and identity against a policy before deployment would improve it.