Latest / CyberSecurity Summary / Learning eBPF: Programming the Linux Kernel for Enhanced Observability, Networking, and Security
Transcript
- 0:00Speaker 1: Imagine for a moment, being able to fundamentally alter how
- 0:03Speaker 1: the very core of your operating system functions, not just
- 0:07Speaker 1: patching it, but dynamically changing its behavior, you know, without
- 0:11Speaker 1: rebooting or even recompiling a single line of code.
- 0:14Speaker 2: Yeah, that sounds pretty wild.
- 0:16Speaker 1: That almost sounds like a superpower, right, the ability to
- 0:18Speaker 1: peer into and even reshape your Linux kernel on the fly.
- 0:22Speaker 1: How is that even possible?
- 0:23Speaker 2: It's certainly a profound change in how we interact with
- 0:26Speaker 2: the kernel. And that transformative technology is called eBPF EBPFKA.
- 0:32Speaker 2: This isn't just some minor upgrade. It's really a revolutionary platform.
- 0:35Speaker 2: It's fundamentally changing how we build high performance, security, observability
- 0:41Speaker 2: and networking tools.
- 0:42Speaker 1: And that revolutionary aspect is what we're here to unpack today.
- 0:45Speaker 1: Good plan for this deep dive, our mission is to
- 0:48Speaker 1: explore the power behind eBPF. We'll uncover what it is,
- 0:51Speaker 1: why it's become so incredibly important, especially you know, in
- 0:54Speaker 1: recent years with cloud native stuff, and how it actually
- 0:58Speaker 1: delivers on this promise of un paralleled insight and control.
- 1:02Speaker 1: All our insights today, by the way, are drawn from
- 1:04Speaker 1: the excellent book Learning EVPF by Liz.
- 1:07Speaker 2: Rice A great resource. And you know, even if you
- 1:10Speaker 2: listening aren't planning to write eBPF code yourself, just understanding
- 1:13Speaker 2: the fundamentals that gives you a significant advantage. How so, well,
- 1:18Speaker 2: you're likely to come across eBPF based tooling more and more.
- 1:21Speaker 2: It's rapidly becoming standard in software infrastructure roles, right, and
- 1:25Speaker 2: knowing how it works underneath will help you use those
- 1:28Speaker 2: tools much more effectively. It gives you a real edge.
- 1:30Speaker 1: Okay, so let's unpack this. To really get eBPF, we
- 1:33Speaker 1: probably need to start with the Linux kernel itself. How
- 1:36Speaker 1: would you describe its role for someone maybe not deep
- 1:39Speaker 1: in OS internals.
- 1:40Speaker 2: Sure, think of the kernel as the essential software layer,
- 1:45Speaker 2: sitting directly between your applications and the physical hardware.
- 1:49Speaker 1: The mediator exactly.
- 1:50Speaker 2: It's the traffic cop for all interactions. Immediates every request
- 1:53Speaker 2: from userspace apps through things called system calls or ciscalls,
- 1:57Speaker 2: like reading files, network stuff files, sending network traffic, even
- 2:02Speaker 2: just accessing memory. The kernel handles it all. Everything ultimately
- 2:06Speaker 2: goes through the kernel.
- 2:07Speaker 1: And because applications rely so heavily on the kernel for
- 2:10Speaker 1: well everything, being able to observe those interactions must give
- 2:14Speaker 1: you incredible visibility into what an app is doing.
- 2:17Speaker 2: That's the key.
- 2:18Speaker 1: But where did this idea of hooking into the kernel start.
- 2:21Speaker 1: It had pretty humble origins, didn't they. Oh?
- 2:23Speaker 2: Absolutely. The BPF and EDPF originally stood for Berkeley Packet Filter,
- 2:29Speaker 2: started way back.
- 2:29Speaker 1: In nineteen ninety two, ninety two, Okay.
- 2:31Speaker 2: Yeah, simply as a way to efficiently filter network packets.
- 2:34Speaker 2: We're talking in general purpose thirty two bit instructions looked
- 2:37Speaker 2: a lot like assembly.
- 2:38Speaker 1: Language, so like for TCP dump or something.
- 2:40Speaker 2: Precisely, a tiny piece of BPF code could say filter
- 2:44Speaker 2: out non ippaydance from an Ethernet stream, letting GZP dump
- 2:47Speaker 2: capture only what was relevant. That efficiency was groundbreaking for
- 2:51Speaker 2: network analysis back then.
- 2:52Speaker 1: So the original BPF came into Lenux in ninety seven
- 2:55Speaker 1: kernel two point one one seventy five for that purpose.
- 2:58Speaker 1: But I guess the packet filter part of the name
- 3:00Speaker 1: started to make less sense over time. It did.
- 3:02Speaker 2: It became much more than just packets.
- 3:04Speaker 1: What was the turning point? When did it become more versatile?
- 3:07Speaker 2: Well, the first step beyond just network packets was probably
- 3:10Speaker 2: SUCCUMBPF and twenty twelve Kernel three point.
- 3:13Speaker 1: Five sacked and TTF right for ciscall filter exactly.
- 3:17Speaker 2: It let BPS programs decide whether to allow or deny
- 3:20Speaker 2: user space apps from making specific system calls, so you
- 3:25Speaker 2: could restrict what an application could do at the kernel level.
- 3:28Speaker 1: A security thing.
- 3:29Speaker 2: Yeah, foundational for containers security later on. But the real
- 3:33Speaker 2: extended revolution, the birth of eBPF as we know it,
- 3:36Speaker 2: began in kernel three point one eight. That was twenty fourteen.
- 3:39Speaker 1: Okay, twenty fourteen. And what changed then? It sounds like
- 3:42Speaker 1: it was more than just an incremental update.
- 3:44Speaker 2: Oh, it was a complete overhaul. The instruction set became
- 3:46Speaker 2: sixty four bit, the interpreter was rewritten, Crucial new features
- 3:50Speaker 2: were added. That's just This is where we got eBPF
- 3:52Speaker 2: maps for sharing data between programs and user space.
- 3:56Speaker 1: Ah okay, that sounds.
- 3:57Speaker 2: Important, hugely important. Also the VPF system call for userspace interaction,
- 4:02Speaker 2: and maybe most critically for safety, the eBPF FAIRI fire
- 4:06Speaker 2: was introduced. We'll definitely need to talk more about that.
- 4:08Speaker 1: Absolutely. So if adding new kernel features is traditionally you know,
- 4:13Speaker 1: a massive undertaking months, maybe years to get changes upstream,
- 4:17Speaker 1: how does eBPF change that? What makes it such a
- 4:20Speaker 1: game changer today?
- 4:22Speaker 2: That's the core of its appeal. Really Yeah, eBPF fundamentally
- 4:25Speaker 2: changes how we can extend the kernel. It allows for
- 4:29Speaker 2: dynamic kernel functionality, dynamic meaning meaning eBPF programs can be
- 4:33Speaker 2: loaded and unloaded on demand. This dramatically speeds up adding
- 4:37Speaker 2: new kernel features. We're talking maybe months, not the years
- 4:39Speaker 2: it usually takes for upstream kernel changes.
- 4:42Speaker 1: Wow.
- 4:42Speaker 2: So you can create and deploy custom kernel functionality incredibly
- 4:46Speaker 2: quickly without needing you know, the entire Linux world to
- 4:49Speaker 2: agree and merge it into the main kernel.
- 4:51Speaker 1: And it's not just about speed of deployment, is it.
- 4:53Speaker 1: Performance is key.
- 4:54Speaker 2: Too, absolutely crucial. Once an eBPF program is loaded and
- 4:58Speaker 2: JIT compiled, I'm compiled right, it runs as native machine
- 5:02Speaker 2: instructions directly on the CPU. This avoids those costly back
- 5:06Speaker 2: and forth transitions between kernel space and user space for
- 5:09Speaker 2: every single event.
- 5:10Speaker 1: Which makes it incredibly efficient.
- 5:12Speaker 2: Remarkably efficient. It sounds almost counterintuitive for something running inside
- 5:15Speaker 2: the kernel, but yeah, it allows EVPF tools to operate
- 5:19Speaker 2: with minimal overhead.
- 5:20Speaker 1: That efficiency sounds like a massive win, especially in cloud
- 5:23Speaker 1: native environments. We often see that sidecar model in kubernettes
- 5:27Speaker 1: for injecting things like logging tracing.
- 5:30Speaker 2: Security yep, the sidecar pattern.
- 5:33Speaker 1: How does EVPF compare. Is it a better alternative?
- 5:36Speaker 2: In many ways? Yes, The sidecar approach, while useful, often
- 5:40Speaker 2: means modifying application yamo files, restarting.
- 5:43Speaker 1: Pods, right operational friction.
- 5:45Speaker 2: Exactly, and if something goes wrong, the sidecar might not
- 5:48Speaker 2: even get injected, leaving you blind. Plus, sidecars can potentially
- 5:52Speaker 2: be bypassed by bad actors. How so well, imagine an
- 5:56Speaker 2: attacker deploys an uninstrumented app like a crypto minor sidecar
- 6:00Speaker 2: based security tool which relies on injection, might not even
- 6:03Speaker 2: see it connecting out to its mining pool.
- 6:05Speaker 1: Ah I see, and eBPF avoids that Precisely.
- 6:08Speaker 2: eBPF based tools run on the host and can police
- 6:12Speaker 2: all traffic, all processes on that machine, including everything inside containers.
- 6:16Speaker 2: They're much harder to.
- 6:17Speaker 1: Side steps, so instant complete visibility.
- 6:20Speaker 2: Pretty much without needing app modifications or restarts. That's a
- 6:24Speaker 2: game changer for infrastructure teams wanting comprehensive coverage.
- 6:28Speaker 1: Okay, but these programs are running directly inside the kernel.
- 6:31Speaker 1: That immediately raises safety concerns. What stops a buggy eBPF
- 6:35Speaker 1: program from crashing the whole system or reading memory. It shouldn't.
- 6:40Speaker 2: That's the million dollar question, and the answer is the
- 6:43Speaker 2: eBPF verifier.
- 6:45Speaker 1: The kernel's unseen guardian you called it.
- 6:47Speaker 2: That's a good way to put it. Before an eBPF
- 6:50Speaker 2: program is ever loaded, the verifier performs an exhaustive static analysis.
- 6:55Speaker 2: It checks every single possible execution path, every path, every
- 6:59Speaker 2: path to ensure its safe and won't harm the kernel.
- 7:02Speaker 2: It's like a super strict bouncer at the kernel's door. Honestly,
- 7:05Speaker 2: it's a marvel of engineering that makes this whole thing
- 7:07Speaker 2: possible safely.
- 7:08Speaker 1: So what kinds of checks does this bouncer perform? It
- 7:11Speaker 1: must be incredibly rigorous, it really is.
- 7:14Speaker 2: It tracks the state of each register their types, value
- 7:17Speaker 2: ranges to prevent invalid operations. It enforces trick memory access,
- 7:22Speaker 2: making sure programs only touch memory they're allowed to.
- 7:24Speaker 1: No arbitrary reads are writes none.
- 7:27Speaker 2: It mandates checks for null pointers before they're reference, preventing
- 7:31Speaker 2: common crashes. Very importantly, it guarantees programs run to completion.
- 7:36Speaker 1: How does it do that?
- 7:37Speaker 2: It rejects programs with loops that it can't prove will terminate.
- 7:42Speaker 2: There's also a maximum instruction limit, currently a million instructions
- 7:45Speaker 2: for privileged users a million.
- 7:47Speaker 1: Okay, that's quite a lot.
- 7:49Speaker 2: Actually, it gives you scope for complex logic. The verifier
- 7:52Speaker 2: also checks that helper functions called by the eBPF program
- 7:56Speaker 2: are allowed for that specific program type, and it even
- 7:59Speaker 2: checks for GPL compatible licenses if the program uses certain
- 8:03Speaker 2: restricted helpers.
- 8:04Speaker 1: That's incredibly thorough. It really builds confidence.
- 8:06Speaker 2: It has to be. The kernel stability is.
- 8:08Speaker 1: Paramount, Okay, beyond safety. You mentioned eBPF maps earlier as
- 8:12Speaker 1: a key differentiator from the original BPF. How did maps
- 8:16Speaker 1: change the game?
- 8:17Speaker 2: Maps was a fundamental breakthrough. They are essentially key value stores,
- 8:21Speaker 2: data structures that act as a bridge, a bridge between
- 8:24Speaker 2: between the kernel and user space, or even between different
- 8:27Speaker 2: eBPF programs running in the kernel. They allow communication and state.
- 8:30Speaker 1: Sharing, which wasn't possible before.
- 8:32Speaker 2: Right. Classic BPF was stateless, just processing individual packets. Maps
- 8:37Speaker 2: allow eBPF programs to store state across multiple events or invocations,
- 8:41Speaker 2: so you can use.
- 8:42Speaker 1: Them for things like counters sending metrics from the kernel
- 8:46Speaker 1: up to a userspace monitoring tool exactly.
- 8:48Speaker 2: That's a common use case, or storing configuration data pushed
- 8:52Speaker 2: down from user space, or maintaining state across multiple program
- 8:56Speaker 2: executions like global variables.
- 8:58Speaker 1: And you mentioned tail calls too. What are those?
- 9:00Speaker 2: Tail calls allow one eBPF program to effectively jump to
- 9:04Speaker 2: another eBPF program, replacing itself. It's a way to chain
- 9:07Speaker 2: programs together.
- 9:08Speaker 1: Ah okay, so you can build more complex logic flows.
- 9:12Speaker 2: Precisely, you can chain up to thirty three tail calls currently,
- 9:15Speaker 2: combined with that million instruction limit per program, it gives
- 9:18Speaker 2: you a lot of flexibility for sophisticated in kernel logic.
- 9:21Speaker 1: So maps and tail calls really elevated eBPF from just
- 9:25Speaker 1: a filter to a proper programmable platform.
- 9:27Speaker 2: Absolutely, they are key to building that sophisticated eBPF based
- 9:31Speaker 2: applications we see today.
- 9:32Speaker 1: Now, if you're thinking about building with eBPF, what are
- 9:35Speaker 1: the language choices for the kernel side code itself? I
- 9:38Speaker 1: assume it's pretty low level.
- 9:40Speaker 2: Yes, For the code running in the kernel. Most eBPF
- 9:43Speaker 2: programs are written in C or Rust. Why those Because
- 9:46Speaker 2: they are compilers like Clang LLVM for C can directly
- 9:50Speaker 2: target the EDPF bytecode instruction set. They give you that
- 9:54Speaker 2: necessary low level control.
- 9:56Speaker 1: Makes sense? And what about the user space side? The
- 9:58Speaker 1: applications that load and manage these kernel programs.
- 10:01Speaker 2: There you have much more flexibility. User space applications can
- 10:04Speaker 2: be written in various languages using specific libraries to interact
- 10:08Speaker 2: with the kernel's eBPF capabilities.
- 10:10Speaker 1: When eBPF was first taking off, I remember BCC being
- 10:13Speaker 1: very popular.
- 10:14Speaker 2: Yes, BCC, the BPF compiler collection. It supports Python, Lua,
- 10:18Speaker 2: C plus plus C. It was fantastic for learning and experimentation.
- 10:22Speaker 1: Why was it good for learning?
- 10:24Speaker 2: It abstracted away a lot of the low level complexity,
- 10:26Speaker 2: making EDPF accessible to people who weren't necessarily deep kernel hackers.
- 10:30Speaker 2: You could write Python scripts to load and interact with
- 10:33Speaker 2: CEBPF code.
- 10:34Speaker 1: But it had drawbacks for production it did.
- 10:36Speaker 2: Its main issue was a compile the EDPFC code at
- 10:39Speaker 2: runtime on the target machine.
- 10:41Speaker 1: Oh right, so you needed the compiler toolchain LVM CLIANG
- 10:45Speaker 1: kernel headers on every single server exactly.
- 10:48Speaker 2: That meant bigger dependencies, potential installation headaches, and noticeable startup
- 10:52Speaker 2: delays while the code compiled plus higher resource consumption not
- 10:57Speaker 2: ideal for large scale production deployments.
- 10:59Speaker 1: So there wasn't need something more robust, more portable for
- 11:02Speaker 1: enterprise use. That leads us to KEOII, right, compile once,
- 11:06Speaker 1: run everywhere.
- 11:07Speaker 2: Yes. Keyoor is the modern approach and a huge leap forward.
- 11:12Speaker 2: It's really what made eBPF practical for widespread production use.
- 11:16Speaker 1: How does it achieve that run everywhere magic? It sounds tricky,
- 11:19Speaker 1: with different kernel versions having slightly different data structures, It
- 11:22Speaker 1: is clever.
- 11:23Speaker 2: The key is BTF BPF type format. During compilation, detailed
- 11:27Speaker 2: type information about the kernel structures the eBPF program uses
- 11:30Speaker 2: is embedded into the compiled object file itself. Okay, Then
- 11:33Speaker 2: when you load that program on a target machine, a
- 11:36Speaker 2: userspace library uses that BTF data to understand the specific
- 11:39Speaker 2: kernel version running there. It can then automatically adjust memory
- 11:42Speaker 2: offsets and structure accesses on the fly, so it.
- 11:45Speaker 1: Adapts the pre compiled code at load time.
- 11:47Speaker 2: Essentially, yes, it relocates the memory accesses based on the
- 11:51Speaker 2: actual kernel's layout. This means you can compile your EVPF
- 11:55Speaker 2: program once on your rig machine and then deploy that
- 11:58Speaker 2: same binary across a whole fleet running different kernel versions
- 12:02Speaker 2: within limits.
- 12:03Speaker 1: Of course, that's a massive operational win. No more compiling
- 12:06Speaker 1: on every node huge.
- 12:07Speaker 2: It makes deployment much much simpler.
- 12:09Speaker 1: And the core c library that enables score is LIBPF.
- 12:14Speaker 2: That's right. Lip APF is maintained alongside the kernel source tree,
- 12:18Speaker 2: and it's the reference implementation. It uses auto generated BPF
- 12:21Speaker 2: skeletons c headers that make loading and managing the eBPF
- 12:25Speaker 2: programs and maps much cleaner from user space.
- 12:28Speaker 1: And the benefits over BCC are.
- 12:30Speaker 2: Lower memory footprint, no runtime compilation dependency, no startup delay,
- 12:35Speaker 2: and that crucial keore portability. If you're building a serious
- 12:38Speaker 2: eBPF application today, especially in C, LIBPF is the way
- 12:42Speaker 2: to go.
- 12:42Speaker 1: But it's not just C anymore, is it. The ecosystem
- 12:45Speaker 1: seems to be growing definitely.
- 12:46Speaker 2: The community has built excellent libraries for other popular languages.
- 12:50Speaker 2: For Go developers, there's silly MEPF and also libbed PFG,
- 12:54Speaker 2: which provides Go bindings for lipef.
- 12:57Speaker 1: And for Rust. Rust seems like a natural for systems programming.
- 13:01Speaker 2: It does, and there are several options there too, like
- 13:03Speaker 2: libpfrs red, BPF, and AYA. Each has slightly different approaches
- 13:08Speaker 2: and trade offs, but they all bring eBPF development to
- 13:11Speaker 2: Rust programmers, leveraging Rust safety features.
- 13:15Speaker 1: So lots of options depending on your team's preferred language exactly.
- 13:19Speaker 2: It's much more accessible now than it was just a
- 13:21Speaker 2: few years ago.
- 13:21Speaker 1: Okay, so we have this powerful, safe portable technology, how
- 13:26Speaker 1: is it actually being used? Let's talk real world applications.
- 13:30Speaker 1: Observability seems like a prime candidate.
- 13:32Speaker 2: Absolutely because eBPF programs can attach to so many points ciscolls,
- 13:36Speaker 2: kernel trace points, kernel functions, eight K probes, even user
- 13:39Speaker 2: space functions uprobes. They provide incredibly powerful tracing capabilities.
- 13:43Speaker 1: Deeper than traditional monitoring, much.
- 13:45Speaker 2: Deeper and often with less overhead. You get unparalleled insight
- 13:49Speaker 2: into system behavior, network disc io function calls within applications,
- 13:55Speaker 2: all without modifying or restarting the application itself. It's like
- 13:59Speaker 2: having x ray vision into your running systems.
- 14:01Speaker 1: And in networking. You mentioned BPF's origins there, but eBPF
- 14:05Speaker 1: takes it much further, especially with XDP.
- 14:07Speaker 2: Yes XDP the express data path. This is really powerful.
- 14:13Speaker 2: XDP allows eBPF programs to run at the earliest possible
- 14:16Speaker 2: point in the network stack, right in the driver, even
- 14:19Speaker 2: before the kernel allocates memory for the packet BSKB.
- 14:22Speaker 1: So super fast packet process extremely fast.
- 14:26Speaker 2: This lets you do things like high performance firewalling, dropping
- 14:28Speaker 2: malicious packets for dedas mitigation, or implementing custom load balancing
- 14:32Speaker 2: all at line rate in many cases.
- 14:34Speaker 1: Before the packet even really hits the main kernel networking exactly.
- 14:38Speaker 2: You can make decisions and potentially drop packets with minimal overhead.
- 14:41Speaker 2: Some network cards even support offloading XDP programs directly onto
- 14:44Speaker 2: the NIC hardware itself.
- 14:46Speaker 1: Wow, hardware offload. That's serious performance it is.
- 14:49Speaker 2: It allows you to handle enormous amounts of traffic. Think
- 14:53Speaker 2: about mitigating those packet of death vulnerabilities. XDP can drop
- 14:57Speaker 2: the malicious packet before it can even cause harm in
- 15:00Speaker 2: the network stack.
- 15:01Speaker 1: And this has big implications for Kubernetes networking too, doesn't
- 15:04Speaker 1: it replacing things like.
- 15:05Speaker 2: Iptables fundamentally changing it. Yes. Traditional Kubernetes networking often relies
- 15:10Speaker 2: heavily on iptables for implementing network policies and services and
- 15:14Speaker 2: contract for connection.
- 15:15Speaker 1: Tracking, and those have scaling issues, right they do.
- 15:18Speaker 2: Iptable's rules are processed linearly, so performance degrades is the
- 15:22Speaker 2: number of rules or services grows. That's o n complexity.
- 15:26Speaker 2: Contract can also become a bottleneck.
- 15:28Speaker 1: How does eBPF help.
- 15:30Speaker 2: eBPF based networking solutions like Cilium replace Iptable's rules and
- 15:35Speaker 2: contract with EVPF programs and maps they use efficient hash
- 15:38Speaker 2: maps for lookups.
- 15:39Speaker 1: Hash maps the lookups are faster.
- 15:40Speaker 2: Much faster oh one or constant time lookups for network policies,
- 15:45Speaker 2: service load balancing, and connection tracking regardless of the number
- 15:48Speaker 2: of rules or connections. This is critical for performance and
- 15:51Speaker 2: scalability in large Kubernetes clusters.
- 15:53Speaker 1: That's a significant architectural shift. Now here's a capability that
- 15:57Speaker 1: sounds almost like magic transparent ryption insight. How can eBPF
- 16:03Speaker 1: see inside encrypted traffic without keys?
- 16:06Speaker 2: It's a clever trick. It doesn't actually break the encryption itself. Instead,
- 16:10Speaker 2: eBPF uses uprobes to hook into userspace SSLTLS libraries like
- 16:15Speaker 2: open ssl ortls.
- 16:16Speaker 1: So it attaches to the applications encryption functions precisely.
- 16:19Speaker 2: It attaches to functions like SSL read and SSL write.
- 16:23Speaker 2: It can then intercept the data after the library has
- 16:25Speaker 2: decrypted it for SSL rate or before the library encrypts
- 16:29Speaker 2: it for SSL right.
- 16:30Speaker 1: Ah. So it catches the plaintext data inside the application's
- 16:33Speaker 1: memory just before encryption or just after decryption exactly.
- 16:37Speaker 2: You get visibility into the clear text data flow without
- 16:40Speaker 2: needing access to the private keys or certificates. It's incredibly
- 16:43Speaker 2: powerful for security monitoring, troubleshooting, and even compliance without disrupting
- 16:48Speaker 2: the encryption itself.
- 16:49Speaker 1: That's fascinating. Okay, let's shift fully to security. eBPF seems
- 16:53Speaker 1: poised to move security from just detection to actual prevention.
- 16:57Speaker 2: That's a key trend for years. Second PPF provided a
- 17:01Speaker 2: basic layer by filtering ciscoles, which is used heavily in
- 17:04Speaker 2: Docker and Kubernetes.
- 17:06Speaker 1: Right limiting what a container can do.
- 17:07Speaker 2: Yes, and some eBPF tools like inspector gadget can even
- 17:11Speaker 2: help generate those secom profiles by observing what ciscoles an
- 17:15Speaker 2: application legitimately uses.
- 17:17Speaker 1: But generating perfect profiles is hard right capturing all error
- 17:20Speaker 1: pads and edge cases.
- 17:22Speaker 2: It's very challenging, and traditional detection often suffers from that
- 17:26Speaker 2: Tatau problem time of check to time of use the
- 17:29Speaker 2: race condition. Exactly by the time a separate security agent
- 17:32Speaker 2: detects a malicious ciscle or file access and decides to act,
- 17:36Speaker 2: the damage might already be done. The malicious operation might
- 17:39Speaker 2: have completed.
- 17:39Speaker 1: So how does eBPF enable prevention closing that time gap?
- 17:43Speaker 2: This is where a specific eBPF program type comes in
- 17:47Speaker 2: bpfpot typos. These programs attached to hooks within the Linux
- 17:51Speaker 2: Security Module Framework.
- 17:53Speaker 1: LSM, like a Parmer or Cylenux.
- 17:55Speaker 2: Use exactly the same framework. These eBPF LSM programs can
- 17:59Speaker 2: perform he checks directly inside the kernel before a sensitive
- 18:02Speaker 2: operation happens, and crucially, they can return.
- 18:05Speaker 1: An air code and that error code.
- 18:07Speaker 2: It prevents the operation from proceeding. The kernel respects the
- 18:10Speaker 2: error code returned by the LSM hook, stopping the action
- 18:12Speaker 2: before it even starts. It happens synchronously within the context
- 18:16Speaker 2: of the original operation.
- 18:17Speaker 1: So it's in kernel enforcement, not just after the fact detection.
- 18:21Speaker 2: Precisely, it's a fundamental shift from reactive detection to proactive
- 18:24Speaker 2: synchronous prevention.
- 18:25Speaker 1: And tools like Cilium Tetragon build on this.
- 18:28Speaker 2: They do. Tetragen uses EVPF attaching to k probes and
- 18:32Speaker 2: trace points, not just LSM hooks, to get rich context
- 18:36Speaker 2: about security events. It can filter these events efficiently in
- 18:39Speaker 2: the kernel, reducing overhead, and.
- 18:41Speaker 1: Can it actively stop threats Yes.
- 18:44Speaker 2: Based on his policies, it can use helpers like bpfen
- 18:47Speaker 2: signal to for example, send a sig kill signal to
- 18:50Speaker 2: terminate a malicious process immediately synchronously when a violation is detected.
- 18:55Speaker 1: So detect and terminate right there in the kernel context exactly.
- 18:58Speaker 2: It moves security beyond just observing and alerting to actively
- 19:02Speaker 2: enforcing policy and preventing harm in real time.
- 19:05Speaker 1: So to kind of wrap this deep dive up, eBPF
- 19:07Speaker 1: has really come a long way from just filtering packets.
- 19:09Speaker 2: An incredible journey.
- 19:11Speaker 1: It's evolved into this powerful, versatile platform that's genuinely transforming observability, networking,
- 19:17Speaker 1: and security, giving us unprecedented control and insight right at
- 19:22Speaker 1: the kernel level.
- 19:23Speaker 2: It really feels like we're still just scratching the surface
- 19:25Speaker 2: of what's possible with it. The innovation is happening incredibly fast, and.
- 19:30Speaker 1: The future looks bright. What's next?
- 19:32Speaker 2: Well, The eBPF Foundation, which includes major players like Google, Meta, Microsoft, Netflix, isovalent.
- 19:40Speaker 2: They're working on standardizing.
- 19:42Speaker 1: eBPF standardization is always good, yeah.
- 19:44Speaker 2: And even exploring its adoption for Windows, which could potentially
- 19:47Speaker 2: allow eBPF programs written for Linux to run on Windows too.
- 19:51Speaker 1: Wow. Cross platform eBPF.
- 19:53Speaker 2: That's the long term vision for some. It's a rapidly
- 19:56Speaker 2: evolving field. New kernel features are landing all the time,
- 20:00Speaker 2: though it's worth remembering there's always a lag before the
- 20:03Speaker 2: very latest features make it into stable Linux distributions.
- 20:06Speaker 1: You might be running sure the usual adoption cycle.
- 20:08Speaker 2: Right, but the pace of development is really impressive.
- 20:11Speaker 1: It certainly seems like it's going to shape how many
- 20:13Speaker 1: of our tools work now and in the future. So
- 20:16Speaker 1: maybe a final thought for our listeners, EDPF seems to
- 20:20Speaker 1: be shifting from this cutting edge niche thing to a
- 20:24Speaker 1: fundamental platform for infrastructure tooling.
- 20:27Speaker 2: Seems that way so well.
- 20:29Speaker 1: Understanding how this magic works become as essential for developers
- 20:33Speaker 1: and operators today as say, understanding networking protocols or distributed systems.
- 20:38Speaker 2: That's a really interesting question to ponder. The tools built
- 20:41Speaker 2: on EEDPF are definitely becoming ubiquitous, things like Cilium, Falco, Pixie, Tetric.
- 20:46Speaker 1: Carey'll encounter them more and more.
- 20:47Speaker 2: You will, and having even that foundational understanding of what's
- 20:51Speaker 2: happening under the hood how eBPF enables them, it definitely
- 20:55Speaker 2: gives you a significant advantage in using them effectively, troubleshooting them,
- 21:00Speaker 2: and just understanding your systems better.
- 21:01Speaker 1: Well. Hopefully this deep dive gave you a good starting point.
- 21:05Speaker 1: We encourage you to think about how these eBPF based
- 21:07Speaker 1: tools might shape your work and maybe explore some of
- 21:10Speaker 1: the projects or Liz Rice's book if you want to
- 21:12Speaker 1: go deeper.
- 21:13Speaker 2: It's a fascinating space to watch.
- 21:15Speaker 1: Absolutely thanks for joining us for this deep dive.