Essential Cloud-Native Security Tools for Kubernetes
Kubernetes security tools by layer: Trivy scanning, Pod Security Admission, Kyverno or Gatekeeper, Falco runtime detection, Cilium policies and kube-bench.
The essential cloud-native security tools for Kubernetes cover five layers: an image scanner such as Trivy, an admission policy engine such as Kyverno or OPA Gatekeeper, the built-in Pod Security Admission controller, a runtime detector such as Falco, and network policy enforcement through a CNI such as Cilium. Add kube-bench to audit the cluster itself.
This guide maps each tool to the stage of the container lifecycle it protects, so you can see where the gaps in your own cluster are. It sits under our Kubernetes architecture components guide, which explains the API server, kubelet and etcd that these tools sit beside.
Key takeaways
- No single tool secures a cluster. Each one covers a stage: build, admission, runtime, network or node configuration.
- Pod Security Admission is built into Kubernetes and has been stable since v1.25. Turn it on before you install anything else.
- Trivy scans images and other artifacts before they reach a registry. Its latest release at the time of writing is v0.76.2.
- Kyverno and OPA Gatekeeper enforce your own rules at admission time. Kyverno policies are written in YAML or CEL; Gatekeeper uses Rego.
- Falco watches system calls at runtime. It is a graduated CNCF project and uses a modern eBPF probe by default.
- Kubernetes NetworkPolicy objects do nothing unless your network plugin enforces them. Cilium adds Layer 7 and DNS-aware rules on top.
- kube-bench checks nodes and control plane settings against the CIS Kubernetes Benchmark.
Why Kubernetes needs tools at every layer
A Kubernetes cluster has several places where something can go wrong, and they are owned by different people. Developers write Dockerfiles and choose base images. Platform engineers set up namespaces, admission rules and the network plugin. Operations teams patch nodes and keep the control plane configured. A security tool that only looks at one of these places leaves the others open.
The default behaviour of Kubernetes is permissive. Pods in different namespaces can talk to each other unless a policy says otherwise. A pod can ask to run as root or mount the host filesystem unless an admission rule stops it. An image with a known vulnerable library will be pulled and run if nobody checked it. None of this is a bug. Kubernetes leaves these choices to the cluster owner, and the tools below are how most teams make them.
It helps to think of the lifecycle in order. An image is built, pushed and scanned. A manifest is submitted to the API server and checked by admission controllers. The pod starts and its processes make system calls on a node. It sends and receives traffic over the cluster network. Underneath all of it, the nodes and the control plane have their own configuration. Each of the next sections takes one of those stages.
The five layers at a glance
| Layer | What it stops | Tools covered here | When it runs |
|---|---|---|---|
| Image and artifact scanning | Known CVEs, secrets and misconfigurations in images and manifests | Trivy | In CI, before push, and on a schedule against registries |
| Built-in pod security | Privileged pods, host namespaces, root containers | Pod Security Admission | At admission, per namespace |
| Custom admission policy | Anything your organisation forbids, such as unsigned images or missing labels | Kyverno, OPA Gatekeeper | At admission, and as background scans |
| Runtime detection | Unexpected shells, file writes, network connections inside running containers | Falco | Continuously on every node |
| Network segmentation | Lateral movement between pods and namespaces | NetworkPolicy enforced by Cilium or another CNI | On every packet |
| Cluster configuration audit | Weak kubelet, API server or etcd settings | kube-bench | On demand or as a scheduled Job |
Layer 1: image and artifact scanning with Trivy
Most of the risk in a container comes from what is inside the image before Kubernetes ever sees it. An old base image or an outdated package can carry known vulnerabilities into production. Scanning at build time is the cheapest place to catch them, because the fix is a rebuild and nobody has to touch a running workload.
Trivy is an open source scanner from Aqua Security. Teams use it to scan container images, filesystems and Git repositories, and it can also check infrastructure as code files and Kubernetes manifests for misconfigurations. The project ships often. The latest release on its GitHub page is v0.76.2, published in November 2026 as a security update. Pin the version you install in CI so that a new release does not change your results without anyone noticing.
A practical setup has three parts. First, run the scanner in the pipeline after the image is built and fail the build on vulnerabilities above a severity you agree on, usually high and critical with a fix available. Second, scan the registry on a schedule, because new CVEs are published against images that passed last week. Third, keep the output somewhere people read it. A scan that writes to a log nobody opens has no effect.
trivy image --severity HIGH,CRITICAL --exit-code 1 registry.example.com/shop/api:1.4.2
The --exit-code 1 flag makes the command fail when findings match, which is what turns a report into a gate. Start with a warning-only run for a week, look at what it finds, then switch it on. Teams that turn on a hard gate on day one tend to switch it off again by day three.
Layer 2: Pod Security Admission, the built-in baseline
Pod Security Admission is an admission controller that ships with Kubernetes. It enforces the Pod Security Standards, and it has been stable since Kubernetes v1.25. You do not install it. You turn it on per namespace with labels.
The standards define three levels. privileged is unrestricted. baseline blocks the known ways a pod can escalate privilege, such as host namespaces and privileged containers. restricted goes further and follows current pod hardening practice, such as running as non-root. Each level can be applied in three modes: enforce rejects violating pods, audit records the violation in the audit log, and warn returns a warning to the user but allows the pod.
apiVersion: v1
kind: Namespace
metadata:
name: payments
labels:
pod-security.kubernetes.io/enforce: baseline
pod-security.kubernetes.io/warn: restricted
pod-security.kubernetes.io/audit: restricted
This combination is a sensible way to roll it out. Baseline is enforced, so the obvious problems are blocked today. Restricted is in warn and audit mode, so developers see what would break and you can read the audit log to plan the next step. When the warnings stop, move enforce up to restricted.
Pod Security Admission is deliberately narrow. It only looks at pod security settings, and it only works per namespace. That is why most teams add a policy engine next to it.
Layer 3: custom admission policy with Kyverno or OPA Gatekeeper
Every organisation has rules that the Pod Security Standards do not cover. Images must come from your own registry. Every Deployment needs an owner label. Ingress hosts must match an approved domain. Resource limits must be set. An admission policy engine lets you write these rules once and have the API server reject anything that breaks them.
Kyverno describes itself as a cloud native policy engine. Its policies are written in YAML or CEL, so a Kubernetes engineer can read them without learning a new language. It can validate, mutate, generate and clean up resources, and it can verify container images and their metadata for supply chain checks. Recent versions add separate policy types, including ValidatingPolicy, MutatingPolicy, GeneratingPolicy, DeletingPolicy and ImageValidatingPolicy, which line up with the CEL-based admission features in Kubernetes.
OPA Gatekeeper takes a different route. Policies are written in Rego, the language of the Open Policy Agent, and packaged as constraint templates. Rego has a steeper learning curve, but the same language can be used for policy outside Kubernetes, such as Terraform plans or API authorisation. We compare the two in detail in where Gatekeeper and Kyverno differ.
Whichever you choose, treat policies as code. Keep them in Git, test them in a staging cluster, and start new rules in audit mode. A badly written admission rule can block every deployment in the cluster, including the fix for the rule. Give the policy engine's own namespace an exception so you can always recover.
Layer 4: runtime detection with Falco
Scanning and admission control check what you intended to run. Runtime detection checks what is actually happening. A container built from a clean image can still be abused through an application bug, and the first sign is often behaviour that should never occur: a shell spawned inside a web server container, a write to a binary directory, or an outbound connection to an address nobody expected.
Falco is a runtime security tool for hosts, containers, Kubernetes and cloud environments. It is a graduated CNCF project. Falco reads kernel events and compares them to rules, then raises an alert when a rule matches. It supports two drivers: a modern eBPF probe, which is the default and uses the CO-RE approach so it does not need to be compiled for each kernel, and a kernel module.
The value of Falco depends on tuning. The default rules are a good starting point, but every environment has legitimate behaviour that looks odd, such as a backup job that opens a shell. Plan time to add exceptions for those, and send alerts to a channel that an on-call person watches. An unread alert stream is as useless as an unread scan report.
Falco detects and alerts. It does not block on its own. Teams that want automatic response usually forward Falco events to another system that can, for example, label the pod for investigation or scale the workload down. Keep a human in that loop until you trust the rules.
Layer 5: network segmentation with NetworkPolicy and Cilium
By default, every pod in a cluster can reach every other pod. If one workload is compromised, nothing stops it from probing the database in another namespace. Kubernetes NetworkPolicy objects let you describe which traffic is allowed, but they are only enforced if your network plugin supports them. A cluster with a plugin that ignores them will accept the objects and do nothing.
Cilium is a CNI that enforces standard Kubernetes NetworkPolicy and adds its own CiliumNetworkPolicy and CiliumClusterwideNetworkPolicy resources. Those cover Layer 3 rules by endpoint, service, CIDR and DNS name, Layer 4 rules including TLS SNI, and Layer 7 rules for HTTP and DNS. Cilium also supports deny policies and host policies. One detail worth knowing: loading policies directly into the agent through its CLI or API is deprecated as of Cilium v1.18 and scheduled for removal in v1.19, so manage policies as Kubernetes resources.
The usual pattern is a default-deny policy in each namespace, followed by narrow allow rules for the traffic each service needs. Our post on how network policies secure pod communication walks through the YAML, and 10 network policies every engineer must know gives ready patterns. Remember to allow DNS egress, or every pod will lose name resolution the moment default-deny goes in.
Layer 6: auditing the cluster with kube-bench
The workloads can be locked down and the cluster can still be weak if the kubelet allows anonymous access or the API server has insecure flags. kube-bench, another Aqua Security project, checks a cluster against the CIS Kubernetes Benchmark. Its tests are defined in YAML, and by default it picks the test set that matches the Kubernetes version it finds.
The simplest way to run it is as a Kubernetes Job. The repository ships a job.yaml manifest, plus platform-specific versions for EKS, GKE and AKS. The pod needs access to the host PID namespace and to host configuration directories, so run it deliberately and remove the Job when you are done.
kubectl apply -f job.yaml
kubectl get pods
kubectl logs <kube-bench-pod-name>
On managed services such as EKS, GKE and AKS, the provider controls much of the control plane, so some checks will not apply or cannot be changed by you. Read the results with that in mind and focus on the items you own, which are usually the worker node and kubelet settings.
How the layers fit together in a pipeline
Put the tools in the order a change travels. A developer opens a pull request. CI builds the image and runs Trivy against it, and also scans the Helm chart or manifests. If the scan passes, the image is pushed. When the deployment reaches the cluster, Pod Security Admission checks the pod spec against the namespace level, and Kyverno or Gatekeeper checks your custom rules. Once the pod is running, Falco watches its behaviour and Cilium enforces which connections it can make. On a schedule, kube-bench audits the cluster and Trivy rescans the registry.
If you use GitOps, the admission and policy layers become even more useful. Policies live in the same Git repository as the manifests, and a failed admission shows up as a sync error that the team can see. Our GitOps guide explains that flow. For the wider list of hardening steps, such as RBAC and secrets handling, see 12 Kubernetes security best practices.
Where to start if your cluster has none of this
Trying to install everything in one sprint usually ends with alerts nobody reads and policies nobody trusts. A staged order works better.
- Label every namespace with Pod Security Admission in warn and audit mode at the restricted level. It costs nothing and shows you where the risky pods are.
- Add Trivy to CI in report mode, then make it a gate for high and critical findings with available fixes.
- Run kube-bench once and fix the findings on the parts of the cluster you control.
- Apply default-deny network policies to one namespace, write the allow rules, and repeat namespace by namespace.
- Install Kyverno or Gatekeeper with two or three rules you care about most, such as approved registries and required resource limits.
- Deploy Falco, route its alerts to on-call, and spend the first weeks tuning out normal behaviour.
Each step stands on its own, so you get value even if the later ones take months. The order also matches how hard each step is to undo: labels and scans are easy to roll back, while runtime alerting needs the most tuning.
Common mistakes
The first is assuming that a managed Kubernetes service handles workload security. Providers secure the control plane they run. Your pods, images, namespaces and network rules are still your responsibility.
The second is writing NetworkPolicy objects on a cluster whose network plugin does not enforce them. Test a deny rule before you rely on it: start a pod, apply the policy, and confirm the connection actually fails.
The third is turning every check on in enforce mode at once. People route around gates that block their work without explanation. Use warn and audit modes, publish the results, and give teams time to fix things before enforcement starts.
The fourth is collecting findings without owners. Every scan result and every Falco alert should map to a team that can act on it. Namespace labels and image naming conventions make that mapping easy.
Learning these tools
The Certified Kubernetes Security Specialist syllabus covers most of these layers, from cluster hardening to supply chain and runtime security. If you want guided practice, our CKS training runs in the Kharadi, Pune classroom and live online across India. The open source tools here are free to install on a local kind or minikube cluster, which is the best place to break things while you learn.
FAQ
What is the minimum security tooling a Kubernetes cluster needs?
Enable Pod Security Admission on every namespace, scan images in CI with a tool such as Trivy, and apply default-deny network policies with a CNI that enforces them. Add a policy engine and runtime detection once those three are working.
Is Pod Security Admission enough on its own?
No. It only checks pod security settings per namespace. It cannot enforce rules such as approved registries or required labels, and it does nothing at runtime. Use it as the baseline and add Kyverno or Gatekeeper for custom rules.
Should I choose Kyverno or OPA Gatekeeper?
Kyverno policies are YAML or CEL, which most Kubernetes engineers can read immediately. Gatekeeper uses Rego, which takes longer to learn but can also be used for policy outside Kubernetes. Pick the one your team will actually maintain.
Does Falco block attacks?
Falco detects suspicious behaviour and sends alerts based on rules. It does not block by itself. Teams forward its events to other systems if they want an automated response.
Why do my NetworkPolicy objects have no effect?
Your network plugin probably does not enforce them. Kubernetes accepts the objects, but enforcement is the CNI's job. Use a plugin that supports NetworkPolicy, such as Cilium, and test a deny rule to confirm.
What does kube-bench check?
It runs the checks in the CIS Kubernetes Benchmark against your nodes and control plane, such as kubelet and API server settings. On managed services, some checks cover parts the provider controls.
Where should image scanning run?
In CI after the build and before the push, so vulnerable images never reach the registry. Also rescan the registry on a schedule, because new CVEs are published against images that passed earlier.
References
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0