# goutham-hegde/vigil architecture

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

- Interactive diagram: https://gitdiagram.com/goutham-hegde/vigil
- Repository: https://github.com/goutham-hegde/vigil

## Overview

Vigil is a threat-detection and attack-simulation engine paired with a SOC dashboard. Raw telemetry—either injected by the simulator or sent to the API—is converted into streaming features, scored by supervised and anomaly detectors, folded into alerts, and correlated into ATT&CK-mapped incidents with explanations and playbooks; the dashboard supports triage and simulation. The graph emphasizes documented runtime ownership and the sampled frontend flow. Several key modules are represented because the README documents their role, but their internal calls were not sampled.

Main entry points: [`vigil/detection.py`](https://github.com/goutham-hegde/vigil/blob/main/vigil/detection.py) (Detection engine), [`vigil/features.py`](https://github.com/goutham-hegde/vigil/blob/main/vigil/features.py) (Streaming features), [`vigil/train.py`](https://github.com/goutham-hegde/vigil/blob/main/vigil/train.py) (Model training), [`web/src/pages/Overview.tsx`](https://github.com/goutham-hegde/vigil/blob/main/web/src/pages/Overview.tsx) (SOC views)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_engine["Detection engine"]
  node_event["Raw events<br/>[schema.py]"]
  node_features["Streaming features<br/>[features.py]"]
  node_environment["Asset context<br/>[environment.py]"]
  node_classifier["Threat classifier<br/>[model.py]"]
  node_train["Model training<br/>[train.py]"]
  node_detection["Detection engine<br/>[detection.py]"]
  node_alerts["Alert management<br/>[detection.py]"]
  node_incidents["Incident correlation<br/>[detection.py]"]
  node_playbooks["Response playbooks<br/>[playbooks.py]"]
end

subgraph group_simulation["Simulation and data"]
  node_simulator["Attack simulator<br/>[simulator.py]"]
  node_lanl["LANL data<br/>[lanl.py]"]
end

subgraph group_api["API and dashboard"]
  node_runtime["Runtime orchestration<br/>[runtime.py]"]
  node_api_backend["HTTP and SSE API<br/>[api.py]"]
  node_browser["SOC dashboard<br/>[App.tsx]"]
  node_store["Dashboard state<br/>[store.ts]"]
  node_api_client["API client<br/>[api.ts]"]
  node_pages["SOC views<br/>[Overview.tsx]"]
  node_charts["Security visualizations<br/>[charts.tsx]"]
  node_security_ui["Security components<br/>[security.tsx]"]
end

node_analyst(("SOC analyst"))
node_sensor(("Telemetry source"))

node_sensor -.->|"submits telemetry"| node_api_backend
node_simulator -->|"generates events"| node_event
node_event -->|"extracts features"| node_features
node_features -->|"uses asset roles"| node_environment
node_features -->|"scores vectors"| node_classifier
node_train -->|"replays telemetry"| node_simulator
node_train -->|"trains on features"| node_features
node_train -->|"fits model"| node_classifier
node_detection -->|"extracts features"| node_features
node_detection -->|"scores events"| node_classifier
node_detection -->|"folds detections"| node_alerts
node_detection -->|"correlates alerts"| node_incidents
node_alerts -->|"adds guidance"| node_playbooks
node_runtime -->|"runs campaigns"| node_simulator
node_runtime -->|"processes events"| node_detection
node_api_backend -->|"controls engine"| node_runtime
node_browser -->|"bootstraps state"| node_store
node_browser -->|"renders views"| node_pages
node_store -->|"fetches and streams"| node_api_client
node_api_client -->|"calls endpoints"| node_api_backend
node_analyst -->|"triages and simulates"| node_browser
node_pages -->|"renders metrics"| node_charts
node_pages -->|"renders security UI"| node_security_ui
node_lanl -.->|"supplies evaluation data"| node_train

click node_event "https://github.com/goutham-hegde/vigil/blob/main/vigil/schema.py"
click node_features "https://github.com/goutham-hegde/vigil/blob/main/vigil/features.py"
click node_environment "https://github.com/goutham-hegde/vigil/blob/main/vigil/environment.py"
click node_classifier "https://github.com/goutham-hegde/vigil/blob/main/vigil/model.py"
click node_train "https://github.com/goutham-hegde/vigil/blob/main/vigil/train.py"
click node_detection "https://github.com/goutham-hegde/vigil/blob/main/vigil/detection.py"
click node_alerts "https://github.com/goutham-hegde/vigil/blob/main/vigil/detection.py"
click node_incidents "https://github.com/goutham-hegde/vigil/blob/main/vigil/detection.py"
click node_playbooks "https://github.com/goutham-hegde/vigil/blob/main/vigil/playbooks.py"
click node_simulator "https://github.com/goutham-hegde/vigil/blob/main/vigil/simulator.py"
click node_lanl "https://github.com/goutham-hegde/vigil/blob/main/vigil/data/lanl.py"
click node_runtime "https://github.com/goutham-hegde/vigil/blob/main/vigil/runtime.py"
click node_api_backend "https://github.com/goutham-hegde/vigil/blob/main/vigil/api.py"
click node_browser "https://github.com/goutham-hegde/vigil/blob/main/web/src/App.tsx"
click node_store "https://github.com/goutham-hegde/vigil/blob/main/web/src/lib/store.ts"
click node_api_client "https://github.com/goutham-hegde/vigil/blob/main/web/src/lib/api.ts"
click node_pages "https://github.com/goutham-hegde/vigil/blob/main/web/src/pages/Overview.tsx"
click node_charts "https://github.com/goutham-hegde/vigil/blob/main/web/src/components/charts.tsx"
click node_security_ui "https://github.com/goutham-hegde/vigil/blob/main/web/src/components/security.tsx"

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_event,node_features,node_environment,node_classifier,node_train,node_detection,node_alerts,node_incidents,node_playbooks toneBlue
class node_simulator,node_lanl toneAmber
class node_runtime,node_api_backend,node_browser,node_store,node_api_client,node_pages,node_charts,node_security_ui toneMint
class node_analyst,node_sensor toneIndigo
```

## Components

### Detection engine

- [Raw events](https://github.com/goutham-hegde/vigil/blob/main/vigil/schema.py): `vigil/schema.py`
- [Streaming features](https://github.com/goutham-hegde/vigil/blob/main/vigil/features.py): `vigil/features.py`
- [Asset context](https://github.com/goutham-hegde/vigil/blob/main/vigil/environment.py): `vigil/environment.py`
- [Threat classifier](https://github.com/goutham-hegde/vigil/blob/main/vigil/model.py): `vigil/model.py`
- [Model training](https://github.com/goutham-hegde/vigil/blob/main/vigil/train.py): `vigil/train.py`
- [Detection engine](https://github.com/goutham-hegde/vigil/blob/main/vigil/detection.py): `vigil/detection.py`
- [Alert management](https://github.com/goutham-hegde/vigil/blob/main/vigil/detection.py): `vigil/detection.py`
- [Incident correlation](https://github.com/goutham-hegde/vigil/blob/main/vigil/detection.py): `vigil/detection.py`
- [Response playbooks](https://github.com/goutham-hegde/vigil/blob/main/vigil/playbooks.py): `vigil/playbooks.py`

### Simulation and data

- [Attack simulator](https://github.com/goutham-hegde/vigil/blob/main/vigil/simulator.py): `vigil/simulator.py`
- [LANL data](https://github.com/goutham-hegde/vigil/blob/main/vigil/data/lanl.py): `vigil/data/lanl.py`

### API and dashboard

- [Runtime orchestration](https://github.com/goutham-hegde/vigil/blob/main/vigil/runtime.py): `vigil/runtime.py`
- [HTTP and SSE API](https://github.com/goutham-hegde/vigil/blob/main/vigil/api.py): `vigil/api.py`
- [SOC dashboard](https://github.com/goutham-hegde/vigil/blob/main/web/src/App.tsx): `web/src/App.tsx`
- [Dashboard state](https://github.com/goutham-hegde/vigil/blob/main/web/src/lib/store.ts): `web/src/lib/store.ts`
- [API client](https://github.com/goutham-hegde/vigil/blob/main/web/src/lib/api.ts): `web/src/lib/api.ts`
- [SOC views](https://github.com/goutham-hegde/vigil/blob/main/web/src/pages/Overview.tsx): `web/src/pages/Overview.tsx`
- [Security visualizations](https://github.com/goutham-hegde/vigil/blob/main/web/src/components/charts.tsx): `web/src/components/charts.tsx`
- [Security components](https://github.com/goutham-hegde/vigil/blob/main/web/src/components/security.tsx): `web/src/components/security.tsx`

### Other components

- **SOC analyst**
- **Telemetry source**

## Connections

- Telemetry source → HTTP and SSE API: submits telemetry (evidence: `README.md`)
- Attack simulator → Raw events: generates events (evidence: `README.md`)
- Raw events → Streaming features: extracts features (evidence: `vigil/features.py`)
- Streaming features → Asset context: uses asset roles (evidence: `vigil/features.py`)
- Streaming features → Threat classifier: scores vectors (evidence: `vigil/model.py`)
- Model training → Attack simulator: replays telemetry (evidence: `vigil/train.py`)
- Model training → Streaming features: trains on features (evidence: `vigil/train.py`)
- Model training → Threat classifier: fits model (evidence: `vigil/train.py`)
- Detection engine → Streaming features: extracts features (evidence: `vigil/detection.py`)
- Detection engine → Threat classifier: scores events (evidence: `vigil/detection.py`)
- Detection engine → Alert management: folds detections (evidence: `vigil/detection.py`)
- Detection engine → Incident correlation: correlates alerts (evidence: `README.md`)
- Alert management → Response playbooks: adds guidance (evidence: `README.md`)
- Runtime orchestration → Attack simulator: runs campaigns (evidence: `vigil/runtime.py`)
- Runtime orchestration → Detection engine: processes events (evidence: `vigil/runtime.py`)
- HTTP and SSE API → Runtime orchestration: controls engine (evidence: `vigil/api.py`)
- SOC dashboard → Dashboard state: bootstraps state (evidence: `web/src/App.tsx`)
- SOC dashboard → SOC views: renders views (evidence: `web/src/App.tsx`)
- Dashboard state → API client: fetches and streams (evidence: `web/src/lib/store.ts`)
- API client → HTTP and SSE API: calls endpoints (evidence: `web/src/lib/api.ts`)
- SOC analyst → SOC dashboard: triages and simulates (evidence: `README.md`)
- SOC views → Security visualizations: renders metrics (evidence: `web/src/pages/Overview.tsx`)
- SOC views → Security components: renders security UI (evidence: `web/src/pages/Overview.tsx`)
- LANL data → Model training: supplies evaluation data (evidence: `README.md`)
