How dawidtrochim/attack-graph-chain-reconstruction-engine works
This is a SOC investigation backend: analysts or API clients submit IOC and log data, trigger correlation and reconstruction, then inspect attack chains and update investigation status through REST or dashboard views. The documented pipeline includes MITRE ATT&CK mapping, severity scoring, graph persistence, and interactive visualization. Core runtime paths are represented; dashboard templates and some integrations are documented but not excerpted, so those relationships rely on the README where noted.
Main entry points: models.py PostgreSQL data · main.py FastAPI application · reconstruction.py Chain reconstruction · dashboard.py Dashboard and workflow
Components 19
Ingestion API
- FastAPI application
app/main.py - IOC ingestion
app/routes/iocs.py - Log ingestion
app/routes/logs.py - Request schemas
app/schemas.py
Detection Pipeline
- Detection triggers
app/routes/attack_chains.py - IOC correlation
app/services/correlation.py - Chain reconstruction
app/services/reconstruction.py - ATT&CK mapping
app/services/stage_mapping.py - Severity scoring
app/services/scoring.py - Attack graph builder
app/services/graph_builder.py
Persistence
- PostgreSQL data
app/models.py - Database sessions
app/db.py - Runtime settings
app/config.py
Investigation UI
- Chain and graph API
app/routes/attack_chains.py - Dashboard and workflow
app/routes/dashboard.py - Investigation views
app/templates - Interactive graph view
app/templates/graph_view.html
Other components
- SOC analyst
- API client
Connections 25
- API client → FastAPI application: sends requests
README.md - SOC analyst → Dashboard and workflow: investigates chains
README.md - FastAPI application → IOC ingestion: registers router
app/main.py - FastAPI application → Log ingestion: registers router
app/main.py - FastAPI application → Detection triggers: registers router
app/main.py - FastAPI application → Dashboard and workflow: registers router
app/main.py - IOC ingestion → Request schemas: validates payload
app/routes/iocs.py - Log ingestion → Request schemas: validates payload
app/routes/logs.py - IOC ingestion → PostgreSQL data: writes indicators
app/routes/iocs.py - Log ingestion → PostgreSQL data: writes log events
app/routes/logs.py - Detection triggers → IOC correlation: runs correlation
app/routes/attack_chains.py - IOC correlation → PostgreSQL data: reads and records matches
app/services/correlation.py - Detection triggers → Chain reconstruction: starts reconstruction
app/routes/attack_chains.py - Chain reconstruction → PostgreSQL data: reads matches; writes chains
app/services/reconstruction.py - Chain reconstruction → ATT&CK mapping: maps events
app/services/reconstruction.py - Chain reconstruction → Severity scoring: computes scores
app/services/reconstruction.py - Chain reconstruction → Attack graph builder: builds chain graph
app/services/reconstruction.py - Attack graph builder → PostgreSQL data: persists graph
app/services/graph_builder.py - FastAPI application → Database sessions: initializes database
app/main.py - Database sessions → Runtime settings: gets database URL
app/db.py - Database sessions → PostgreSQL data: opens sessions
app/db.py - Chain and graph API → PostgreSQL data: reads chains and graphs
app/routes/attack_chains.py - Dashboard and workflow → PostgreSQL data: reads and updates cases
app/routes/dashboard.py - Dashboard and workflow → Investigation views: renders views
README.md - Investigation views → Interactive graph view: includes graph view