Commit cbb1a32
DeepShield Dev
feat(baseline): P3 statistical baseline analysis engine
- Add zerotrace_baseline.go with three detection modes:
1. EWMA anomaly: per-host metric deviation (unique_domains, dst_ips,
bytes_up, dns_queries, http_requests) with configurable alpha/threshold
2. First-seen: new domains not observed in 7-day lookback window,
severity escalated by DGA score
3. Beacon detection: periodic DNS connection intervals with low jitter
(coefficient of variation < 0.15) indicating C2 communication
- Auto-creates siteguard.baseline_alerts and siteguard.ewma_baselines tables
- EWMA baselines use ReplacingMergeTree for in-place updates
- Endpoints: POST /probe/baseline/run, GET /probe/baseline/status
- Also detects: high DGA score hosts (>=0.7) and suspicious path hit hosts
- Register baseline routes in zerotrace.go
- Verified: 143 alerts generated on first run, 26 EWMA baselines initialized1 parent c35cef2 commit cbb1a32
2 files changed
Lines changed: 452 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
0 commit comments