Trusted eBPF Program Inventory
The legitimate eBPF programs expected from the Cilium deployment are recorded as the approved runtime baseline.
Establishes the expected eBPF program state against which runtime programs can be compared.
Cilium is an open-source networking, security, and observability platform that uses eBPF inside the Linux kernel to implement networking and security functionality. Cilium's datapath uses eBPF programs at networking hooks such as XDP, traffic-control, and socket-related hooks.
Because eBPF programs execute inside the Linux kernel, unauthorized program loading on a Cilium-managed node can introduce security risk if an attacker obtains sufficient privileges to load or attach an additional eBPF program. The Linux bpf() system call provides the BPF_PROG_LOAD operation for verifying and loading eBPF programs into the kernel.
In this use case, a controlled Cilium-based Kubernetes network is deployed on Ubuntu Linux inside an isolated VirtualBox laboratory. Cilium provides the eBPF-based networking layer, while a controlled test workload is used to generate normal network activity.
A trusted inventory of expected eBPF programs is established from the Cilium-managed node. Program identity information such as BPF program ID, program type, tag, load timestamp, UID, attachment information, and associated metadata is collected using bpftool. Cilium documentation identifies bpftool as the primary tool for BPF program introspection and shows that loaded programs can be inspected through their system-wide program IDs and tags.
A controlled unauthorized eBPF program is then introduced into the laboratory node. The test program is deliberately separate from the legitimate Cilium program inventory and is used only to validate the detection workflow.
The security layer compares the observed eBPF program identity against the approved program inventory. When an unexpected program is detected, the event is classified as an unauthorized eBPF loading event and is forwarded to the runtime-security monitoring workflow.
Hubble provides visibility into the network behavior of Cilium-managed workloads. Hubble is built on Cilium and eBPF and provides visibility into service communication, network behavior, and security events.
The workflow combines program identity verification, trusted eBPF inventory, attachment verification, runtime monitoring, Cilium/Hubble network observability, security-event correlation, and unauthorized-program response.
The purpose is not to replace Cilium's legitimate eBPF programs, but to distinguish expected Cilium-managed programs from independently introduced eBPF programs and validate the security response when an unexpected program appears.
Complete Emerging Technology Security Workflow : Cilium-Based Linux Network → Trusted eBPF Program Inventory → Program Identity Collection → Identity Verification → Runtime eBPF Monitoring → Unauthorized Program Detection → Cilium/Hubble Behavioral Monitoring → Security Event Correlation → Unauthorized Program Response → Evidence Validation
Cilium uses eBPF programs to implement networking and security functionality inside the Linux kernel. These programs are attached to kernel networking hooks and are part of the Cilium datapath. Cilium's eBPF programs can therefore be observed and inspected using Linux BPF tooling. bpftool can enumerate loaded programs, identify their program IDs and tags, and provide additional metadata about individual programs.
If an attacker gains sufficient privileges on a Cilium-managed Linux node, the attacker may attempt to load or attach an additional eBPF program that is not part of the approved Cilium program inventory.
The security problem is therefore:
The proposed security mechanism establishes a trusted identity inventory for expected eBPF programs and continuously compares observed runtime programs against that inventory. Unexpected program identities are then correlated with runtime and network telemetry before the security event is investigated and contained.
The attack consists of introducing a controlled eBPF program into a Linux node where Cilium is already operating its legitimate eBPF datapath. The attacker model assumes that the unauthorized actor has obtained the privileges required to interact with the Linux BPF subsystem. The Linux kernel provides BPF_PROG_LOAD for loading eBPF programs, while BPF objects can also remain active through attachments or pinned references. In the laboratory, a separate eBPF program is compiled and loaded independently from the Cilium-managed program set. The test program is given a distinctive identity so that the monitoring workflow can distinguish it from legitimate Cilium programs. The attack does not attempt to exploit a Cilium vulnerability or compromise a production Kubernetes cluster. It validates whether an independently loaded eBPF program can be identified through program identity inspection and runtime monitoring. After the test program is loaded, bpftool is used to enumerate active eBPF programs and compare the observed program identities against the approved baseline. Hubble is then used to observe controlled network behavior generated by the Cilium-managed workloads so that runtime security evidence can be correlated with network activity. Hubble provides flow visibility with identity and label information for Cilium-managed workloads.
eBPF program identity verification establishes a trusted baseline of the programs expected to exist on a Cilium-managed Linux node.
The baseline records program attributes such as program ID, type, tag, UID, load time, attachment information, and other available metadata. bpftool prog provides system-wide visibility into loaded BPF programs and supports detailed inspection using program IDs. The identity-verification mechanism compares the observed runtime program inventory against the approved Cilium program inventory. An unexpected program ID alone is not permanently trusted because program IDs are runtime identifiers. Therefore, the verification process also considers stable program attributes such as program type, tag, attachment location, ownership context, and expected Cilium association. Runtime security monitoring complements identity verification by observing whether unexpected eBPF programs appear during normal operation and whether related network behavior changes. Hubble provides Cilium-based network and security observability and can expose flow information for investigation and correlation.
The secure processing flow is:
The legitimate eBPF programs expected from the Cilium deployment are recorded as the approved runtime baseline.
Establishes the expected eBPF program state against which runtime programs can be compared.
Observed eBPF programs are inspected using program identifiers, tags, types, UIDs, load times, and available metadata.
Identifies eBPF programs that do not correspond to the approved runtime identity set.
BPF program tags exposed through bpftool are compared with the trusted program records.
Provides an additional program-level attribute for distinguishing expected and unexpected eBPF programs.
The attachment location and program type are compared against the expected Cilium datapath configuration.
Detects programs attached to unexpected networking or kernel hooks.
The active eBPF program inventory is periodically collected and compared against the approved baseline.
Detects unauthorized programs introduced after the initial Cilium deployment.
The expected Cilium eBPF programs and their operational state are reviewed after a detected anomaly.
Distinguishes legitimate Cilium datapath changes from independently introduced eBPF programs.
Hubble is used to monitor Cilium-managed network behavior and investigate flow activity associated with the security event.
Provides runtime network evidence for correlating suspicious eBPF activity with observed workload behavior.
Program identity changes, system events, Cilium state, and Hubble observations are correlated using timestamps and node information.
Builds a complete investigation timeline for unauthorized eBPF activity.
A detected unauthorized laboratory program is identified for controlled removal according to the predefined response procedure.
Prevents an unapproved eBPF program from remaining active after detection.
The active eBPF inventory is re-scanned after the controlled response.
Confirms that the unauthorized program has been removed and the expected Cilium program state has been restored.
Cilium provides the controlled Kubernetes networking and security environment using eBPF-based datapath functionality. Cilium uses eBPF programs at Linux networking hooks to implement its datapath.
Hubble provides network and security observability on top of Cilium and eBPF. It provides visibility into service communication and network behavior.
bpftool is the primary BPF introspection and debugging tool used to enumerate loaded programs and inspect their metadata.
The Linux BPF subsystem provides the kernel interface through which eBPF programs are verified and loaded. The BPF_PROG_LOAD operation is responsible for verifying and loading an eBPF program.
LLVM and Clang are used to compile the controlled eBPF test program into an object file.
libbpf provides the userspace library used for interacting with eBPF objects and loading BPF programs. Cilium documentation identifies libbpf as part of the Linux kernel BPF tooling ecosystem.
Linux audit logging is used to capture relevant privileged system activity associated with the controlled eBPF-loading workflow.
Wazuh collects and analyzes relevant Linux, Cilium, and security-monitoring events generated during the controlled assessment.
OpenSearch provides centralized analysis of the collected eBPF, Linux, Cilium, and Hubble security evidence.
Ubuntu provides the controlled Linux environment hosting the Kubernetes and Cilium laboratory.
Kali Linux provides the controlled security-testing environment used to prepare and validate the unauthorized eBPF loading scenario.
VirtualBox provides the isolated laboratory infrastructure for the Ubuntu and Kali Linux virtual machines.