Skip to content

stephensanwo/ebpf-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Exploring eBPF

Core eBPF Examples

  • System Call Tracing: Monitor execve() calls and process creation
  • System Call Counting: Collect and analyze syscall statistics
  • TCP Connection Monitoring: Track network connections and traffic
  • File I/O Security Monitoring: Block and monitor access to protected files
  • HTTP Session Tracing: Capture complete HTTP request/response pairs using eBPF

🛡️ File I/O Security Monitoring (NEW!)

The I/O blocking example demonstrates eBPF-based file system security:

  • eBPF Kernel: Monitors file open operations at system call level (openat)
  • Real-time Alerts: Immediately detects when protected_file.txt is accessed
  • Clean Detection: Simple, focused monitoring of file opening operations
  • Process Tracking: Shows which processes attempt to access protected files
  • Zero Bypass: Cannot be circumvented by applications since monitoring happens at kernel level

🌐 HTTP Session Tracing (NEW!)

The HTTP tracer demonstrates application-layer monitoring following the Datadog eBPF tutorial:

  • eBPF Kernel: Hooks accept4, read, write, close syscalls to capture HTTP traffic
  • Session Reconstruction: Builds complete request/response pairs from syscall data
  • Zero Instrumentation: Monitors HTTP sessions without modifying application code
  • Real-time Capture: Shows live HTTP traffic with timing and payload information
  • Lima VM Integration: Runs FastAPI server and eBPF tracer in same environment

Quick Start

# 1. Setup Lima VM with eBPF environment
make setup

# 2. Try the HTTP session tracer (Datadog tutorial implementation)
# Terminal 1: Start FastAPI server
make run-http-server

# Terminal 2: Start eBPF HTTP tracer  
make run-http-tracer

# Terminal 3: Generate traffic and see live capture
make shell
bash /home/lima/ebpf-examples/scripts/test-http-tracer.sh

# 3. Or try other examples
make run-io-monitor   # File I/O security monitoring
make run-tracer       # System call tracing
make run-counter      # System call counting 
make run-tcp          # TCP connection monitoring

eBPF Resources

TLDR

Videos

Articles & Documentation

Tools & Repositories

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published