5 eBPF Runtime Detections That Catch Container Escapes

eBPF runtime security gives you the five runtime signals that image scanning and admission policy never see: a shell inside a container, a write-then-execute under a temporary path, a privilege or namespace change from a workload pod, an unexpected outbound connection, and a service account token read by the wrong binary. Those detections work because eBPF programs run inside the Linux kernel on every matching event, so a sensor sees process launches, file writes and socket operations whether or not the application cooperates. Start them in audit mode, tune against a week of real activity, and enforce only the rule that has proven precise.
Two open-source tools cover most of this ground. Falco parses Linux syscalls at runtime, asserts the event stream against a rules engine and alerts when a rule is violated; it is a graduated CNCF project originally created by Sysdig. Tetragon hooks the same kernel events and can filter and react inside the kernel rather than in a user-space agent. This guide explains what each tool does, where they differ, which five detections to write first, and how to roll them out in four weeks without flooding the on-call queue.
Why Prevention Alone Misses Runtime Attacks
Scanning an image proves what it contained at build time. Admission policy proves what the pod spec requested. Neither observes what a vulnerable process does after exploitation: spawning a reverse shell, writing a binary under a temporary directory and executing it, or changing its own privileges. Those are runtime events, and only a sensor at the kernel boundary sees them regardless of whether the process runs in a container, a sidecar or directly on the host.
RuntimeClass selects the container runtime configuration for a pod, which lets a team schedule high-value workloads into a runtime that uses hardware virtualization, per the Kubernetes RuntimeClass documentation. That is a real isolation layer, and it raises the cost of an escape for the workloads that justify the overhead. It does not tell you which pod attempted the escape, which binary ran, or what the process touched next. Isolation and detection answer different questions, and the rollouts that hold up treat them as complements. If your pipeline already applies provenance gates before deploy, runtime detection is the second half of that story: provenance controls what lands in the cluster, and eBPF detections show what it does once it runs.
How eBPF Sees Container Activity
The kernel’s verifier checks each eBPF program before it loads, and the program then attaches to hook points: kprobes on kernel functions, tracepoints on stable kernel events and uprobes on user-space functions. Matching events are evaluated as they happen, so high-frequency syscalls such as read and write can be filtered before anything reaches a user-space process. That is the difference between runtime detection and log analysis: there is no agent inside the container and no dependence on the application writing a log line.
The two tools diverge on where the decision is made. Falco’s default driver is a modern eBPF probe, with a kernel module still available; events stream to a userspace program that evaluates YAML rules and sends alerts to stdout, syslog, a file, a spawned program or an HTTP endpoint. Tetragon applies policy and filtering directly in eBPF in the kernel, performing the blocking and reacting to events there instead of sending every event to a user-space agent, according to its overview documentation. When an application changes its privileges, a Tetragon policy can raise an alert or kill the process before the syscall completes. A TracingPolicy is a Kubernetes custom resource that traces kernel events through hook points such as kprobes, tracepoints and uprobes, with selectors for in-kernel filtering and optional actions (Tracing Policy reference), and policies can be loaded or unloaded at runtime with kubectl or the tetra CLI.
Falco’s value for a first deployment is its default content. The default Falco rules cover privilege escalation in privileged containers, namespace changes with setns, writes to well-known directories such as /etc and /usr/bin, and spawned shell binaries like bash and zsh, plus SSH binaries, symlink creation and unexpected network connections. You start from rules that a graduated project ships by default and narrow them to your environment, rather than writing policy from a blank file.
Falco vs Tetragon: A Comparison
| Dimension | Falco | Tetragon |
|---|---|---|
| Where the decision happens | Kernel driver streams events; a userspace engine evaluates YAML rules | Policy and filtering run in eBPF inside the kernel |
| Policy format | YAML rules with conditions and a descriptive output string | TracingPolicy custom resource with hook points and selectors |
| Starting content | Default rules for privileged containers, setns, system directory writes, shells and SSH binaries | Policy library and use-case examples; policies are written per workload |
| Response | Alerts to stdout, syslog, a file, a spawned program or an HTTP endpoint | Alert or react in the kernel, including killing a process before the syscall completes |
| Kubernetes context | Container runtime and Kubernetes metadata attached to events | Understands namespaces and pods; policy can target individual workloads |
| Best fit | Teams that want proven defaults and a SIEM-style alert flow on day one | Teams that need workload-scoped policy and the option to block |
Choose by where you want the decision made and who writes policy. If the team already lives in SIEM pipelines and wants signal without authoring rules, Falco’s defaults deliver it. If policy must be scoped per namespace with the option to block rather than alert, Tetragon’s in-kernel model fits. Running both on the same nodes is feasible, but it doubles the kernel hooks and the tuning work; name one as the system of record and keep the other for a time-boxed comparison.
Five Detections to Write First
Start with events that almost never occur in a healthy workload. Each item names the signal, why it matters and the false-positive source to exclude before tuning.
- Shell inside a container. A process named sh, bash, dash or zsh whose parent is not an approved entrypoint. An exploited web process often lands the attacker in a shell; operators occasionally exec in for debugging, so exclude interactive sessions that come through your approved debugging path.
- Write then execute under a temporary path. A file created under /tmp, /dev/shm or /var/tmp and executed from the same location. Web shells and cryptominers follow this pattern; build jobs and some language runtimes do too, so scope the rule to production namespaces first.
- Privilege or namespace change from a workload pod. A setns call, a host path mount or a capability change on a pod that is not privileged by spec. Falco’s defaults cover the first two patterns; Tetragon’s use-case guides cover namespace access and privileged execution. In a healthy cluster these events are rare, which makes them cheap to triage.
- Unexpected outbound connection from an inbound-only service. A frontend pod that normally accepts traffic opening a long-lived connection to an external address on an unusual port. Network policy may already block the connection; the detection tells you which pod tried, and that is the lead you need.
- Service account token read by an unexpected binary. The projected token under /var/run/secrets/kubernetes.io/serviceaccount is read by in-cluster clients; a curl or python process reading it from a pod that never calls the API server is a credential-theft signal. The structural fix is to remove the standing credential, the same logic that replaces static CI keys with OIDC federation.
A Four-Week Rollout Plan
- Week 1: audit mode on one node pool. Pick the pool that runs internet-facing workloads. Send alerts to a dedicated channel, not the main incident queue, and record the volume per rule per day.
- Week 2: tune against real activity. For every alert, decide whether the event was expected. Encode exclusions by namespace, image or binary; never disable a rule to silence it. A rule that cannot be made precise in two weeks is a candidate for removal.
- Week 3: expand and attach context. Roll out to the remaining node pools and add pod, namespace and image labels to every alert so the responder knows what was affected, not only that something happened. Route the five baseline detections into the incident queue and leave everything else in the side channel.
- Week 4: enforce one rule. Pick the detection with the cleanest record, such as a write to a system binary from a non-privileged pod, and switch it from alert to block if the tool supports in-kernel reaction. Write down the rollback first: the policy object name and the exact command that returns it to audit mode.
Judge the rollout by two measures only: the share of alerts a responder closes as benign, and the median time from alert to triage. If benign alerts are still the majority after two weeks of tuning, the policy needs narrowing, not more people on the queue.
Sources
- The Falco Project, What is Falco? (accessed November 28, 2026)
- Tetragon, Overview (accessed November 28, 2026)
- Tetragon, Tracing Policy (accessed November 28, 2026)
- Kubernetes documentation, Runtime Class (accessed November 28, 2026)