Course contentsShow
← Security
Lesson 1638 of 3,05233. Container SecurityFree lesson

Image Signing and Content Trust

Using Docker Content Trust, Notary, and Cosign to cryptographically sign images and verify authenticity.

Image Signing and Content Trust

What You'll Learn

You'll learn how to cryptographically sign container images and verify their authenticity using Docker Content Trust, Notary, and Cosign to ensure only trusted images run in your environment.

The Trust Problem

After scanning images for vulnerabilities, how do you guarantee the image you're deploying is the exact one you scanned—not a tampered substitute? Image signing solves this by creating a cryptographic "seal of approval" that proves both the image's origin and integrity.

How Image Signing Works

Think of image signing like notarizing a legal document. The publisher creates a digital signature using their private key, which travels with the image. Before deployment, you verify the signature using the publisher's public key. If anyone modifies even a single byte of the image, the signature becomes invalid.

Docker Content Trust (DCT) uses the Notary framework underneath. When enabled (DOCKER_CONTENT_TRUST=1), Docker automatically signs images on push and verifies signatures on pull. It maintains a separate chain of trust metadata stored in Notary servers, mapping image tags to specific digests.

Cosign, part of the Sigstore project, offers a modern alternative. It stores signatures directly in the registry alongside images, supports keyless signing with ephemeral certificates, and integrates with transparency logs for tamper-proof audit trails.

Verification Flow

When you pull a signed image, the tool:

  1. Downloads the image and its signature
  2. Retrieves the publisher's public key
  3. Verifies the signature matches the image digest
  4. Rejects the image if verification fails

This prevents man-in-the-middle attacks, registry compromises, and unauthorized image modifications—critical when you've already validated an image's vulnerabilities but need assurance it hasn't changed.

Key Takeaway: Image signing provides cryptographic proof that container images haven't been tampered with and come from trusted publishers, closing the gap between vulnerability scanning and deployment assurance.