Skip to content

VectorSigmaOmega/K-Watch

Repository files navigation

K-Watch: eBPF Kernel Observability Engine

Demo

K-Watch is a high-performance network engine powered by eBPF/XDP. It injects code directly into the driver layer to monitor and mitigate traffic at line-rate. Unlike traditional tools, K-Watch uses kernel-aggregated state and ring-buffer sampling to provide deep packet visibility with sub-5% CPU overhead. It demonstrates behavioral SYN-flood detection and CIDR-based hardware-offload ready filtering. Designed as a systems engineering showcase, it is not a production WAF or IDS, but a proof of eBPF depth.

Architecture

See docs/architecture.md for a detailed breakdown.

NIC → XDP (Parser & Filter) → BPF Maps → Ring Buffer → C++ Daemon → CLI/TUI

Quickstart

1. Build

cmake -B build
cmake --build build

2. Run

Observe live traffic on your loopback interface:

sudo ./build/kwatch run lo

3. Mitigate

Block an IP or entire range instantly:

sudo ./build/kwatch block lo 1.2.3.4/32

Features

  • XDP-Powered: High-performance packet processing at the driver level.
  • Behavioral Detection: Detects SYN floods using SYN/ACK ratio analysis.
  • Auto-Mitigation: Automatically blocks malicious IPs with a configurable cooldown.
  • Single Binary: No Node.js, Python, or external runtimes. Pure C++20 and libbpf.
  • Interactive TUI: Opt-in dashboard via kwatch top.
  • CO-RE: Portable across different kernel versions without recompilation.

Detailed Documentation

License

MIT

About

No description, website, or topics provided.

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors