How razeini/wirewarden works
WireWarden is a hybrid Python/C network intrusion detection and prevention engine with a provisioned Grafana/Loki observability stack. Its primary workflow captures packets, queues them by flow for worker analysis, detects threats, applies defensive firewall rules when warranted, and emits structured logs for monitoring. The detection stages and monitoring flow are documented in the README; the supplied main.py excerpts show key runtime components, but omit some implementation details, so links rely on documented relationships where noted.
Main entry points: main.py Worker Pool · promtail-config.yml Promtail · dashboard-WireWarden Security Overview.json Security Dashboard · dashboards.yml Dashboard Provisioning
Components 18
Capture and Analysis
- Packet Capture
main.py - Flow Queues
main.py - Worker Pool
main.py
Threat Detection
- Scan and DoS
main.py - DNS Entropy
main.py - DPI Pipeline
main.py - Keyword Matcher
main.py - Native Signatures
c_src/dpi.c - Flow Tail Tracking
main.py
Active Defense
- Firewall Manager
main.py - Cleanup Worker
main.py
Observability
- Structured Logs
main.py - Promtail
promtail-config.yml - Loki
- Grafana
- Security Dashboard
grafana/dashboards/dashboard-WireWarden Security Overview.json - Dashboard Provisioning
grafana/provisioning/dashboards/dashboards.yml
Other components
- Network Traffic
Connections 19
- Network Traffic → Packet Capture: supplies packets
README.md - Packet Capture → Flow Queues: enqueues by flow
main.py - Flow Queues → Worker Pool: dispatches packets
README.md - Worker Pool → Scan and DoS: checks traffic
README.md - Worker Pool → DNS Entropy: checks queries
main.py - Worker Pool → DPI Pipeline: inspects payloads
main.py - DPI Pipeline → Keyword Matcher: scans keywords
main.py - DPI Pipeline → Native Signatures: scans signatures
main.py - DPI Pipeline → Flow Tail Tracking: tracks boundaries
main.py - Scan and DoS → Firewall Manager: blocks offenders
README.md - Cleanup Worker → Scan and DoS: purges windows
README.md - Cleanup Worker → Firewall Manager: expires rules
README.md - Worker Pool → Structured Logs: writes events
README.md - Firewall Manager → Structured Logs: logs outcomes
main.py - Structured Logs → Promtail: ships log stream
README.md - Promtail → Loki: pushes logs
README.md - Loki → Grafana: feeds queries
README.md - Dashboard Provisioning → Grafana: loads dashboard
README.md - Security Dashboard → Grafana: renders panels
README.md