All scripts
analysis
Expert
5–15 min
NetFlow / sFlow Anomaly Detector
Statistical traffic anomaly engine: rolling-window baselining of per-prefix/per-port flows, DDoS volumetric and SYN-flood detection, top-talker drift, geographic source skew, and BGP-aware blackhole/RTBH suggestions.
Cisco IOS/XE/XR
Juniper
Arista
Nokia SR-OS
You're viewing a preview
The full script, parameters, and execution console are available with a free account.
Already have access? Sign in →
Capabilities
- EWMA baselining per /24
- SYN-flood & UDP amp detect
- Volumetric DDoS scoring
- Top-talker drift
- ASN/geo source skew
- RTBH candidate generator
- Flow exporter health
- Sampling-rate sanity check
Required inputs
Parameters the script accepts. Defaults shown; some are vendor- or context-gated.
| Parameter | Type | Default | Notes |
|---|---|---|---|
Baseline window (mins) window_mins | number | 60 | — |
Anomaly sigma threshold sigma_alert | number | 4.0 | RTBH announcements require ≥3σ confidence to avoid false-positive blackholes. |
Min pps to score pps_floor | number | 5000 | — |
SYN/SYN-ACK ratio alert syn_ratio_alert | number | 10 | — |
Generate RTBH candidates suggest_rtbh | bool | true | RTBH community injection requires a Cisco IOS-XR or IOS/XE edge in the vendor mix. |
Flow collector URL collector_url | string | http://flow.local:9995 | — |
Sample inventory schema
Authoritative shape of the device/policy data this script consumes.
exporters.csv
csv
8 flow exporters with sample rates, protocols, collector targetsterminal
hostname,mgmt_ip,role,sample_rate,protocol,collector,export_interfaces,nf_version edge-rtr-01,10.30.0.11,edge,1:1000,sflow,10.50.5.10:6343,"Te0/0/0,Te0/0/1,Te0/0/2",- edge-rtr-02,10.30.0.12,edge,1:1000,sflow,10.50.5.10:6343,"Te0/0/0,Te0/0/1,Te0/0/2",- edge-rtr-03,10.30.0.13,edge,1:1000,netflow,10.50.5.11:9995,"xe-0/0/0,xe-0/0/1",v9
protected_targets.yaml
yaml
Customer prefixes with p95 baselines, RTBH authorization, geo baselineyaml
# Customer prefixes worth alerting/RTBH'ing on
protected_prefixes:
- prefix: 203.0.113.0/24
customer: ACMEExpected output
Reference terminal output the script should produce — used as a stylistic and structural target.
terminal
NETFLOW ANOMALY SCAN — window=60m, σ=4.0 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ EXPORTER HEALTH: edge-rtr-01 flows/s=14,221 sample=1:1000 last seen 0s ✓ edge-rtr-02 flows/s=12,887 sample=1:1000 last seen 0s ✓ edge-rtr-03 flows/s= 0 sample=1:1000 last seen 14m ← STALE EXPORTER VOLUMETRIC ANOMALIES (score > 4σ): Dst 203.0.113.42/32 pps= 1,847,221 baseline=12,400 σ=148 ← DDoS LIKELY