Image Signing, Verification & Supply Chain Security (Cosign, Notary)
Sign and verify images with Cosign/Notary to protect the supply chain.
In plain words
Bind publication, SBOM/provenance and admission policy to the same immutable digest and signer identity.
Think of it like…
A wax seal proves this box was sealed by the recognized sender; it does not promise every item inside is safe unless the included inspection attestation is checked.
Where you’ve seen it
In practice, cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeef is the concrete move for this job: sign and verify images with Cosign/Notary to protect the supply chain. The release is not accepted until verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role confirms the result.
Words you’ll hear
- Cosign
- The implementation control in
cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeeffor sign and verify images with Cosign/Notary to protect the supply chain. - Notary
- The result to observe with
verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role, rather than infer from a successful command alone. - Verify
- The production boundary exposed when accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild.
Visual diagram
Theory & deep dive
Cosign control path
The concrete mechanism is cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeef. The observable result is verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role; if those disagree, inspect the runtime evidence before changing unrelated settings.
Sign and verify images with Cosign/Notary to protect the supply chain. Keep Cosign, Notary and Verify in the same deployment record so the intent and the observed state cannot drift apart.
cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeef
verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role, not with command success alone.Verify failure boundary
Signing a tag is dangerous if the tag moves; a signature proves who attested a manifest, not that the image is vulnerability-free. A private signing key on a CI runner and unaudited verification roots create another supply-chain weakness. The narrow failure to design for is accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild.
Accept this compromise explicitly: Keyless OIDC reduces key custody; managed keys offer offline/air-gapped control but require rotation and protection. The controlled check-verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role-also identifies the point where a different design is safer.
Exercise this failure safely: accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild.
How it works, step by step
Step 1 of 41. State the boundary
Write down why the workload needs this: Signing a tag is dangerous if the tag moves; a signature proves who attested a manifest, not that the image is vulnerability-free. A private signing key on a CI runner and unaudited verification roots create another supply-chain weakness.
- Intent
- Cosign
When to use it & trade-offs
What it is
Cosign signs or keylessly attests a release manifest digest, and verification checks the trusted identity, certificate/issuer and digest match before deployment. Notary-style trust systems also separate tag trust from arbitrary signatures, but deployment must consume their policy.
Why it matters: Signing a tag is dangerous if the tag moves; a signature proves who attested a manifest, not that the image is vulnerability-free. A private signing key on a CI runner and unaudited verification roots create another supply-chain weakness.
When to reach for it
- The fit is strongest for this job: sign and verify images with Cosign/Notary to protect the supply chain. Pair it with
verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing rolein the runbook. - Production Cosign changes should make Notary observable through
cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeef, rather than trusting the runtime default. - Keep a rollback example for the case where accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild.
When to avoid or be careful
- Do not accept command success while the system can still fail by accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild.
- Avoid erasing Verify protection merely to dodge this cost: “Keyless OIDC reduces key custody; managed keys offer offline/air-gapped control but require rotation and protection”.
- Do not replace the evidence path-
verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role-with a screenshot or a mutable tag.
cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeef: practical choices
Strengths: Cosign signs or keylessly attests a release manifest digest, and verification checks the trusted identity, certificate/issuer and digest match before deployment. Notary-style trust systems also separate tag trust from arbitrary signatures, but deployment must consume their policy.
Watch out: Keyless OIDC reduces key custody; managed keys offer offline/air-gapped control but require rotation and protection.
Strengths: It can begin with cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeef and fewer surrounding controls.
Watch out: It silently accepts accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild, which makes the result hard to reproduce after promotion.
Strengths: Signing a tag is dangerous if the tag moves; a signature proves who attested a manifest, not that the image is vulnerability-free. A private signing key on a CI runner and unaudited verification roots create another supply-chain weakness.
Watch out: The platform adds an ownership and debugging layer; retain verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role as the direct check.
Interview signals & numbers to know
When this topic comes up
- cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeef
- verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role
- Failure signature: accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild
- Trade-off: Keyless OIDC reduces key custody; managed keys offer offline/air-gapped control but require rotation and protection.
Benchmarks & rules of thumb
- 1 digest
- unit of signature verification
- 2 identity dimensions
- issuer plus repository/workflow identity
- 0 security claims
- beyond the attestation unless policy checks them
Common mistakes & follow-ups
Common interview mistakes
- Treating a successful
cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeefas proof and skippingverify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role. - Accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild
- Optimizing Cosign without accepting that keyless OIDC reduces key custody; managed keys offer offline/air-gapped control but require rotation and protection.
Likely interviewer follow-ups
- Why does
cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeefaddress Cosign here rather than through application code? - How would you distinguish healthy Notary from the failure “accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild” using
verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role? - When would this trade-off-“Keyless OIDC reduces key custody; managed keys offer offline/air-gapped control but require rotation and protection”-justify a different Verify design?
cosign sign --yes ghcr.io/acme/api@sha256:deadbeef; cosign verify --certificate-identity-regexp=acme/actions ghcr.io/acme/api@sha256:deadbeef-and one proof-verify the OIDC issuer/identity, certificate transparency bundle and digest in a clean environment after rotating the keyless signing role. Then name the boundary: accepting any valid Cosign signature without constraining issuer and workflow identity, or signing once before a final rebuild.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Image Signing, Verification & Supply Chain Security (Cosign, Notary) with generative AI interview Q&A and hands-on practice.