BPF - the forgotten bytecode
May 21, 2014Marek Majkowski

Summary
This post introduces the Berkeley Packet Filter (BPF) as a powerful and flexible mechanism for packet filtering within the kernel. It details how BPF, originally developed for `tcpdump`, has evolved and is now utilized by Cloudflare for advanced threat management. Specifically, it highlights the use of the `xt_bpf` iptables module to apply custom BPF bytecode for precisely matching and dropping malicious traffic, such as DNS queries for specific domains or subdomains, and demonstrates its effectiveness in handling massive packet floods.
More from the Website Security & Threat Management trail
- We tested our own WAF with frontier AI models. Here’s what we found
- When scanners miss the attack: how Cloudflare Client-Side Security protects storefronts
- Introducing automatic remediation policies with Cloudflare CASB
- Introducing context-aware vulnerability discovery and remediation with Cloudflare Managed Defense and OpenAI Daybreak Models
- Introducing Adaptive Intelligence: undermining the economics of every bot attack