Step 01 of 06
Understand the idea
A digest identifies the exact contents of an image. It does not tell you who built the image. In this lesson, you will sign an image and verify the signature to check who produced it.
Key technical ideas
Hashes answer what, not who
If two people build two images, each image has a digest. Pulling by digest protects you from tag movement, but it does not say whether the digest was produced by your release workflow, a laptop, or an attacker with push access. Signatures add an identity claim over that digest.
Keyless signing avoids secret key babysitting
Traditional signing requires storing and rotating a private key. Cosign keyless signing asks an OIDC provider, such as GitLab, to issue a short-lived identity certificate. The signature can then be verified against the certificate subject and issuer. There is still trust, but not a long-lived key sitting in CI like a loaded mousetrap.
Transparency logs make quiet rewrites harder
Rekor records signing events in an append-only log. That means signatures can be audited after the fact, and suspicious duplicate or unexpected signatures are visible. A transparency log does not prevent every attack. It changes the attack from silent to observable, which is often the difference between incident and mystery.
Attestations are signed statements about the artifact
A signature says an identity signed a digest. An attestation says something more: this build used this workflow, this SBOM belongs to the image, these materials were inputs. Tools can verify attestations separately from signatures. That is how supply-chain policy grows beyond "was it signed?" into "was it built the way we require?"
cosign sign registry.gitlab.com/YOUR_GITLAB_USERNAME/beacon@sha256:YOUR_DIGEST
cosign verify --certificate-identity-regexp 'https://gitlab.com/YOUR_GITLAB_USERNAME/beacon//.*' --certificate-oidc-issuer https://gitlab.com registry.gitlab.com/YOUR_GITLAB_USERNAME/beacon@sha256:YOUR_DIGESTFor this course, sign from a GitLab CI job with an ID token. A local interactive signature has a different identity, so the verification policy must match the signer.
Integrity, identity, provenance
| Question | Mechanism | Example |
|---|---|---|
What bytes? | Digest |
|
Signed by whom? | Cosign signature | GitLab OIDC identity |
Logged where? | Rekor | Transparency entry |
Built how? | Attestation | SLSA provenance |
Technical terms used at work
Cosign — Sigstore's tool for signing and verifying container images and related artifacts.
OIDC — OpenID Connect, used here to obtain a short-lived signing identity.
Rekor — Sigstore's transparency log for signatures and attestations.
Attestation — A signed statement about an artifact, such as provenance or SBOM linkage.
