Little Snitch for Linux is an open-source eBPF-based network monitoring and blocking toolkit written in Rust. It attaches eBPF programs to the Linux kernel to intercept network connections, then shares data between kernel and user space via eBPF maps. The open-source portion includes eBPF programs, shared types, and a demo runner; the full product from Objective Development includes additional proprietary UI and rule-engine components.
eBPF enabled in kernel config (CONFIG_BPF=y, CONFIG_BPF_SYSCALL=y)
CAP_BPF or root privileges to load eBPF programs
Build & Run
# Clone the repository
git clone https://github.com/obdev/littlesnitch-linux
cd littlesnitch-linux
# Build everything (eBPF programs are auto-built via build scripts)
cargo build --release
# Run the demo runner (requires root or CAP_BPF)sudo cargo run --release
# Check without building
cargo check
Note: Cargo build scripts automatically compile the eBPF programs and embed them in the binary — no manual eBPF compilation step needed.
Blocklist Configuration
The demo runner loads two blocklist files at startup:
blocked_hosts.txt
One IP address or hostname per line:
93.184.216.34
203.0.113.0
198.51.100.1
blocked_domains.txt
One domain suffix per line (blocks domain and all subdomains):
# Run with sudo or grant capabilitiessudo cargo run --release
# Or grant cap_bpf to the binary after buildsudosetcap cap_bpf,cap_net_admin+eip target/release/demo-runner
./target/release/demo-runner
Build fails: bpf-linker not found
cargo install bpf-linker
# If it fails, ensure LLVM is installed:sudo apt install llvm-dev libclang-dev # Debian/Ubuntu
eBPF verifier rejects program
Reduce map sizes or loop bounds
Ensure all memory accesses are bounds-checked
Check kernel version supports the helpers you're using:
uname -r # Should be 5.15+
Map not found error
# Verify eBPF object was built and embedded correctly
cargo build --release 2>&1 | grep -i ebpf
# The build script in demo-runner/build.rs handles this automatically
blocked_hosts.txt not found
# Run from repo root, or specify path explicitlytouch blocked_hosts.txt blocked_domains.txt
sudo cargo run --release
License
All code in this repository is licensed under GPL-2.0. Contributions submitted to this project are licensed under the same terms.