Deep DiveComputer Systems

eBPF's Two Faces: Kernel Security Sensor and Rootkit Hiding Place

eBPF has become the foundation of Kubernetes autonomous security through tools like Cilium, Falco, and Traceeโ€”yet the same kernel-level access that enables deep visibility also creates a concealment path for rootkits.

By Sean K.S. Shin
This blog summarizes research trends based on published paper abstracts. Specific numbers or findings may contain inaccuracies. For scholarly rigor, always consult the original papers cited in each post.

Every powerful security mechanism contains within it the potential for abuse. Firewalls can be reconfigured to block defenders. Encryption can shield attackers' communications. Audit logs can be manipulated to erase evidence. The pattern is consistent: the deeper a technology reaches into a system's internals, the more dangerous it becomes when turned against the system it was designed to protect.

Extended Berkeley Packet Filter (eBPF) is the latest and perhaps most consequential example of this duality. Originally designed for efficient packet filtering, eBPF has evolved into a general-purpose framework for running sandboxed programs within the Linux kernelโ€”without modifying kernel source code or loading traditional kernel modules. This capability has made eBPF the foundation of modern cloud-native security and observability. It has also made eBPF a compelling concealment mechanism for sophisticated rootkits.

The Research Landscape: eBPF as Security Infrastructure

The ACM SIGOPS community and the eunomia.dev research group have independently documented eBPF's central role in Kubernetes security architecture, where three tools dominate the landscape:

Cilium provides eBPF-based networking and network security for Kubernetes clusters. By attaching eBPF programs to kernel network hooks, Cilium enforces policies at the kernel levelโ€”faster and more granular than iptables. Cilium inspects traffic based on application-layer identity (Kubernetes labels, service names) rather than ephemeral IP addresses.

Falco uses eBPF to intercept system calls and generate security alerts in real time. When a container executes an unexpected binary or establishes an unusual outbound connection, Falco captures the event at the kernel level. User-space evasion techniques cannot hide from kernel-level sensors.

Tracee provides runtime security and forensics by tracing kernel and user-space events through eBPF. It loads programs dynamically and detects container escapes, privilege escalation, and fileless malware execution.

Together, these tools have established what the research literature describes as "autonomous security"โ€”systems that detect, classify, and in some cases respond to threats without human intervention, operating at kernel speed rather than human speed.

The Other Face: eBPF as Rootkit Platform

The same properties that make eBPF effective for securityโ€”kernel-level access, dynamic loading, system call interception, network traffic manipulationโ€”make it equally effective for concealment.

Traditional rootkits load kernel modules (LKMs) that modify system call tablesโ€”leaving detectable artifacts in lsmod output and memory regions. eBPF programs, by contrast, operate within the kernel's sanctioned execution framework. An eBPF rootkit can:

  • Intercept and modify system call results โ€” hiding files, processes, and network connections from user-space tools by filtering what the kernel returns to applications
  • Manipulate network traffic โ€” redirecting, dropping, or modifying packets at the kernel level, invisible to user-space packet capture tools
  • Evade traditional detection โ€” because eBPF programs run through the kernel's own verified execution path, they may not trigger the same alerts as unauthorized kernel modules
  • Persist across reboots โ€” through systemd service files or init scripts that reload the eBPF programs at boot, using the same mechanism that legitimate security tools use for persistence
  • The research notes that several proof-of-concept eBPF rootkits have been demonstrated, and the security community has documented techniques for using eBPF's bpf_probe_write_user helper to modify user-space memory from kernel contextโ€”a capability that traditional security models did not anticipate.

    Critical Analysis

    <
    ClaimSource EvidenceVerdict
    eBPF is now core infrastructure for Kubernetes autonomous securityCilium, Falco, Tracee adoption documented across ACM SIGOPS and industry surveysโœ… Supported โ€” widespread production deployment
    eBPF can be exploited as rootkit concealment within kernel spaceProof-of-concept demonstrations documented; architectural analysis confirms feasibilityโœ… Supported โ€” demonstrated capability
    Verifier improvements are being studied to restrict malicious eBPF useActive research on enhanced verification, capability restriction, and runtime monitoringโœ… Supported โ€” ongoing research track
    Privilege restrictions can mitigate eBPF rootkit risksCAP_BPF separation and unprivileged eBPF restrictions documentedโš ๏ธ Partial โ€” reduces but does not eliminate risk for privileged attackers

    The Verifier Paradox

    The eBPF verifierโ€”the kernel component that checks eBPF programs before executionโ€”is designed to prevent crashes, infinite loops, and out-of-bounds memory access. It was not originally designed to distinguish between benign and malicious intent. A program that intercepts system calls and filters results is structurally identical whether it serves a security monitoring purpose or a rootkit concealment purpose.

    Recent research explores extending the verifier to enforce security policies beyond safety propertiesโ€”restricting which eBPF program types can be loaded by which processes, limiting access to sensitive helper functions, and requiring cryptographic attestation of eBPF programs before loading. These approaches treat the verifier as a policy enforcement point rather than purely a safety mechanism.

    Privilege as the Defense Boundary

    The primary defense against eBPF rootkits is privilege restriction. Loading eBPF programs requires specific Linux capabilities (CAP_BPF, CAP_SYS_ADMIN, or CAP_NET_ADMIN depending on program type). In properly configured systems, only trusted security tools have these capabilities. The attack scenario requires that an adversary first achieves privilege escalationโ€”at which point they have access to many attack vectors, not just eBPF.

    However, in container environments where security tools themselves run as privileged containers with eBPF capabilities, compromising the security tool's container grants the attacker exactly the eBPF access needed for rootkit deploymentโ€”using the security tool's own privileges.

    Open Questions

    Attestation frameworks: Can eBPF programs be cryptographically signed and verified before loading? Research prototypes exist, but production-grade attestation for dynamically generated eBPF programs remains unsolved.

    Runtime behavioral monitoring: If the verifier cannot distinguish malicious from benign programs structurally, can runtime monitoring detect anomalous eBPF behavior? This creates a recursive problemโ€”who monitors the monitor at kernel level?

    Container security architecture: Should security tools requiring eBPF capabilities run inside the container environment they protect, or at a separate trust layer? Privileged security containers create a bootstrapping vulnerability.

    Closing Reflection

    eBPF's dual nature is not a flaw to be fixed but a fundamental characteristic to be managed. The research trajectoryโ€”verifier enhancements, privilege restrictions, attestation frameworksโ€”represents an attempt to preserve defensive benefits while constraining offensive potential. Whether that balance is achievable, or whether eBPF will follow the historical pattern of dual-use technologies where offensive and defensive capabilities co-evolve indefinitely, remains an open question.

    References (2)

    [1] An In-Depth Analysis of eBPF-Based System Security Tools (2025). IEEE Access.
    Feng, M., Zhou, J., & Tang, Y. (2024). Enhancing Cloud-Native Security Through eBPF Technology. 2024 IEEE 11th International Conference on Cyber Security and Cloud Computing (CSCloud), 165-168.

    Explore this topic deeper

    Search 290M+ papers, detect research gaps, and find what hasn't been studied yet.

    Click to remove unwanted keywords

    Search 6 keywords โ†’