Kernel-level stateful security stops complex multi-step cyberattacks
Enforcement of In-Kernel Stateful Security Policies via eBPF
Cryptography and SecurityProgramming Languages
Summary
Some cyberattacks happen through a series of small actions that seem harmless alone but are dangerous when put together over time. The authors created BPFence, a tool that watches these sequences inside the computer's core (the kernel) to spot and stop threats as they happen. BPFence uses a special language that can describe rules about how events relate over time, unlike older tools that only looked at one thing at a time. The system also checks its own rules for correctness before running them efficiently inside the kernel. They tested it on real attack patterns and found it runs fast enough for everyday use.
What this means in practice
- •For system administrators: Add precise and efficient intrusion detection that tracks sequences of system calls to prevent complex attacks inside multi-tenant servers.
- •For container platform developers: Integrate stateful security policies within container orchestration systems to enforce temporally aware protections on workloads.
Authors
Letterio Galletta
Abstract
Many attacks against workloads running on multi-tenant systems are multi-step and history-dependent: sequences of innocuous operations whose malicious nature emerges only over an execution trace. Defending against them requires security policies that are stateful, are enforced within the kernel, and have a precise semantics. Currently deployed proposals fail on at least one count: kernel's built-in syscall filtering and classical MAC frameworks are stateless, while current eBPF-based tools express their policies through ad hoc YAML rules that cannot capture temporal relations among events, and whose semantics is defined only by the implementation. We present BPFence, an in-kernel runtime-verification framework that satisfies the properties above. BPFence provides a policy language with a formal semantics that can express temporal relations among events. It also provides a type system that statically distinguishes events the kernel can control from those it can only observe. Every well-typed policy is compiled into a finite-state monitor proved correct with respect to its semantics, and then into eBPF programs that run inside the kernel. We evaluate BPFence on seven case studies drawn from real-world attack patterns, and on a set of micro- and macro-benchmarks to show that the enforcement overhead remains compatible with production deployment.