Write a Kyverno ClusterPolicy using verifyImages to enforce that all pods in a namespace use only images signed with a keyless cosign signature from a trusted GitHub Actions workflow

domain: kyverno.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Define a ClusterPolicy resource with a rules entry containing type: Verifyimages and an imageReferences pattern matching the target registry and image name glob
  2. In the attestors block, specify type: Keyless with the issuer set to https://token.actions.githubusercontent.com and the subject set to the GitHub Actions workflow ref (e.g., https://github.com/<ORG>/<REPO>/.github/workflows/<FILE>.yml@refs/heads/main)
  3. Set mutateDigest: true in the verifyImages rule to have Kyverno rewrite the image tag to the verified digest in the pod spec, preventing tag mutation attacks after verification
  4. Apply the policy and verify it is active using kubectl get clusterpolicy and kubectl describe clusterpolicy <NAME>; test it by deploying a pod with a signed image and confirming it is admitted, then try an unsigned image and confirm it is rejected
  5. Enable the Kyverno image verification cache (enabled by default) to reduce repeated registry lookups for the same image digest; set imageVerificationCache.ttlDuration in the Kyverno ConfigMap to control cache lifetime

Known gotchas

Related routes

Configure Kyverno verifyImages to enforce cosign keyless signature policy on Kubernetes pods
kyverno.io · 5 steps · unrated
Configure Kyverno verifyImages with cosign keyless signing using Fulcio and Rekor to enforce that only verified images are admitted
security/compliance · 5 steps · unrated
Deploy Sigstore policy-controller on Kubernetes to enforce that only images with valid cosign signatures are admitted
security/compliance · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans