Kubernetes Security in 2026: A DevSecOps Guide to Pod Security Admission, OPA Gatekeeper, and Falco
The Evolving Landscape of Kubernetes Security in 2026
Kubernetes has solidified its position as the de facto standard for container orchestration. According to the CNCF Annual Survey 2024, a staggering 84% of organizations now run Kubernetes in production, with 90% utilizing containers. This widespread adoption, while driving innovation and agility, also elevates the complexity of securing cloud-native environments. Basic Kubernetes security measures, such as RBAC and NetworkPolicies, while fundamental, are often insufficient to thwart sophisticated attacks in 2026. As we detailed in our comprehensive guide on securing a Kubernetes cluster in production, a multi-layered approach is critical.
DevSecOps engineers and architects are increasingly looking beyond foundational controls to implement advanced preventative and detective mechanisms. This guide delves into three pivotal tools that form the bedrock of a robust Kubernetes security posture in 2026: Pod Security Admission (PSA) for enforcing pod security standards, OPA Gatekeeper for flexible policy-as-code, and Falco for real-time runtime threat detection. Together, these tools create a formidable defense, addressing security concerns at various stages of the application lifecycle, from deployment to execution.
Pod Security Admission (PSA): The Evolution of Pod Security Policies
For years, Kubernetes Pod Security Policies (PSPs) were the primary mechanism for enforcing security standards on pods. However, PSPs proved challenging to manage, leading to their deprecation in Kubernetes 1.21 and removal in 1.25. Their successor, Pod Security Admission (PSA), offers a streamlined and more user-friendly approach, integrated directly into the Kubernetes API server as an admission controller.
Understanding PSA Modes and Policy Levels
PSA operates with distinct modes and policy levels, allowing administrators to balance security rigor with operational flexibility:
- Modes:
enforce: Pods that violate the policy are rejected.audit: Violations trigger an audit event but do not prevent pod creation.warn: Violations trigger a user-facing warning but do not prevent pod creation.
- Policy Levels:
Privileged: Unrestricted policy, allowing known escalations. This is the default.Baseline: Minimally restrictive, preventing known privilege escalations. Allows nearly all common workloads.Restricted: Heavily restricted, following current hardening best practices. Prevents all known privilege escalations and enforces tight security controls.
PSA is configured at the namespace level using labels, making it easy to apply different security profiles to different parts of your cluster. For instance, a critical production namespace might enforce a Restricted policy, while a development namespace could use Baseline in warn mode.
Implementing Pod Security Admission
To enable PSA on a namespace, you simply apply specific labels. Let’s say we want to enforce the Restricted policy on a namespace named secure-app:
kubectl create namespace secure-app
kubectl label namespace secure-app
pod-security.kubernetes.io/enforce=restricted
pod-security.kubernetes.io/enforce-version=latestNow, any pod deployed to secure-app that violates the restricted policy will be rejected. Consider a simple Nginx deployment attempting to run as root:
apiVersion: apps/v1
kind: Deployment
metadata:
name: insecure-nginx
namespace: secure-app
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:latest
securityContext:
runAsUser: 0 # Running as root, which is disallowed by 'restricted' policy
allowPrivilegeEscalation: true # Also disallowed
ports:
- containerPort: 80Attempting to deploy this with kubectl apply -f insecure-nginx.yaml would result in an admission error, clearly indicating the policy violation. This immediate feedback prevents insecure workloads from even starting, a significant step in Kubernetes security best practices.
OPA Gatekeeper: Policy-as-Code for Advanced Controls
While PSA offers robust baseline security, it’s limited to predefined Pod Security Standards. For organizations requiring highly customized, granular, or context-aware policies, OPA Gatekeeper, a CNCF Graduated project, steps in. Gatekeeper is an extensible admission webhook that enforces policies defined in Rego, Open Policy Agent’s declarative policy language.
Why OPA Gatekeeper?
- Flexibility: Define almost any policy imaginable, from requiring specific labels to enforcing resource requests/limits, disallowing hostPath volumes, or ensuring image provenance.
- Policy-as-Code: Manage policies like any other code artifact, enabling GitOps workflows (56% adoption). Tools like Argo CD or Flux can deploy and manage Gatekeeper policies.
- Audit Capabilities: Gatekeeper can audit existing resources against policies, identifying violations in your running cluster.
- Cross-Resource Policies: Policies can span multiple Kubernetes resources, not just pods.
How Gatekeeper Works
Gatekeeper leverages two custom resource definitions (CRDs):
ConstraintTemplate: Defines the schema and logic (in Rego) for a class of policies. It’s a reusable blueprint.Constraint: An instance of aConstraintTemplate, applying the policy logic to specific resources with configurable parameters.
Deploying Gatekeeper and a Custom Policy
First, deploy Gatekeeper to your cluster. This is commonly done using Helm, a tool we often recommend for deploying applications on Kubernetes:
helm repo add gatekeeper https://open-policy-agent.github.io/gatekeeper/charts
helm install gatekeeper gatekeeper/gatekeeper --namespace gatekeeper-system --create-namespaceNext, let’s create a ConstraintTemplate that disallows containers from running with the latest tag, promoting immutable image practices:
apiVersion: templates.gatekeeper.sh/v1
kind: ConstraintTemplate
metadata:
name: k8sdisallowlatesttag
spec:
crd:
spec:
names:
kind: K8sDisallowLatestTag
targets:
- target: admission.k8s.gatekeeper.sh
rego: |
package k8sdisallowlatesttag
violation[{"msg": msg}] {
container := input.review.object.spec.containers[_]
ends_with(container.image, ":latest")
msg := sprintf("container %v uses an image with the ':latest' tag", [container.name])
}
violation[{"msg": msg}] {
container := input.review.object.spec.initContainers[_]
ends_with(container.image, ":latest")
msg := sprintf("initContainer %v uses an image with the ':latest' tag", [container.name])
}Apply this template: kubectl apply -f k8sdisallowlatesttag.yaml
Now, create a Constraint instance of this template to activate the policy:
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sDisallowLatestTag
metadata:
name: no-latest-tag
spec:
match:
kinds:
- apiGroups: [""]
kinds: ["Pod"]
- apiGroups: ["apps"]
kinds: ["Deployment", "StatefulSet", "DaemonSet"]
parameters: {}Apply this constraint: kubectl apply -f no-latest-tag.yaml
Any new pod or deployment attempting to use an image with the :latest tag will now be rejected, providing a crucial layer of control over image hygiene. This level of granular control is essential for managing security and compliance, particularly in sectors where eIDAS 2.0 and the European Digital Identity Wallet are becoming standard for secure digital interactions.
Falco: Runtime Threat Detection for Kubernetes
Admission controllers like PSA and Gatekeeper are powerful for *preventing* insecure configurations. However, they don’t address threats that emerge *during runtime* – an attacker exploiting a zero-day vulnerability, an insider abusing legitimate access, or a compromised container behaving maliciously. This is where Falco, another CNCF Graduated project, becomes indispensable.
Why Runtime Security with Falco?
- Real-time Monitoring: Falco observes system calls at the kernel level, providing deep visibility into container and host activity.
- Behavioral Anomaly Detection: Detects unexpected process execution, file system changes, network activity, and privilege escalation attempts.
- Container-Aware: Understands the container context, allowing rules to be specific to particular applications or namespaces.
- Extensible Rules: Comes with a rich set of default rules and supports custom rules written in a declarative YAML format.
How Falco Works
Falco operates as a daemonset in Kubernetes, deploying a driver (either a kernel module or an eBPF probe, with eBPF being the increasingly preferred choice for performance and security in 2026) to each node. This driver intercepts system calls, feeding them to the Falco engine, which then evaluates them against a set of rules. When a rule matches, Falco generates an alert, which can be sent to various outputs like Syslog, an HTTP endpoint, or a messaging queue for integration with SIEMs or incident response systems.
Falco Rules and Integration
Falco’s power lies in its rules engine. A rule defines a condition that, when met, triggers an alert. Here’s an example of a built-in Falco rule that detects a shell running in a container that typically doesn’t:
# Example: Detect shell activity in Nginx container
- rule: "Shell in Nginx Container"
desc: "Detect if a shell is run inside an Nginx container (highly suspicious)"
condition: >
spawned_process and container.name = "nginx" and proc.name in (shell_binaries)
output: "Shell spawned in Nginx container (user=%user.name container=%container.name process=%proc.name parent=%proc.pname cmdline=%proc.cmdline)"
priority: CRITICAL
tags: [container, shell, nginx]This rule leverages Falco’s ability to inspect process names, container names, and system calls to identify anomalous behavior. Deploying Falco can also be done via Helm:
helm repo add falcosecurity https://falcosecurity.github.io/charts
helm repo update
helm install falco falcosecurity/falco --namespace falco --create-namespaceOnce deployed, Falco immediately starts monitoring. Alerts can be integrated with observability platforms like Prometheus, Grafana, and OpenTelemetry (which unifies traces, metrics, and logs via OTLP), allowing for comprehensive security visibility. This is particularly crucial for financial institutions adhering to standards like PSD2 and Strong Customer Authentication, where real-time anomaly detection is paramount for fraud prevention.
A Layered Security Strategy: PSA, OPA Gatekeeper, and Falco in Synergy
The true strength of these tools emerges when they are used in concert:
- PSA provides a straightforward, Kubernetes-native way to enforce foundational pod security standards, preventing common misconfigurations.
- OPA Gatekeeper extends this with highly customizable policy-as-code, allowing organizations to define and enforce specific security and compliance requirements across all Kubernetes resources. This is essential for maintaining control over the diverse environments, whether you’re running Kubernetes on bare metal or a managed cloud service.
- Falco acts as the critical last line of defense, detecting and alerting on suspicious activities that bypass admission controls or exploit vulnerabilities at runtime.
This layered approach ensures that security is addressed at every stage: from preventing insecure deployments (PSA, Gatekeeper) to detecting active threats within running workloads (Falco). It aligns with the principle of defense-in-depth, creating a robust security posture against a wide array of potential attacks.
Nuvelia’s Expertise in Kubernetes Security
At Nuvelia, we understand the complexities of securing modern cloud-native environments. Our team of senior technical experts specializes in helping organizations implement and optimize advanced Kubernetes security measures. We offer Kubernetes security audits to identify vulnerabilities and recommend tailored solutions, ensuring your infrastructure meets the highest standards of resilience and compliance. Furthermore, our K8s cost and security optimization with Thalaxo provides a holistic approach to managing your Kubernetes estates efficiently and securely.
In highly regulated sectors, such as banking or legal, where the integrity of data and processes is paramount, robust Kubernetes security underpins compliance with standards like eIDAS. This often extends to securing the systems that manage electronic signatures and financial transactions, where the stakes are incredibly high. Our expertise spans these critical domains, offering comprehensive strategies that integrate security from the ground up.
Conclusion
As Kubernetes continues to dominate the cloud-native landscape in 2026, the need for sophisticated security controls has never been greater. Pod Security Admission, OPA Gatekeeper, and Falco represent a powerful trio for DevSecOps teams looking to elevate their Kubernetes security. By combining preventative admission controls with real-time runtime detection, organizations can build resilient, compliant, and highly secure Kubernetes environments, safeguarding their critical applications and data against evolving threats. Implementing these tools is not merely a best practice; it is a strategic imperative for any organization serious about its cloud-native security posture.
