Skip to content

Lesson 3 of 9 · 23m

Verification Gates and Admission Control

Turn signatures and provenance into enforceable deploy-time policy without creating a fragile operational bottleneck.

The worst signing programs end as a Slack message saying "we signed it, right?" after production is already running the wrong thing. Verification has to be a gate: automatic, close to deployment, and explicit about failure. If an unsigned artifact can still run, the control is a suggestion.

Put the gate where execution begins

For container workloads, admission control is the natural point. A policy can require signed images and trusted provenance before the API server accepts a pod:

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: require-verified-images
spec:
  validationFailureAction: Enforce
  rules:
    - name: verify-release-signature
      match:
        resources:
          kinds: ["Pod"]
      verifyImages:
        - imageReferences: ["ghcr.io/acme/*"]
          attestors:
            - entries:
                - keyless:
                    subject: "https://github.com/acme/*"
                    issuer: "https://token.actions.githubusercontent.com"
                    rekor: {url: https://rekor.sigstore.dev}

Exact policy engines differ, but the shape is stable: choose the artifact set, define trusted identities, require verification, and enforce.

Separate bootstrapping trust from artifact trust

The gate needs its own trust configuration: issuer URLs, identity patterns, public keys, transparency log endpoints, and policy exceptions. Protect that configuration like a root of trust. If pipeline maintainers can edit both signing identity and admission policy without review, one compromise becomes end-to-end control.

Design failure behavior deliberately

An outage caused by your security gate is still an outage. Decide upfront:

unsigned production image       reject
missing transparency log entry  reject or temporary fail-open by policy?
expired certificate             verify against signing time, not current time
emergency vendor artifact       exception with expiry and owner
unknown registry                reject by default

Fail-closed is correct for high-risk production paths, but only after you have rehearsed revocation, transparency-log outages, and emergency release procedures.

Exceptions are part of the control

A permanent allow-unsigned namespace quietly becomes the official malware deployment lane. Exceptions need an owner, reason, artifact digest, expiry, and removal evidence:

exceptions:
  - digest: sha256:9c1e...
    reason: vendor emergency hotfix, no cosign support
    owner: platform-security
    expires: 2026-12-15T00:00:00Z

Review exceptions like access grants, not like comments.

Verify outside Kubernetes too

Not everything is a container. Bare-metal deploy scripts can verify signatures before copying artifacts. Serverless pipelines can verify bundle hashes before publishing. Mobile and desktop release systems can require vendor platform signatures plus internal notarization checks. The technology changes; the gate does not.

Field notes

  • Test negative cases in CI: unsigned image, wrong identity, right artifact with wrong provenance, expired exception.
  • Do not enforce tags in policy; tags can move after admission evaluation.
  • Cache verification results carefully. Never cache a failure as a success after a transient network error.
  • Log enough detail to debug rejection without logging private key or signing secret material.

Was this lesson helpful?

Sign in to rate