Image Supply Chain Security: Admission Verification with Cosign & Kyverno
Admit only signed images by verifying Cosign signatures at admission time.
In plain words
Cosign is a seal tied to the exact crate digest, while Kyverno checks that the maker and seal match the approved maker list at the door. The simple Kubernetes rule is: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
Think of it like…
Cosign is a seal tied to the exact crate digest, while Kyverno checks that the maker and seal match the approved maker list at the door.
Where you’ve seen it
During an access review, the security engineer runs kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123. Expected evidence: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact. If the run instead shows this symptom, stop and restore the last known state: Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer.
Words you’ll hear
- Cosign
- For this lesson, Cosign is the controlling idea: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
- Admission
- Admission is the checkpoint; run
kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123and inspect the owner chain. Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer. - Signatures
- Signatures is the outcome to preserve; the cost is explicit: Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed.
- Verification evidence
- The evidence command is
kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123. It connects the declaration to this behavior: Admit only signed images by verifying Cosign signatures at admission time.
Visual diagram
Theory & deep dive
How Cosign reaches the intended state
Admit only signed images by verifying Cosign signatures at admission time. Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
The concrete checkpoint is kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123; compare the Cosign owner, Admission state, and Signatures outcome instead of treating YAML acceptance as proof.
Run kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123 after the change and correlate the result with Events and the owning object. Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
Admission: failure boundary and production cost
Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer. The prerequisite contract is concrete: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed. A safe design limits blast radius, records the last good configuration, and uses kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123 as a deterministic rollback checkpoint.
Capture the current state with kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer.
How it works, step by step
Step 1 of 41. Model the trust boundary
Name the identity, action, resource, and trust boundary before choosing a control: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
- Goal
- Admit only signed images by verifying Cosign signatures at admission time.
- Owner
- Cosign
When to use it & trade-offs
What it is
Admit only signed images by verifying Cosign signatures at admission time. Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
Why it matters: Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer. The invariant at risk is specific: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact. The quickest fact check before changing the design is kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123.
When to reach for it
- Use Cosign to enforce this invariant: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
- Use Admission evidence from
kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123in reviews and incident timelines. Admit only signed images by verifying Cosign signatures at admission time. - Choose the hosted security service route only when this cost is justified by governance or scale: Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed.
When to avoid or be careful
- Avoid assuming Cosign is complete after YAML submission; the required behavior is concrete: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123first: Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer. - Avoid adopting a heavier platform wrapper before measuring its cost: Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed.
Native, manual, and managed paths for Cosign
kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123.Strengths: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
Watch out: Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed. Recovery must also recognize this signal: Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer.
kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123; the expected invariant is: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.Strengths: kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123 gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike Cosign, it does not make this symptom self-documenting: Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer.
kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
Watch out: The added platform ownership buys value at this cost: Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
- Trace Cosign to Signatures through Admission; the invariant is: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
- Recognize the symptom: Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer.
- Justify the cost: Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed.
- Verify with kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123 instead of only inspecting YAML.
Benchmarks & rules of thumb
- 2
- immutable inputs: image digest and certificate or public key identity
- 1
- attestation or signature policy should bind an issuer and subject
- 0
- integrity guarantee from signing a repository tag without digest semantics
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the Cosign owner contract: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact.
- Ignoring this telltale condition leads to unrelated changes: Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer.
- Repeating
kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123without an owner for remediation wastes retry cost. Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact?
- Which owner object, logs, and Events would you inspect for this symptom-Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer-?
- At what threshold would this cost become unacceptable: Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed?
kubectl get clusterpolicy verify-images; cosign verify --certificate-identity=release@acme.example registry.example/api@sha256:abc123, name the failure, then justify the cost. Invariant: Cosign signs image digests, and Kyverno admission can verify signatures, attestations, issuers, subjects, and transparency evidence before pulling a trusted artifact. Failure: Verifying only a mutable tag, accepting any issuer, omitting digest pinning, or allowing the first mutable admission cache can trust the wrong producer. Cost: Signature verification raises supply-chain confidence, but keyless identity, Rekor availability, offline operation, and emergency override paths must be designed.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Image Supply Chain Security: Admission Verification with Cosign & Kyverno with generative AI interview Q&A and hands-on practice.