eBPF for security – kernel-level observability without the kernel module – Secured Me

eBPF for security – kernel-level observability without the kernel module

What eBPF actually is, why it has transformed Linux security tooling, and how to use Falco, Tetragon, and friends safely in production.

For a long time, "deep" Linux security tooling meant kernel modules: powerful but invasive, version-fragile, and a real risk if they crashed. eBPF changed that. It lets you run small, verified programs inside the kernel at well-defined hook points — system calls, network events, scheduler events, tracepoints — without writing a kernel module, and without compromising stability. Almost every modern Linux runtime security tool (Falco, Tetragon, Cilium, Pixie, Datadog, Sysdig, many EDR products) is built on eBPF underneath. Understanding what it does and what it doesn't do helps you evaluate tooling and write better detections.

What eBPF actually is

eBPF (the "e" originally stood for "extended", from the older Berkeley Packet Filter used by tcpdump) is a small virtual machine inside the Linux kernel. You write a program — typically in restricted C, Rust, or via a higher-level DSL — compile it to eBPF bytecode, and load it. Before the kernel runs it, a verifier checks that the program will terminate, does not dereference invalid pointers, does not loop unboundedly, and only touches data it is allowed to. If verification passes, the program is JIT-compiled and attached to a hook.

Key properties that matter for security:

eBPF is not magic; it cannot see things the kernel itself cannot see, and it cannot bypass mandatory access control. But it does give defenders a vantage point that previously required vendor kernel modules.

What eBPF gives security teams

Three broad categories of capability matter for security.

For most security teams, the immediate value is the first one: a per-host stream of high-fidelity events that is cheap to collect and easy to filter, without deploying yet another kernel module.

Tooling: Falco, Tetragon, Cilium, and the BCC family

Several mature open-source projects are worth knowing.

Commercial EDR vendors increasingly use eBPF under the hood on Linux too, so the underlying technology is the same; the differences are in rule content, management, and integration.

Writing a useful detection: a worked example

A common Falco rule, conceptually, looks something like:

This kind of rule is impractical with file-based log analysis (the event happens and is gone in microseconds) but trivial with eBPF, because the agent sees the execve system call directly. Similar patterns work for "unexpected outbound connection from a database pod", "write to a sensitive path that only a single binary should touch", "container modifying its own filesystem when it should be read-only", and "kernel module load on a server that does not load modules".

The general principle: describe behaviour in terms the kernel can observe (syscalls, processes, file paths, network endpoints, capabilities, namespaces), and let the agent translate that into events. Avoid string-matching on log output where you can match on the underlying event directly.

Operational considerations

eBPF tooling is well-behaved but not free. A few things to plan for.

eBPF will not solve security on its own, but it has genuinely lowered the cost of high-quality runtime visibility on Linux. For most teams, the right move is to pilot Falco or Tetragon on a handful of hosts or a single Kubernetes cluster, write a small number of high-fidelity rules tied to ATT&CK techniques, and prove the value before expanding. Done that way, it gives you EDR-class signal without EDR-class cost — and a foundation for genuinely useful detection engineering.