Application security (AppSec) has traditionally relied on a combination of static and runtime analysis to identify and remediate vulnerabilities. Static analysis tools like SAST (Static Application Security Testing examine code at rest and excel at identifying issues, such as vulnerable code, early in the development. However, static analysis tools like SCA (Software Composition Analysis) lack the ability to identify context-dependent vulnerabilities and generate many false positives.
Runtime analysis, on the other hand, focuses on monitoring an application’s behavior during execution. Tools like Runtime Application Self-Protection (RASP) excel at detecting threats that arise from real-world interactions. Despite their contextual awareness, these solutions can be resource-intensive and are notoriously difficult to implement in modern, distributed environments.
Bridging these gaps requires a more sophisticated approach—one that eBPF (Extended Berkeley Packet Filter) is uniquely positioned to provide.
Understanding eBPF
eBPF is a cutting-edge in-kernel technology that allows users to execute Just In Time (JIT) compiled bytecode programs directly in the Linux kernel. Originally created for packet filtering, eBPF has evolved into a powerful tool for monitoring and decision-making at the kernel level without requiring to modify the kernel code itself. This allows developers to create programmable, event-driven hooks within the operating system, capable of observing, tracing, and controlling kernel behavior, including application interactions.
The true power of eBPF lies in its lightweight and secure nature. Unlike traditional kernel modules, eBPF operates securely within a sandboxed environment and can be executed without any significant performance impact. Running in a sandbox also ensures the stability of the OS, preventing eBPF applications from loading if they pose a risk to the system. This ability to run custom code within the kernel means eBPF can monitor and respond to runtime events with near-zero overhead.
Using eBPF for Runtime Analysis
Application context exists only during runtime. Configuration, environments, load, and many more variables play a crucial role in the code paths an application executes or chooses to skip.
When fixing vulnerabilities, software engineers typically start with triage - verifying if a vulnerable code path exists within the application’s context. If it doesn’t, they waste time. Considering that 90% of code does not execute at runtime, fixing vulnerabilities without runtime context is nothing but a waste of engineering time. eBPF revolutionizes runtime analysis by automating triage and eliminating the need for manual validation, saving engineers valuable time without impacting performance or compromising security.
Currently, all libraries have “permission” to run code or execute processes, though no library actually requires this broad set of permissions. Traditional runtime security tools allow enforcing permissions at the process level, but in the dynamic nature of code in the cloud, these tools struggle to sustain such policies as applications constantly evolve. eBPF solves this challenge by introducing logic that enforces permissions at the library level. Since libraries functionality rarely changes, this approach prevents false positives and reduces the operational overhead for the AppSec and SecOps teams.
Challenges and Considerations
While eBPF is a powerful tool, it does come with its own set of challenges:
- Learning Curve: eBPF requires familiarity with kernel programming and Linux internals, which can be a barrier for teams lacking this expertise.
- Compatibility: eBPF is currently best supported on modern Linux kernels. Teams working with mixed operating systems or older kernels may face limitations unless they have experienced kernel developers to extend support.
- Engineering: Since eBPF has to pass the Linux kernel sandbox inspections, it has to be engineered with extreme precision and efficiently to to handle complex logic without compromising system stability.
Our future posts will explore more of the challenges and how Raven overcomes them.
Conclusion
The AppSec landscape demands innovative tools that can keep up with complex application architectures and evolving threats. eBPF transforms how runtime security is approached by offering real-time insights, fine-grained control, and the ability to enforce security policies directly at the kernel level. While eBPF’s learning curve is steep, the benefits it brings in terms of observability, threat detection, prevention and response are hard to ignore.
For AppSec teams seeking to elevate their runtime analysis, eBPF represents a frontier of possibility, redefining what’s achievable in application security.
In a world where speed and precision are critical, eBPF offers AppSec teams capabilities needed to stay ahead of threats, ensuring applications remain resilient and secure in real time.