Sub topic 1
Why Sign Images: The Trust Problem in the Container Supply Chain
Prerequisites
This chapter assumes you can build, tag, push, and pull OCI container images. You should also understand basic public-key cryptography: a private key creates a signature, and a public key verifies it.
Why Sign Images?
A container image can pass through several systems before deployment: source control, CI, a registry, and a cluster. Each step creates opportunities for an attacker or an accidental mistake to replace the image.
A signature gives you evidence about two things:
- The image content has not changed since it was signed.
- The signer controlled a particular key or authenticated identity.
A signature does not prove that the image is secure. It does not remove vulnerabilities or prove that the build process was correct. It gives deployment systems a way to check provenance and integrity.
Tags Are Mutable, Digests Are Not
A tag such as app:1.0.0 is a readable pointer. Someone with permission can move that tag to a different image. A digest is a cryptographic hash of the image manifest. Changing the image changes the digest.
| Reference | Meaning | Suitable for signing? |
|---|---|---|
| `registry.example.com/team/app:1.0.0` | Mutable name | No |
| `registry.example.com/team/app@sha256:...` | Exact content | Yes |
Resolve the digest after pushing the image, then sign and deploy that digest:
docker buildx imagetools inspect \
registry.example.com/team/app:1.0.0 \
--format '{{json .Manifest.Digest}}'The Sigstore Ecosystem at a Glance
Sigstore is a collection of services and tools for software signing. Cosign performs image signing and verification. Fulcio issues short-lived certificates for keyless signing. Rekor records signing events in a public transparency log.
Where Cosign Keeps Signatures
Cosign stores signatures in the same OCI registry as the image. The signature is an OCI artifact that refers to the image digest. This lets a registry transfer and retain the image and its related signature together.
A verifier retrieves the signature, checks its cryptographic relationship to the digest, and then applies trust rules. Those rules might require a known public key or a specific certificate identity and issuer.
Exercise
Why is signing app@sha256:... safer than signing app:1.0.0?
Show answer
The digest identifies exact image content, while the tag can later point to different content.