How peerahammad/threatflow works
ThreatFlow replays saved network-flow samples through a stateful hybrid detector, turning per-flow attack probabilities and temporal regime estimates into persistent incident alerts for a live dashboard. The graph focuses on the documented replay workflow and major dashboard capabilities. Training and analysis scripts are excluded as offline utilities. Source excerpts show the detector’s internal calls and API wiring; dashboard-to-backend links are supported by the frontend excerpt and README.
Main entry points: main.py FastAPI Replay API · app.js Live Dashboard · inference.py Streaming Detector · switching_ssm.py Regime Model
Components 11
Replay API
- FastAPI Replay API
backend/main.py
Streaming Detection
- Streaming Detector
model/inference.py - Feature Stream
model/inference.py - Regime Model
model/switching_ssm.py - Random Forests
model/inference.py
Alert Monitoring
- Live Dashboard
frontend/static/app.js - Windowed Alerting
model/alerts.py
Runtime Data
- Replay Flows
data/replay_sample.npz - Trained Model Artifact
artifacts/pard_model.joblib - Evaluation Summary
artifacts/eval_summary.json
Other components
- Analyst
Connections 13
- Analyst → Live Dashboard: operates
README.md - Live Dashboard → FastAPI Replay API: requests status
frontend/static/app.js - Live Dashboard → FastAPI Replay API: controls replay
frontend/static/app.js - FastAPI Replay API → Live Dashboard: streams batches
README.md - FastAPI Replay API → Replay Flows: loads flows
backend/main.py - FastAPI Replay API → Trained Model Artifact: loads model
backend/main.py - FastAPI Replay API → Evaluation Summary: reads metrics
backend/main.py - FastAPI Replay API → Streaming Detector: processes batches
backend/main.py - Streaming Detector → Feature Stream: transforms flows
model/inference.py - Feature Stream → Regime Model: updates regimes
model/inference.py - Feature Stream → Random Forests: supplies features
model/inference.py - Streaming Detector → Windowed Alerting: updates alert state
model/inference.py - FastAPI Replay API → Live Dashboard: serves interface
backend/main.py