Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Kyverno is a policy engine built for Kubernetes in which policies are themselves Kubernetes resources. It can validate, mutate, generate, and clean up objects, and verify container image signatures.

What Is Kyverno?
Kyverno is a policy engine designed for Kubernetes and nothing else. Its central decision is that policies are ordinary Kubernetes resources written in YAML, so a team that can read a Deployment can read a policy. There is no separate language to learn, policies are managed with kubectl and GitOps like everything else in the cluster, and results come back as Kubernetes objects. The project was created by Nirmata and is now developed under the Cloud Native Computing Foundation.
Most policy engines only say no. Kyverno has four rule types, and the three beyond validation are what make it distinctive.
Validate accepts or rejects a resource. Mutate changes it on the way in — adding a default security context, injecting a label, setting imagePullPolicy. Generate creates related resources automatically, so a new namespace can arrive with a default NetworkPolicy, a resource quota, and a pull secret already in place. verifyImages checks container image signatures and attestations before admission.
A simple validation policy looks like this:
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
name: require-run-as-non-root
spec:
validationFailureAction: Audit
rules:
- name: check-runasnonroot
match:
any:
- resources:
kinds: ["Pod"]
validate:
message: "Containers must set runAsNonRoot: true"
pattern:
spec:
=(securityContext):
=(runAsNonRoot): true
The mutate and generate capabilities are the reason teams often prefer Kyverno to a pure validation engine: instead of rejecting every manifest that forgets a default, you supply the default and reject only what genuinely conflicts with policy. That changes the developer experience from obstruction to assistance.
The verifyImages rule integrates directly with Sigstore, so a cluster can require that every image was signed by a specific identity from a specific workflow, and optionally that it carries an SBOM or SLSA provenance attestation. This is the enforcement half of Cosign signing, and without it signing is a filing exercise. Kyverno also mutates the image reference to its digest after verification, which closes the gap where a tag is repointed between the admission check and the image pull.
Kyverno runs as an admission webhook, which means a badly configured deployment can block every change to the cluster. The sequence that works:
validationFailureAction: Audit on every policy. Nothing is rejected; violations appear in PolicyReport resources.Enforce one at a time, beginning with namespaces whose owners can respond quickly.kube-system namespace and your own infrastructure components explicitly, and review those exclusions on a schedule.kyverno apply and kyverno test in continuous integration so developers see policy failures on the pull request rather than at deployment.Violations surface as PolicyReport and ClusterPolicyReport resources following the Kubernetes policy working group schema, which means compliance reporting is a kubectl get away rather than a bespoke export.
The comparison with OPA Gatekeeper comes down to language and scope. Gatekeeper uses Rego, which is more expressive and transfers to policy problems outside Kubernetes, but it is a genuine learning investment and it only validates and mutates. Kyverno stays in YAML, adds resource generation and image verification, and is easier for a platform team to hand to application teams. Clusters that need policy beyond Kubernetes, or already run Open Policy Agent elsewhere, often choose Gatekeeper for consistency.
Neither replaces Pod Security Standards, which are built into Kubernetes and cover pod privilege with no extra components. The sensible layering is Pod Security Admission for the baseline, and a policy engine for everything it deliberately does not do: registry allow lists, required labels and limits, signature verification, and your own organisational rules.
No, and that is its main selling point. Policies are Kubernetes custom resources written in YAML, using pattern matching, anchors, and JMESPath expressions for the harder conditions. Anyone comfortable reading a Deployment manifest can read and modify a policy. Recent versions also support CEL expressions for cases where declarative patterns become awkward, but most policies never need them.
It depends on the failure policy. With failurePolicy set to Fail, which is the secure default for enforcing policies, admission requests are rejected when the webhook is unreachable, so a broken Kyverno can stop deployments cluster-wide. Run multiple replicas, exclude system namespaces so the cluster can recover itself, and test the failure mode deliberately before you rely on it in production.
Yes. Mutate rules modify incoming resources before they are stored, so you can add a default security context, set a required label, pin an image to its digest, or inject a sidecar annotation. Generate rules go further and create related objects, such as a default NetworkPolicy in every new namespace. Used carefully this reduces friction, but make mutations obvious or people will be confused by manifests that change on arrival.
It can enforce the Pod Security Standards through a published policy set, and it covers much more besides. Many clusters still enable the built-in Pod Security Admission as a baseline because it needs no extra components and keeps working if the policy engine fails, then use Kyverno for the rules Pod Security Admission deliberately excludes, such as registry allow lists and image signature verification.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.