Cloud Edition
Kubernetes trusts by default. Any Pod can reach any other Pod, every Pod gets an API token, and any image can run. This guide removes that implicit trust with policy as code, mapped to NIST SP 800-207 and the CISA Zero Trust Maturity Model.
Each one has existed since Kubernetes 1.0. Each one maps to a chapter that closes it.
Each chapter gives you a tested Kyverno policy, shows how to check that it works, and names the other components that complete the control.
Segmentation that depends on a human setting a label correctly isn't segmentation. Derive it from a boundary the platform team controls.
workspace and tier.generate-default-denygenerate-workspace-network-policygenerate-backend-tier-policyrequire-workspace-labelsadd-workload-labelsprotect-segmentation-labelsgenerate-strict-mtlsAlso needed: a CNI plugin that enforces NetworkPolicy (Cilium or Calico), and a service mesh for mTLS.
Grant access per session instead of standing privileges, and make every grant narrow and time-bound.
restrict-wildcard-rbacrestrict-cluster-admin-bindingrestrict-escalation-verbsdisable-token-automountdisallow-default-serviceaccountrestrict-jit-labelsgenerate-jit-rolebindingAlso needed: your identity provider and API server RBAC authenticate and authorize first. Kyverno adds context-aware checks at admission.
Verify what runs before it runs, and limit what it can do if it's compromised.
restrict-image-registriesrequire-image-digestverify-signed-imagesadd-psa-restricted-labelprotect-psa-labelsrequire-restricted-pod-securityAlso needed: a CI pipeline that signs images. Models and agent skills can be verified only when they're packaged and signed as OCI artifacts.
A permanent exception is standing trust. Treat it like any other access grant.
kyverno-exceptions.govern-policy-exceptionsnode-exporter-host-networknode-exporter-compensating-controlsSet this up first. Teams need a safe way to request exceptions before you enforce anything.
Background scans re-check existing resources, including ones created before a policy existed, and write standard policy reports.
kubectl get policyreports -APolicy Reporterkyverno testAlso needed: API server audit logs for who did what, and a runtime security tool for what processes do after they start (Chapter 12).
Pick the stage that matches each pillar today. You'll get your next step and the chapter that covers it.
Each one worked because trust was implicit somewhere. The eBook maps eight documented incidents to the control that would have stopped or contained them.
An admission webhook accepted unauthenticated requests and ran with a service account that could read every Secret. More than 6,500 clusters were found exposed.
The Ray dashboard API has no authentication by default and was exposed to the internet, then used to mine crypto, steal models and spread to other nodes.
Containers with custom mount configurations could redirect writes to host paths and gain root on the node.
A compromised CI credential published a backdoored LLM gateway that harvested cloud and Kubernetes credentials and deployed privileged Pods.
The audit profile installs every core policy in Audit mode, so it reports violations without blocking anything.
Each policy has a README, Kyverno CLI tests and an end-to-end test for a local kind cluster. Browse the repo →
kyverno test to CI and start signing images.Nirmata Control Hub authors, delivers and reports on Kyverno policies and exceptions across every cluster and team, so you can track maturity by pillar fleet-wide. Nirmata Enterprise for Kyverno is a hardened, supported build of the same engine, with CVE fixes backported to every supported release.
Mapping Kubernetes controls to NIST and CISA for an audit, moving from Audit to Enforce, or rolling Zero Trust out across a fleet? Talk to the maintainers.