# sathwikkbhat/acds---soc-analyst-dashboard architecture

> Architecture diagram of the GitHub repository sathwikkbhat/acds---soc-analyst-dashboard, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sathwikkbhat/acds---soc-analyst-dashboard
- Repository: https://github.com/sathwikkbhat/acds---soc-analyst-dashboard

## Overview

1. **Overall shape**
   - ACDS is a two-tier SOC dashboard: a **FastAPI/Python backend** handles log ingestion, normalization, detection, and playbook generation, while a **React/Vite frontend** renders real-time security views and consumes both REST and WebSocket data.

2. **Backend control plane**
   - `acds/backend/main.py` is the hub. It exposes the REST endpoints, the `/ws/alerts` stream, and startup/shutdown behavior for the monitoring and simulation subsystems.
   - The backend is the source of truth for alerts, threat stats, MITRE mappings, and archive data.

3. **Ingestion paths**
   - The system supports multiple inputs:
     - **Live monitoring** via `log_monitor.py`
     - **Uploaded logs** via `/upload`
     - **Synthetic/fake logs** via `log_generator.py` and `generate_fake_logs.py`
     - **Attack replay / stress testing** via `simulation_engine.py` and `/warp`
     - **Filebeat-based collection** via `filebeat.yml`, `local_filebeat.yml`, and the `filebeat_data/` registry state
   - `INPUT_MODE` in `config.py` decides whether the backend runs in simulation mode or file-driven mode.

4. **Normalization boundary**
   - `normalizer.py` is the preprocessing layer that turns heterogeneous log formats into a consistent internal event schema.
   - This is the key boundary between raw inputs and downstream analytics; detection and UI code depend on the normalized event shape rather than source-specific formats.

5. **Detection engine**
   - `detection_engine.py` contains the security logic for brute force, C2 beaconing, exfiltration, correlation across multiple threats, and false-positive suppression via whitelisting.
   - Thresholds and timing windows are configuration-driven from `config.py`, which makes detection tunable without changing the frontend.

6. **AI playbook generation**
   - `playbook_generator.py` is an external-service adapter around **Google Gemini**.
   - It is triggered only for selected critical alerts and returns incident-response guidance: summary, likely next attacker moves, containment steps, and IOCs to block.
   - This is a separate enrichment path, not part of the core detection pipeline.

7. **Stateful monitoring and replay**
   - `log_monitor.py` manages live event observation, while `simulation_engine.py` and `log_generator.py` generate controlled alert streams for testing, demos, and load scenarios.
   - `simulate_attack.ps1` and the Filebeat setup scripts support operational bootstrap on Windows.
   - `speed_test_manifest.json` and `sample_logs.json` suggest a repeatable test corpus for replay and benchmarking.

8. **Backend outputs and API surface**
   - The backend serves several read-model endpoints: `/stats`, `/alerts`, `/threats`, `/threats/stats`, `/intelligence/mitre`, `/intelligence/iocs`, and `/reset`.
   - These endpoints are optimized for dashboard views rather than raw event storage; they expose derived/security-meaningful aggregates.
   - `/monitor/start` and `/monitor/stop` control ingestion, making the backend an actively managed runtime.

9. **Frontend presentation layer**
   - `frontend/src/App.jsx` routes between the dashboard pages: **Blueprints**, **Threats**, **Intelligence**, **Archives**, and **Settings**.
   - `components/Sidebar.jsx` and `components/Topbar.jsx` provide persistent navigation and system-status chrome.
   - The frontend is a visualization and operator console; it does not implement detection logic itself.

10. **Frontend data flow**
   - `src/api.js` handles REST calls to the backend.
   - `context/SocketContext.jsx` is the real-time state bridge for WebSocket alerts and feed status, which drives live updates in the UI.
   - `syntheticEngine.js` provides a browser-side fallback/simulation layer for offline or mock behavior when the backend is unavailable.

11. **Dashboard page responsibilities**
   - **Blueprints** appears to be the main incident view for alert drill-down and AI playbook generation.
   - **Threats** focuses on active detector health and live threat status.
   - **Intelligence** surfaces MITRE ATT&CK coverage and IOC analytics.
   - **Archives** presents paginated historical events.
   - **Settings** manages thresholds, mode selection, and operational configuration.

12. **Deployment and runtime boundaries**
   - Backend runtime is Python 3.12 with FastAPI/Uvicorn.
   - Frontend runtime is Node/Vite/React and is deployable separately, including on Vercel, while the backend needs a server that can expose port 8000.
   - `stitch_screens/` is design/reference material, not part of runtime.

13. **Key architecture diagram takeaway**
   - The important system boundary is: **raw log sources → normalization → detection/enrichment → alert/state APIs + WebSocket → React operator console**.
   - Filebeat, upload, and synthetic replay are alternate ingress paths into the same backend event pipeline.

Main entry points: [`acds/backend/main.py`](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/main.py) (API hub), [`acds/frontend/src/App.jsx`](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/App.jsx) (App shell), [`acds/backend/normalizer.py`](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/normalizer.py) (Normalizer), [`acds/backend/detection_engine.py`](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/detection_engine.py) (Detection engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Backend"]
  node_main["API hub<br/>FastAPI app<br/>[main.py]"]
  node_config["Config<br/>[config.py]"]
  node_monitor["Log monitor<br/>ingestion<br/>[log_monitor.py]"]
  node_normalizer["Normalizer<br/>event schema<br/>[normalizer.py]"]
  node_detection["Detection engine<br/>security rules"]
  node_playbooks["Playbooks<br/>Gemini adapter"]
  node_simulator["Simulation<br/>replay engine"]
  node_loggen["Log gen<br/>synthetic source<br/>[log_generator.py]"]
  node_fakegen["Fake logs<br/>test corpus"]
  node_warp["Warp manifest<br/>replay spec"]
end

subgraph group_frontend["Frontend"]
  node_api["API client<br/>REST client<br/>[api.js]"]
  node_socket["Socket state<br/>WebSocket bridge<br/>[SocketContext.jsx]"]
  node_app["App shell<br/>React routes<br/>[App.jsx]"]
  node_sidebar["Sidebar<br/>navigation<br/>[Sidebar.jsx]"]
  node_topbar["Topbar<br/>status chrome<br/>[Topbar.jsx]"]
  node_blueprints["Blueprints<br/>incident view<br/>[Blueprints.jsx]"]
  node_threats["Threats<br/>threat view<br/>[Threats.jsx]"]
  node_intel["Intelligence<br/>MITRE/IOC view<br/>[Intelligence.jsx]"]
  node_archives["Archives<br/>history view<br/>[Archives.jsx]"]
  node_settings["Settings<br/>ops view<br/>[Settings.jsx]"]
end

subgraph group_ops["Ops & Replay"]
  node_filebeat["Filebeat<br/>collector config<br/>[filebeat.yml]"]
  node_filebeat_local["Local Filebeat<br/>collector config<br/>[local_filebeat.yml]"]
  node_samples["Sample corpus<br/>test data<br/>[sample_logs.json]"]
end

node_main -->|"reads mode/thresholds"| node_config
node_main -->|"starts/stops"| node_monitor
node_main -->|"controls replay"| node_simulator
node_main -->|"routes events"| node_normalizer
node_monitor -->|"raw logs"| node_normalizer
node_simulator -->|"simulated events"| node_normalizer
node_loggen -->|"synthetic logs"| node_normalizer
node_fakegen -->|"creates inputs"| node_loggen
node_normalizer -->|"normalized events"| node_detection
node_detection -->|"critical alerts"| node_playbooks
node_main -->|"serves alert state"| node_detection
node_main -->|"enrichment API"| node_playbooks
node_main -->|"REST endpoints"| node_api
node_main -->|"alerts stream"| node_socket
node_api -->|"data for views"| node_app
node_socket -->|"live updates"| node_app
node_app -->|"navigation"| node_sidebar
node_app -->|"status chrome"| node_topbar
node_app -->|"incident page"| node_blueprints
node_app -->|"threat page"| node_threats
node_app -->|"intelligence page"| node_intel
node_app -->|"history page"| node_archives
node_app -->|"settings page"| node_settings
node_filebeat -->|"collector input"| node_main
node_filebeat_local -->|"collector input"| node_main
node_samples -->|"replay corpus"| node_simulator

click node_main "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/main.py"
click node_config "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/config.py"
click node_monitor "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/log_monitor.py"
click node_normalizer "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/normalizer.py"
click node_detection "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/detection_engine.py"
click node_playbooks "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/playbook_generator.py"
click node_simulator "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/simulation_engine.py"
click node_loggen "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/log_generator.py"
click node_fakegen "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/generate_fake_logs.py"
click node_warp "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/generate_warp_manifest.py"
click node_api "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/api.js"
click node_socket "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/context/SocketContext.jsx"
click node_app "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/App.jsx"
click node_sidebar "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/components/Sidebar.jsx"
click node_topbar "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/components/Topbar.jsx"
click node_blueprints "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Blueprints.jsx"
click node_threats "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Threats.jsx"
click node_intel "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Intelligence.jsx"
click node_archives "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Archives.jsx"
click node_settings "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Settings.jsx"
click node_filebeat "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/filebeat.yml"
click node_filebeat_local "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/local_filebeat.yml"
click node_samples "https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/sample_logs.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_config,node_monitor,node_normalizer,node_detection,node_playbooks,node_simulator,node_loggen,node_fakegen,node_warp toneBlue
class node_api,node_socket,node_app,node_sidebar,node_topbar,node_blueprints,node_threats,node_intel,node_archives,node_settings toneAmber
class node_filebeat,node_filebeat_local,node_samples toneMint
```

## Components

### Backend

FastAPI control plane, event pipeline, and enrichment services.

- [API hub](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/main.py): FastAPI app · REST endpoints, WebSocket stream, startup and shutdown orchestration. · `acds/backend/main.py`
- [Config](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/config.py): runtime config · Mode selection and detector thresholds. · `acds/backend/config.py`
- [Log monitor](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/log_monitor.py): ingestion · Watches live events and feeds the backend pipeline. · `acds/backend/log_monitor.py`
- [Normalizer](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/normalizer.py): event schema · Converts raw logs into the internal normalized event shape. · `acds/backend/normalizer.py`
- [Detection engine](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/detection_engine.py): security rules · Brute force, beaconing, exfiltration, correlation, and whitelisting. · `acds/backend/detection_engine.py`
- [Playbooks](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/playbook_generator.py): Gemini adapter · Generates incident-response guidance for selected critical alerts. · `acds/backend/playbook_generator.py`
- [Simulation](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/simulation_engine.py): replay engine · Generates attack streams for stress tests and demos. · `acds/backend/simulation_engine.py`
- [Log gen](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/log_generator.py): synthetic source · Creates synthetic or fake log events. · `acds/backend/log_generator.py`
- [Fake logs](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/generate_fake_logs.py): test corpus · Scripted fake-log generation entrypoint. · `acds/backend/generate_fake_logs.py`
- [Warp manifest](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/generate_warp_manifest.py): replay spec · Builds manifests for attack replay scenarios. · `acds/backend/generate_warp_manifest.py`

### Frontend

React operator console and real-time dashboard.

- [API client](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/api.js): REST client · Frontend calls to backend read-model endpoints. · `acds/frontend/src/api.js`
- [Socket state](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/context/SocketContext.jsx): WebSocket bridge · Live alert and feed-status state for the UI. · `acds/frontend/src/context/SocketContext.jsx`
- [App shell](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/App.jsx): React routes · Routes between the dashboard pages. · `acds/frontend/src/App.jsx`
- [Sidebar](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/components/Sidebar.jsx): navigation · Persistent page navigation. · `acds/frontend/src/components/Sidebar.jsx`
- [Topbar](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/components/Topbar.jsx): status chrome · Global status and controls. · `acds/frontend/src/components/Topbar.jsx`
- [Blueprints](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Blueprints.jsx): incident view · Alert drill-down and playbook-assisted response. · `acds/frontend/src/pages/Blueprints.jsx`
- [Threats](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Threats.jsx): threat view · Active detector health and live threat status. · `acds/frontend/src/pages/Threats.jsx`
- [Intelligence](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Intelligence.jsx): MITRE/IOC view · ATT&CK coverage and indicator analytics. · `acds/frontend/src/pages/Intelligence.jsx`
- [Archives](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Archives.jsx): history view · Paginated historical events. · `acds/frontend/src/pages/Archives.jsx`
- [Settings](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/frontend/src/pages/Settings.jsx): ops view · Thresholds, mode selection, and runtime configuration. · `acds/frontend/src/pages/Settings.jsx`

### Ops & Replay

Filebeat setup, sample corpora, and replay/test artifacts.

- [Filebeat](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/filebeat.yml): collector config · External log collection configuration and registry state. · `acds/filebeat.yml`
- [Local Filebeat](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/local_filebeat.yml): collector config · Local Filebeat configuration for bootstrap and development. · `acds/backend/local_filebeat.yml`
- [Sample corpus](https://github.com/sathwikkbhat/acds---soc-analyst-dashboard/blob/main/acds/backend/sample_logs.json): test data · Sample logs and speed-test manifest for replay and benchmarking. · `acds/backend/sample_logs.json`

## Connections

- API hub → Config: reads mode/thresholds
- API hub → Log monitor: starts/stops
- API hub → Simulation: controls replay
- API hub → Normalizer: routes events
- Log monitor → Normalizer: raw logs
- Simulation → Normalizer: simulated events
- Log gen → Normalizer: synthetic logs
- Fake logs → Log gen: creates inputs
- Normalizer → Detection engine: normalized events
- Detection engine → Playbooks: critical alerts
- API hub → Detection engine: serves alert state
- API hub → Playbooks: enrichment API
- API hub → API client: REST endpoints
- API hub → Socket state: alerts stream
- API client → App shell: data for views
- Socket state → App shell: live updates
- App shell → Sidebar: navigation
- App shell → Topbar: status chrome
- App shell → Blueprints: incident page
- App shell → Threats: threat page
- App shell → Intelligence: intelligence page
- App shell → Archives: history page
- App shell → Settings: settings page
- Filebeat → API hub: collector input
- Local Filebeat → API hub: collector input
- Sample corpus → Simulation: replay corpus
