Pinning a container image to a digest feels like certainty. image: app@sha256:7360... always pulls the same bytes, and that is worth something. But a digest answers only one question, the smallest one: are these the bytes I named? It says nothing about who built them, from what source, what is inside them, or whether any of it is known to be exploitable today. A cluster that only checks digests is a cluster that will faithfully, reproducibly run a backdoor, as long as you pinned the backdoor.

Closing that gap means asking an image for more before it is allowed to run: a signature from a build you trust, a record of where it came from, a list of what is inside, and a recent scan. That is a lot of machinery, and most write-ups about it stop at “and then the cluster verifies all of this.” The interesting questions are the ones after that sentence. What does “verifies” actually look at? What happens when the thing doing the verifying can’t reach the internet? What is genuinely impossible to fake, and what is just the build process vouching for itself?

The Rabbit Hole Generator picked kubernetes-supply-chain-admission this week, a reference lab that wires exactly this check into a throwaway Kubernetes cluster and, unusually, ships the negative tests to prove each control actually bites. I ran it, then spent most of my time on the questions it sets up but doesn’t dwell on: I timed the verification cold and warm, cut the cluster off from the registry to watch it fail, fed it an image signed by the wrong party, added a rule the author lists as missing and watched it work, and traced exactly which of the four checks is unforgeable and which is a promise. Everything ran in Docker on a Mac, at no cloud cost.

A note on provenance for this post, too: the series works through a backlog, so this pick is from mid-October, but the repository is actively developed. I tested the newest code (commit 9afe9c8, December 1, which matched the upstream main branch exactly), on the newest release of the policy engine it uses, and I checked every limitation I describe against the project’s own threat model and decision records before calling it a finding. Where the author already documents something, I say so and show what it measures to. That is a better and more honest story than pretending to discover it.


What is attestation-based admission control in Kubernetes?

Attestation-based admission control is the practice of making a Kubernetes cluster refuse to run a container image unless the image arrives with signed evidence about itself, checked at the moment a pod is created. In this lab the evidence is four things: a cryptographic signature tying the image to one specific build pipeline, signed SLSA provenance naming the source it was built from, a signed CycloneDX software bill of materials listing what is inside, and a signed vulnerability scan no older than a day that found nothing critical. The cluster reads all four from the registry and evaluates them in-line; an image missing any one is rejected with the specific reason. The checks run through Kyverno, a policy engine, backed by two native Kubernetes rules that hold the line even when Kyverno itself is unavailable. It is a reference design that runs on kind (a whole Kubernetes cluster inside a Docker container) for free, not a product, and its value is that every claim it makes ships with a test that proves the claim fails when it should.


The Architecture: four checks, two of them unforgeable, and a floor underneath

A few terms first, because this stack is acronym-dense and the whole point gets lost if any one of them is a black box.

  • Admission control is the checkpoint every kubectl apply passes through. After the API server (Kubernetes’ front door) knows who you are and that you’re allowed to try, and before it writes anything to its database, a chain of admission rules gets to say yes, no, or “let me change that first.” It is the cheapest place in Kubernetes to say no, because nothing has been created yet. Last week’s post on KubeAPT was about auditing this layer from the outside; this week is a worked example of a cluster that actually enforces at it.
  • A signature, here, is made with cosign keyless signing. Traditional signing needs a private key that lives somewhere and can be stolen. Keyless signing has no long-lived key: the build pipeline proves its identity to Sigstore (an open-source signing service) using a GitHub-issued OIDC token, a short-lived token that says “I am this exact GitHub Actions workflow,” and gets back a certificate good for a few minutes. The signature records which workflow signed, not who holds a key. There is no key to leak. I come back to why this matters a lot.
  • Provenance is a signed statement of where an image came from: which repository, which commit, which build. The format here is SLSA provenance (Supply-chain Levels for Software Artifacts, a framework for exactly these claims). SLSA defines a ladder of build levels; the distinction between its levels turns out to be the crux of this whole post, so hold that thought.
  • An SBOM (software bill of materials) is the ingredients list: every package in the image, with versions. CycloneDX is one standard format for it. An SBOM alone makes no decision; it tells you what’s inside and leaves “may it run?” to something else.
  • The scan is a vulnerability report from Trivy (an open-source scanner), signed and attached, listing known vulnerabilities (CVEs, publicly catalogued flaws) found in those packages.
  • All three of those (provenance, SBOM, scan) are in-toto attestations: a standard envelope (in-toto is a framework for signed statements about software) that wraps a claim and a signature together. “Signed provenance” means provenance in an in-toto statement signed with cosign.
  • Kyverno is the policy engine that reads all this from the registry and runs the rules. It works as a webhook: the API server calls out to it over HTTPS during admission and waits for a yes or no. A webhook that is down or slow is its own problem, which this lab takes seriously.
  • A ValidatingAdmissionPolicy (VAP) is Kubernetes’ built-in kind of admission rule, evaluated by the API server itself with no external service. The lab uses two of these as a floor under Kyverno.

With that, here is the shape of it.

Diagram: on the left, the publish workflow builds an image and pushes it to ghcr.io by digest, signs it keyless through GitHub OIDC and Sigstore (Fulcio issues the cert, Rekor logs it), and attaches three signed attestations (SLSA provenance, CycloneDX SBOM, Trivy scan). On the right, a kubectl apply into a verified namespace passes through three gates in order: the native registry-allowlist VAP (every image from this repo’s path, by digest, runs even when Kyverno is down, cannot check a signature); the native images-need-kyverno guard (is Kyverno’s webhook still registered? if missing, deny); and the Kyverno verify-images webhook, which reads the registry for every image the pod uses and checks a signature by one exact identity, provenance naming this repo, a CycloneDX SBOM, and a scan that found nothing critical. All four pass means the pod runs; any one failing means it is refused with the reason.

The build side is a GitHub Actions workflow that runs daily. It builds the image, pushes it to GitHub’s container registry by digest, signs it keyless, and attaches the three attestations. The signing identity is exactly one thing: .github/workflows/publish.yml on the repository’s main branch, issued by GitHub Actions. Not “an account,” not “a key,” one workflow file on one branch. The scan is re-run every day so the attestation the cluster reads is never more than a day old.

The admission side has three gates, in order:

  1. registry-allowlist is a native VAP the API server runs itself. It checks the cheap, structural half of the rule: every image the pod uses comes from this repository’s registry path, by digest. It can’t check a signature, but because it’s built into the API server it keeps working even if Kyverno is gone.
  2. images-need-kyverno is a second native VAP whose only job is to notice if Kyverno has disappeared. When Kyverno’s admission controller is scaled to zero, it deletes its own webhook registrations, and a webhook that isn’t registered isn’t called, so its “fail closed” setting has nothing to fail. This guard refuses every pod in the protected namespace while Kyverno’s webhook is missing. The author’s phrase for it is “an outage, not a hole,” and it’s a genuinely clever use of a native policy to watch for the absence of another policy.
  3. verify-images is the Kyverno policy that does the real work: for every image the pod references, read the signature and the three attestations from the registry and check all four conditions.

“Every image the pod uses” is doing more work than it sounds. A pod can pull images in four places: its normal containers, its init containers (which run first), the ephemeral containers that kubectl debug attaches to a running pod, and image volumes (files shipped as an image and mounted in). The lab’s own history shows it originally checked only the first and let the other three through; the current policy reads all four. I didn’t have to find that, the project documents it in a decision record and tests it, but it’s the kind of gap that makes “we verify images” quietly untrue, and it’s worth knowing the question has four answers, not one.

The design bet across all of this is native where possible, one engine where not. Use the API server’s own admission features for the floor, add a single policy engine for the cryptographic checks, and make the engine’s own disappearance fail closed by a native rule. That’s a thoughtful architecture, and the lab’s negative tests are what let me believe it rather than take its word.


The Reality Check: where this breaks

That’s the pitch. Each week the Rabbit Hole Generator also writes a critique of its pick: where it fails at scale, what it quietly assumes, and what new weakness it might introduce. This week’s critique had six distinct points, and they group cleanly:

  • Points 1 to 3 are about scale and operations: registry round-trips on the hot path, fleet-wide policy consistency, and the behavior of a hard outage. I tested 1 and 3 directly on the cluster and reasoned about 2 from the design.
  • Points 4 and 5 are assumptions the design rests on: that the trusted build identity stays uncompromised, and that a one-day-old clean scan is a good enough release gate. I tested the mechanics of both.
  • Point 6 is the weakness the design itself introduces: it concentrates deployment authority into one build identity. This is the most instructive part, and the honest version of it is more subtle than “the pipeline could be hacked.”

1. Registry round-trips put latency on every new pod (tested)

Every verified admission reads the image’s signature and attestation bundles from the registry. That’s network I/O on the pod-creation path, subject to the registry’s latency and rate limits. I measured it cold and warm in lab step 4: about 6 seconds the first time an image is verified, about 0.3 seconds once Kyverno’s cache is warm. Fast when cached, but the registry is unavoidably on the critical path, which sets up points 3 and 6.

2. Fleet-wide, this is a policy-distribution problem, not a cluster problem (reasoned)

One kind cluster is easy. Hundreds of clusters means distributing identical policies, the one trusted signer identity, the registry path, and any emergency exceptions to every one of them, and keeping them consistent as they drift. This lab is deliberately one cluster; it doesn’t pretend to be a fleet tool, and I didn’t pretend two containers were a fleet. The honest note is that the hard part at scale isn’t the admission logic in this repo, it’s the GitOps and secret-distribution layer around it, which is a different repository’s job. I flag it rather than fake it.

3. A hard outage converts a dependency into a deployment outage (tested)

Because verification reads the registry (point 1) and fails closed by design, a registry or Sigstore outage doesn’t let bad images in, it stops all new pods in the protected namespace. Lab step 6 cuts the cluster off from the registry and watches exactly this: new pods wedge at the webhook’s 30-second timeout and are refused, a Deployment created during the outage brings up zero replicas, and a replica deleted during the outage isn’t replaced until the registry returns. Running pods keep running. This is the price of “fail closed,” paid honestly.

4. It assumes the one trusted build identity is uncompromised (tested, and this is point 6’s twin)

The entire model trusts that publish.yml on main is honest. The signature proves that workflow signed, and nothing a build step does can forge that (the identity comes from GitHub’s own token). But what the provenance says, including the source repository it names, is written by a step inside that same build job. Lab step 7 separates these two very different kinds of trust: one is cryptographic and unforgeable, the other is the build vouching for itself.

5. It assumes a one-day-old clean scan is a good enough gate (tested)

“No critical vulnerabilities as of the last daily scan” is the release boundary. That misses vulnerabilities published after the scan, non-OS application flaws the scanner doesn’t see, and severity disputes. Worse, the policy as written checks that the scan found nothing critical, not that the scan is recent, so if the daily pipeline stops, the cluster keeps trusting an ever-older clean scan. Lab step 8 shows the drift with real data (five new CVEs appeared in the scanner’s database overnight), and then adds the freshness rule the author lists as missing and watches it reject a stale scan.

6. Introduced vulnerability: all deployment authority collapses to one build identity (tested)

This is the critique’s headline and point 4’s other half. Compromise the publish workflow, a reusable workflow it calls, the GitHub token path, or the OIDC signing context, and an attacker produces an image with a valid signature, valid provenance, a valid SBOM, and a clean scan, all of which admission accepts, because admission’s job is to check that these artifacts exist and are signed by the expected identity, not to re-derive whether they’re true. Lab step 7 demonstrates the boundary: a real signature from the wrong identity is refused instantly, but the provenance’s claims about its own source are only as honest as the build that wrote them. The author grades this correctly in the project’s own decision records, and I’ll show exactly what SLSA says about it.

Note what I’m not claiming. These are real limits, and most of them are the unavoidable shape of this kind of control rather than bugs. The lab is honest about all six in its own threat model; what I added was measuring them.


The 30-Minute Lab: from “it verifies images” to “here is exactly what that’s worth”

The Rabbit Hole Generator’s challenge was to build a fresh kind cluster, run the repository’s own test suite, and confirm it refuses the deliberately bad images while admitting the good one. That’s step 1 and it’s a good start. Everything after it is the part that answers the questions the suite sets up but doesn’t chase: how fast, how it fails, what’s forgeable, and how to close the freshness gap. It took a lot longer than 30 minutes, because each answer raised the next question.

The extra scripts I wrote are in this post’s bundle: start with README.txt. The policies, images, and cluster config are the upstream project’s; I didn’t reproduce them, I cloned the repo and ran its own Makefile.

1. Building the lab

Diagram of the lab: a Mac host with Docker Desktop (10 CPU, 8 GB) holds the repo clone at commit 9afe9c8 (run with make up / make test, tools pinned in .cache/bin) and a lab folder with my added scripts (digests.sh, pod.sh, time-admission.sh, cold-admission.sh, registry-outage.sh in red, age-rule.yaml in blue). A single kind node running Kubernetes v1.37.0 holds the kube-apiserver admission chain (registry-allowlist native VAP, images-need-kyverno guard, verify-images to the Kyverno webhook), a kyverno namespace with the admission controller (Kyverno 1.20.0, chart 3.10.0, 60-minute verification cache, scaled to zero to simulate down), and a workloads namespace labeled verified=true with Pod Security restricted. The node’s own containerd pulls images directly; only the verifier’s reads go to ghcr.io and the Sigstore TUF root, both free for a public repo, and the outage script cuts only that path.

The whole lab is one Kubernetes node in a container and two public services it reads. The repository’s own tooling installs kind, kubectl, Helm (Kubernetes’ package manager, used to install Kyverno) and a schema validator into a local .cache/bin, each pinned by version and SHA-256 hash, so nothing lands on the Mac uninvited and a reader gets the exact versions I did. The node image is pinned by digest. Two commands stand it up:

git clone https://github.com/heyvaldemar/kubernetes-supply-chain-admission.git
cd kubernetes-supply-chain-admission
make up      # kind cluster + Kyverno + the verified namespace and both native policies

make up creates the cluster, installs Kyverno from the pinned chart, applies the namespace and the two native VAPs, and waits for the Kyverno policy to report ready. One nuance worth knowing if you build on this: there’s a deliberate wait loop in the install script because “Kyverno’s deployment is rolled out” and “Kyverno’s webhook is actually answering” are different moments, and applying the image policy a second too early fails with a connection refused. The author hit that on a fresh CI cluster and added a retry; it’s the kind of timing gap that reads as a flake until you understand it. On my first make up the whole thing took about 95 seconds.

Why kind, specifically. The verification this lab does is real only if the signatures and attestations are real. They are: the repository’s own GitHub Actions workflow builds and signs these images every day, against the public Sigstore instance, and pushes them to a public registry. So the cluster is a local toy, but the artifacts it verifies were produced by a real pipeline with a real keyless identity. That’s the combination you want for a lab like this, and it’s why I could cut the cluster off from the registry later and watch real verification fail, rather than a mock.

One thing to set up for the timing and outage work: a couple of tiny helpers. pod.sh prints a pod manifest shaped to pass Kubernetes’ built-in Pod Security “restricted” standard (non-root, no extra capabilities, read-only root filesystem), which the protected namespace also enforces, so a refusal is always about the image and never about the pod’s shape. digests.sh resolves each demo tag to the digest it points at today, so every later command pins the exact bytes.

2. The suite: eleven claims, each with its negative test

Before adding anything, I ran what the challenge asked for: the repository’s own end-to-end suite against the fresh cluster.

make test
PASS  signed: admitted and running
PASS  unsigned: refused (every image is signed by this repository's publish workflow on main)
PASS  vulnerable: refused (a signed scan that read its operating system's packages and found nothing critical)
PASS  no-provenance: refused (every image carries signed provenance that says it was built from this repository)
PASS  no-sbom: refused (every image carries a signed CycloneDX SBOM)
PASS  no-scan: refused (every image carries a signed scan ... found nothing critical)
PASS  by-tag: refused (images come from ghcr.io/heyvaldemar/kubernetes-supply-chain-admission/, by digest)
PASS  other-signer: refused (images come from ghcr.io/.../, by digest)
PASS  init-unsigned: refused (every image is signed by this repository's publish workflow on main)
PASS  volume-unsigned: refused (every image is signed by this repository's publish workflow on main)
PASS  volume-elsewhere: refused (images come from ghcr.io/.../, by digest)
  [... with Kyverno scaled to zero, unsigned/signed/other all refused; with Kyverno back, refused again ...]
  [... an ephemeral container: signed admitted, unsigned and other-registry refused ...]

Twenty checks, all green, plus one informational note. This is the part most “supply chain” demos skip. It’s easy to show a bad image being blocked; it’s the signed: admitted and running line that proves the policy didn’t simply refuse everything. Each refusal is paired with a positive control, so no check can pass by accident of the cluster being broken. That pairing is the single thing I’d copy into any policy work: a rule you’ve only ever seen say “no” is a rule you haven’t tested.

The informational note is worth reading too:

note  Kyverno removed its webhook configuration as it went down: only the API server's guard is left to refuse

That’s the images-need-kyverno guard from the architecture doing its job. The suite scales Kyverno to zero, which makes it delete its own webhooks, and then confirms the native guard refuses pods anyway. Without that guard, scaling Kyverno to zero would be a hole; with it, it’s an outage. The difference is the whole point of gate 2.

The challenge also asked me to run the Rabbit Hole Generator’s own little report script over the suite output. It parses the PASS/FAIL lines and exits non-zero if it sees a failure or no rows at all:

Admission checks observed: 19
Harness failures: 0

(It reads 19 of the 20 lines; one case’s message contains a colon that its regex trips on, which is a quirk of the throwaway parser, not the suite. The suite itself exits 0.) The deliberate design there: the report refuses to call a run successful if it saw nothing, so a cluster where every probe errored out can’t masquerade as a hardened one. Same lesson as the AI alert-triage copilot that defaulted to “looks fine” when it couldn’t actually see; “no findings” and “didn’t look” must never produce the same exit code.

3. What the four attestations actually contain

The suite proves the checks work. It doesn’t show you what’s in the artifacts, and you can’t reason about what the checks are worth without looking. So I pulled the signature and all three attestations off the live signed image and read them, using cosign exactly the way anyone can without a cluster:

cosign verify ghcr.io/heyvaldemar/kubernetes-supply-chain-admission/app:latest \
  --certificate-identity https://github.com/heyvaldemar/kubernetes-supply-chain-admission/.github/workflows/publish.yml@refs/heads/main \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com
Verification for ...app:latest --
The following checks were performed on each of these signatures:
  - The cosign claims were validated
  - Existence of the claims in the transparency log was verified offline
  - The code-signing certificate was verified using trusted certificate authority certificates

Read the middle line, because it’s the thing that surprises people: the transparency log was verified offline. Rekor is Sigstore’s public, tamper-evident log of every signature. You might expect verification to phone Rekor at admission. It doesn’t: each signature bundle carries its own inclusion proof, and cosign checks that proof against Rekor’s public key (fetched once from Sigstore’s trust root), without a network call to Rekor. That’s worth internalizing, because it means the admission path depends on the registry being reachable but not on Rekor. The author confirms this from the code in the threat model, and the signature output confirms it from the outside; I’ll lean on it in the outage test.

Now the three attestations. The provenance, decoded:

{
  "predicateType": "https://slsa.dev/provenance/v1",
  "predicate": {
    "buildDefinition": {
      "resolvedDependencies": [{
        "uri": "git+https://github.com/heyvaldemar/kubernetes-supply-chain-admission@refs/heads/main",
        "digest": {"gitCommit": "9afe9c82327ebd4f9f6ed71a95ae9648f2cc2079"}
      }]
    },
    "runDetails": {
      "builder": {"id": ".../publish.yml@refs/heads/main"}
    }
  }
}

The field the policy keys on is resolvedDependencies[].uri: the policy requires it to start with git+https://github.com/heyvaldemar/kubernetes-supply-chain-admission@. That’s what “built from this repository” means mechanically. If you’re verifying someone’s provenance, this uri is the field to read, and the gitCommit next to it tells you the exact source revision, which here matched the commit I’d cloned. Keep an eye on who wrote this field, though; it becomes the whole story in step 7.

The SBOM is CycloneDX 1.7, produced by Syft 1.54.1, listing 98 components: Alpine 3.22.8 as the base OS and its packages (musl, busybox, libcrypto3, and so on). The policy’s check on it is deliberately shallow, just that the payload’s bomFormat is CycloneDX. An SBOM is inventory; the decision lives in the scan.

The scan is the interesting one, because it has a subtle trap the author hit and documented. It’s a Trivy report in the cosign-vuln format. Here’s the shape that matters:

image: app@sha256:7360...  (alpine 3.22.8)  Class: os-pkgs
  HIGH: 2   MEDIUM: 7   LOW: 6   UNKNOWN: 3   CRITICAL: 0

The policy requires two things of this, and the second is the clever one. First, no finding of severity CRITICAL, which is obvious. Second, and this is the trap: the scan must contain a result of class os-pkgs before the severity check even runs. The reason is a real failure mode the author found during the build and raised with Trivy’s maintainers: the very first demo image was built on busybox, which Trivy doesn’t recognize as a Linux distribution, so it reported no results at all, and a naive “zero criticals” rule would read “scanned nothing” as “found nothing.” A scan that saw nothing is not a clean scan. The fix is to build on Alpine (which Trivy knows) and require a result that actually read OS packages. That’s the single best lesson in the whole repo: a passing scan and an empty scan look identical if you only count criticals.

4. Timing it: 6 seconds cold, 0.3 warm, and the registry is always in the loop

Reality Check 1 is about registry latency on the admission path. “Reads the registry” is abstract; I wanted the number. time-admission.sh times a server-side dry run (a request the API server fully evaluates, admission and all, then discards without saving) of a signed pod. Warm, with Kyverno’s verification cache hot:

warm-signed  1  0.41s   pod created (server dry run)
warm-signed  2  0.33s
warm-signed  ...        ~0.3s each

Then the cold path. Kyverno caches verification results for 60 minutes by default, so to see the real cost I cleared the cache the honest way, by restarting its admission controller, and timed the first admission after each restart against the next one. cold-admission.sh does that six times:

round1-cold  6.16s      round1-warm  0.41s
round2-cold  6.89s      round2-warm  0.29s
round3-cold  5.98s      round3-warm  0.27s
round4-cold  5.74s      round4-warm  0.27s
round5-cold  6.17s      round5-warm  0.30s
round6-cold  5.52s      round6-warm  0.27s

That’s a clean, repeatable 20x gap: roughly 6 seconds to read the signature and three attestation bundles from the registry and verify them, roughly 0.3 seconds once that result is cached. The number to key on is the cold one, because that’s what every genuinely new image costs, and what a cache flush or a Kyverno restart resets you to. On a busy cluster rolling many distinct images, you’re paying the 6-second read far more often than the cache-warm 0.3. The author’s own measured range across CI runs is 4 to 26 seconds, with 30 seconds as the configured ceiling before the webhook times out; my laptop sat at the low end of that, which makes sense with a fast local connection to GitHub.

Why run this rather than just cite the threat model’s range? Because the shape is the finding: verification time is dominated by registry round-trips, not CPU, so it scales with how many distinct images you admit and how reachable your registry is, not with how big your cluster is. That’s exactly what makes the next test matter.

5. The signature is unforgeable; the registry path is a second question

Before cutting the registry off, one quick test that sharpens what each gate is for. The suite’s other-signer case uses the real cosign container image, which carries a genuine, valid Sigstore signature, just signed by Sigstore’s own release workflow, not this repository’s. With both gates in place, the native registry-allowlist refuses it first, for the dumbest possible reason: wrong registry path.

ValidatingAdmissionPolicy 'registry-allowlist' denied request:
  images come from ghcr.io/heyvaldemar/kubernetes-supply-chain-admission/, by digest

That’s the floor doing cheap structural work before anything expensive runs. To see the cryptographic refusal, I removed the allowlist binding so Kyverno alone had to answer, and sent the same validly-signed cosign image:

ValidatingAdmissionPolicy 'verify-images' failed:
  every image is signed by this repository's publish workflow on main;
  ... image "ghcr.io/sigstore/cosign/cosign:v3.1.3@sha256:9e5c...": 
  failed to verify log inclusion: transparency log certificate does not match

A real signature, cryptographically valid, refused because the identity behind it is the wrong workflow. This is the thing keyless signing buys you that a plain “is it signed?” check does not: the policy pins one exact signer identity (publish.yml on main), so a signature from any other workflow, even a famous and legitimate one, is useless here. There is no key to steal and no “signed by someone in the org” loophole. (I restored the allowlist immediately after; the two gates are meant to run together.)

Hold onto that word identity, because step 7 is about the one thing the identity can’t vouch for.

6. Pulling the plug on the registry: fail closed, measured

Reality Check 3 says a registry outage becomes a deployment outage. Since verification reads the registry on every cold admission (step 4) and fails closed by design, I wanted to watch it rather than assert it. registry-outage.sh cuts the cluster off from GitHub’s registry two ways at once: it points ghcr.io at a dead address in the cluster’s DNS, and drops forwarded traffic to GitHub’s network range inside the kind node. Both are needed: DNS alone wasn’t enough, because Kyverno keeps its HTTPS connections to the registry open and reuses them, so it never re-resolves the name. The node’s own image pulls go a different path and are untouched, so this cuts off the verifier specifically, which is exactly the failure I wanted to model.

With the registry unreachable, a brand-new signed pod:

Error from server (InternalError): ... failed calling webhook
  "ivpol.validate.kyverno.svc-fail-finegrained-verify-images": ... context deadline exceeded

Thirty seconds, then refused. That’s the webhook’s timeout ceiling: Kyverno can’t reach the registry to read the bundles, so it never answers, and the API server fails the request closed. For an image Kyverno hadn’t cached, the error names the cause outright:

Policy verify-images error: failed to evaluate policy: failed to get imagedata:
  Get "https://ghcr.io/v2/": dial tcp 192.0.2.1:443: i/o timeout

So far, so expected. The question that actually matters for an operator is what this does to workloads, so I ran three scenarios:

  • A running pod during the outage: untouched. The signed pod that was already running stayed Running the entire time. Fail-closed is about admission, not about killing what’s already up.
  • A new Deployment created during the outage: zero replicas. The Deployment object is created, but every pod its ReplicaSet tries to make is refused at admission, and FailedCreate events pile up with the webhook-timeout error. The app never starts.
  • A replica of a running Deployment deleted during the outage: not replaced. I had a healthy 2-replica Deployment, deleted one pod, and the replacement couldn’t be admitted. I was left running at 1 of 2, with the controller retrying and failing, until the registry came back.

Then I restored the registry and timed recovery:

2/2 ready 6s after the registry came back

Six seconds. The controller’s next retry sailed through, Kyverno read the bundles, both replicas came up. So the full picture of Reality Check 3, measured: a registry (or Sigstore trust-root) outage is a deployment freeze for the protected namespace, not a breach and not an outage of running workloads, and it self-heals within seconds of the registry returning. That’s the correct trade for a security control, and it’s a very different operational commitment than “images are verified” makes it sound. The practical mitigations the threat model lists (run Kyverno with multiple replicas, alert on it, keep the registry highly available) are about shortening this freeze, not eliminating it, because the registry is fundamentally on the path.

7. The one check that is a promise, not a proof

Now the heart of it: Reality Checks 4 and 6, the introduced vulnerability. The claim is that all deployment authority collapses into one build identity. I want to be precise about what that does and doesn’t mean, because the sloppy version (“the pipeline could be hacked”) is true of everything and teaches nothing. The useful version is about which of the four checks can be forged by a compromised build and which cannot.

Start from what step 5 proved: the signature is unforgeable by anything short of compromising the build identity itself. It’s a keyless signature tied to publish.yml@main through GitHub’s OIDC token, which no step inside the build job can mint for a different identity. A real signature from the wrong workflow is refused. Good.

Now look again at the provenance field from step 3, the one the policy trusts to mean “built from this repository”:

"resolvedDependencies": [{
  "uri": "git+https://github.com/heyvaldemar/kubernetes-supply-chain-admission@refs/heads/main"
}]

Here is the uncomfortable part, and it’s the thing the whole post is built around. Look at how that field is produced, in the publish workflow:

# a step *inside* the build job writes the provenance, then signs it
python3 - "$out/provenance.json" <<'PY'
  json.dump({"buildDefinition": {
      "resolvedDependencies": [{"uri": f"git+{server}/{repo}@{ref}", ...}]
  }, ...}, ...)
PY
cosign attest --type slsaprovenance1 --predicate "$out/provenance.json" "$ref"

The provenance is written by a step of the build job and then signed with the build job’s identity. So a step of the build can write anything into those fields. The signature proves the publish workflow signed the statement; it does not prove the statement is true, because the same workflow authored it. If an attacker controls a build step, the provenance saying “built from the official repo” is just a sentence that step chose to write. This is the same seam two earlier posts in this series pulled on from other angles: the oci-explorer post found a clean “Grade A” supply-chain score that was signed by nobody, and the proofbundle post built a forged receipt that still verified. A well-formed, correctly-signed artifact and a true artifact are different claims, and admission checks the first.

This isn’t me catching the author out. It’s exactly what SLSA build levels formalize, and the repository grades itself correctly against them in a decision record. Briefly, in plain language:

  • Build L1 means provenance exists and is signed. You can read where something claims to have come from.
  • Build L2 adds that the provenance is generated by the build platform, not by a tenant’s build step, and that the platform keeps the build from tampering with it.
  • Build L3 adds strong isolation so even the build can’t reach the signing material.

The ladder is about exactly this question: who wrote the provenance, and could the thing being built have lied in it? These images are Build L1. The author’s decision record says so in as many words, having initially written “L2” and corrected it: “every field is written by a step of the publish job and signed with that job’s keyless identity, so a step of the build could write anything into it.” (The upgrade path to L2 or L3 is to have the build platform, or an isolated generator, produce the provenance, which GitHub offers but this reference lab doesn’t use.)

So the honest reading of the four checks:

Check What a compromised build step can do
Signature (identity) Cannot forge. The identity is GitHub’s OIDC token for this workflow; a build step can’t mint another.
Provenance (source) Can write freely. It’s Build L1: a build step authors the fields, including the source uri.
SBOM (contents) Can write freely. Generated in the build; a compromised build can hand Syft, or the attestation, whatever it likes.
Scan (vulnerabilities) Can write freely. Same: the scan is run and attested in the build.

Three of the four checks are the build vouching for itself. That is still useful, don’t misread this as “it’s worthless.” Against the threats it’s designed for (an image pushed by hand, by a leaked token that isn’t the build’s identity, by a typo’d tag, by another pipeline), the unforgeable signature plus the registry floor stop everything, which is what the suite proves. The residual risk is specifically a compromised build step within the trusted workflow, and against that, admission verifies that the artifacts are present and correctly signed by the right identity, not that their contents are true. Knowing which half is which is the difference between understanding this control and cargo-culting it.

How to do better, concretely: push provenance generation up to the platform (GitHub’s own build provenance, or a SLSA generator that runs outside the build’s control) so the source claim reaches L2/L3 and a build step can’t author it; keep the signing identity pinned to one workflow (this lab already does); and treat the SBOM and scan as “signed by our build,” not “independently true,” which means an external, post-publish scan of the running digest is still worth doing. That last one is the natural bridge to the freshness problem.

8. The stale-scan gap, shown drifting, then closed

Reality Check 5: a one-day-old clean scan is the gate, and the policy checks that the scan found nothing critical, not that it’s recent. Two separate problems live here, and I tested both.

First, the drift is real and I can show it with data. The attested scan on the signed image was produced by the daily pipeline at 20:53 UTC the night before. I scanned the exact same image digest myself the next afternoon, about 16 hours later, with the same Trivy version the pipeline pins. Five CVEs that weren’t in the attested report had appeared in the scanner’s database overnight:

attested scan (16h old):  HIGH 2  MEDIUM 7  LOW 6
fresh scan (today):       HIGH 7  MEDIUM 11 LOW 8
  new since attested: CVE-2026-107494, -120666, -121482, -84785, -84786

None critical, so admission is unaffected here, but the mechanism is laid bare: the cluster is gating on yesterday’s knowledge. The image bytes never changed; the world’s knowledge of them did. A critical published at hour 17 would be invisible to the cluster until the next daily scan re-attested the image. The daily cadence bounds that window to a day, which is the design, but it’s a day during which a known-critical image admits cleanly.

I also used this moment to do the version hygiene this series insists on: I re-ran the scan on both the Trivy version the pipeline pins (0.75.0) and the current latest (0.77.0), on both CPU architectures, to be sure I wasn’t about to report a scanner quirk that a newer release had already changed. All four runs produced the identical finding set. So the drift above is real data staleness, not a tooling artifact, and the pinned scanner isn’t hiding anything the latest one would show.

Second, the policy doesn’t check freshness at all, and the author lists this as a residual risk (“it does not read the scan’s metadata.scanFinishedOn”). The scan attestation carries exactly that field, so the gap is closable with one more rule. I wrote a variant policy, age-rule.yaml, identical to the real one plus a single validation: the scan’s own scanFinishedOn timestamp must be younger than a configurable limit. Then I pointed it at the 16-hour-old attested scan at two different limits:

# limit = 12h
Policy verify-images-age failed: every image's scan is younger than 12h
# limit = 24h
pod/x created (server dry run)

Refused at 12 hours, admitted at 24, which is exactly correct for a scan that was 16 hours old. That’s the “trust but verify” close: the limit the author flags as missing is a handful of lines of CEL (the small expression language Kubernetes policies are written in), it reads a field the attestation already carries, and it turns “a scan exists and was clean” into “a recent scan was clean.” If you deploy anything like this lab, add that rule and set the limit to just over your pipeline’s scan interval, so a stalled pipeline fails closed instead of trusting an aging all-clear. The relevant key to monitor, if you’d rather alert than block, is the same scanFinishedOn.

9. A quick check that I was testing current reality

One last thing, less a lab step than due diligence, because this series has a rule about not reporting bugs that are already fixed. Before writing any of the above up as a finding, I confirmed I was looking at the live state of the world, not a stale snapshot:

  • The code: my clone’s HEAD was 9afe9c8, and git ls-remote confirmed that was the exact tip of the upstream main branch. The project’s own end-to-end workflow had passed on that commit hours earlier. So the suite I ran is the suite as it ships today.
  • The policy engine: the lab pins Kyverno 1.20.0, which is the current latest release. Several of the threat model’s findings are version-specific (how a particular Kyverno version extracts attestation payloads, which webhooks it names, how it handles duplicate attestations), and the project re-verifies each of them on every version bump. I didn’t need to chase a fix that landed upstream, because the pins are current and the author tracks exactly these.
  • The supporting tools: the scanner and signer pins are a release or two behind latest. I checked that the gap doesn’t change anything I claim: the scanner delta I verified directly in step 8 (identical findings), and the signing behavior I relied on is the keyless identity check, unchanged across the versions involved.

None of my findings are “this is broken.” They’re “here is what this correctly-working control is and isn’t worth,” which is the more durable kind of thing to know, and it only counts if you measured it against the current code. It was.


Where this fits in a real environment

This lab is a reference, not a product, and the author says so plainly. Its value in a real environment is as a correct, tested pattern you adapt, and as an unusually honest teaching artifact about what image attestation buys you.

Reach for this shape of control when you want the cluster itself, not a CI pipeline, to be the thing that refuses unverified images, because a check that only runs in CI is skipped by anything that doesn’t go through CI: a direct kubectl apply, a second pipeline, a compromised one. Admission is the one chokepoint everything passes. The keyless-signature-plus-registry-floor core (step 5) genuinely closes the large, common risks: hand-pushed images, leaked tokens, wrong-registry images, and verification silently going missing when Kyverno is down (step 2’s guard). The native-VAP floor under Kyverno is a pattern worth stealing on its own.

Where it stops being enough is bounded by the Reality Checks, and they’re specific. The registry is on the admission path, so budget for the cold-verification latency (step 4) and accept that a registry outage freezes new deployments in the protected namespace (step 6); that’s the cost of failing closed, and you manage it with registry availability and Kyverno replicas, you don’t design it away. Three of the four checks are the build vouching for itself (step 7), so if your threat model includes a compromised build step, push provenance generation up to the platform for real L2/L3 assurance and treat SBOM and scan as “signed by us,” not “independently true.” And the scan gate is only as fresh as your last pipeline run (step 8), so add the freshness rule and set its limit just above your scan interval. Underneath all of it, the lab’s own insistence on pairing every “no” with a positive control (step 2) is the practice that makes any of this trustworthy: a policy you’ve only watched reject things is a policy you haven’t tested.


Actionable Takeaways

  • A digest proves the bytes, not the pedigree. Signature, provenance, SBOM, and scan each answer a different question; verify all four at admission, not one, and know that a pod pulls images in four places (containers, init, ephemeral, volumes).
  • Pin the signer to one identity, not an account. Keyless signing tied to one workflow means a real signature from the wrong party is useless, which a plain “is it signed?” check never gives you. The wrong-signer refusal in step 5 is the whole value of keyless.
  • Know which checks are proofs and which are promises. The signature is unforgeable; provenance, SBOM, and scan are the build vouching for itself (SLSA Build L1). For real source assurance, generate provenance at the platform level, not in the build job.
  • An empty scan is not a clean scan. Require the scan to prove it actually read OS packages before you trust “zero criticals,” or a scanner that didn’t recognize your base image will pass as flawless.
  • Gate on scan freshness, not just scan results. “Found nothing critical” plus a stale pipeline means trusting an aging all-clear; check scanFinishedOn and fail closed past your scan interval. The drift is real: I watched five CVEs appear overnight (step 8).
  • Fail closed means deployments freeze when the registry is down. Running pods are fine, but new and replacement pods wedge at the webhook timeout until the registry returns (step 6). Plan registry availability and Kyverno replicas accordingly.
  • Pair every “no” with a “yes.” A rule you’ve only seen reject things might reject everything. The suite’s signed: admitted control is why its ten refusals mean something.

Verifying an image at the door is one of the highest-leverage controls a cluster has, and this lab is a rare chance to see exactly where its evidence is bedrock and where it’s the build’s word. Both are worth knowing before you trust a green check.