# blackdeath-1708/odin-king-of-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/blackdeath-1708/odin-king-of-analysis
- Repository: https://github.com/blackdeath-1708/odin-king-of-analysis

## Overview

NTRO Unidirectional Threat Monitoring is a passive, real-time threat-detection pipeline with a live evidence-backed dashboard. Its principal workflow turns Zeek traffic metadata into normalized events, applies six threat detectors, correlates alerts, persists them, and exposes them through an API to the dashboard. The graph includes the documented ingest and detection stages, correlation, exports, and dashboard capabilities. Some internal wiring and optional integrations are only documented at the README level; edges use that evidence where available.

Main entry points: [`frontend/src/App.jsx`](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/App.jsx) (React Dashboard), [`backend/stream_consumer.py`](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/stream_consumer.py) (Stream Consumer), [`frontend/src/pages/ArchitecturePage.jsx`](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/ArchitecturePage.jsx) (Architecture View), [`backend/detectors`](https://github.com/blackdeath-1708/odin-king-of-analysis/tree/main/backend/detectors) (Six Detectors)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Traffic Ingest"]
  node_zeek["Zeek"]
  node_producer["Kafka Producer<br/>[kafka_producer.py]"]
  node_kafka["Kafka"]
end

subgraph group_detection["Threat Detection"]
  node_consumer["Stream Consumer<br/>[stream_consumer.py]"]
  node_detectors["Six Detectors"]
  node_features["Feature Utilities<br/>[features.py]"]
  node_tls_tier2["TLS Tier-2 Model<br/>[tier2_model.py]"]
  node_correlator["Alert Correlator<br/>[correlator.py]"]
  node_baseline["Adaptive Baseline<br/>[baseline.py]"]
end

subgraph group_alerts["Alerts and Evidence"]
  node_alert_store[("Alert Log")]
  node_forensic["Forensic Chain<br/>[forensic_chain.py]"]
  node_exporter["Alert Export<br/>[alert_export.py]"]
end

subgraph group_service["API Service"]
  node_api["Flask API<br/>[app.py]"]
end

subgraph group_dashboard["Dashboard"]
  node_app["React Dashboard<br/>[App.jsx]"]
  node_alerts_page["Alert Views<br/>[AlertsPage.jsx]"]
  node_alert_feed["Alert Feed<br/>[AlertFeed.jsx]"]
  node_correlation_page["Correlation View"]
  node_export_page["Export View<br/>[ExportPage.jsx]"]
  node_architecture_page["Architecture View"]
  node_pipeline_status["Pipeline Status<br/>[PipelineStatus.jsx]"]
  node_pipeline_stages["Pipeline Stages<br/>[pipelineStages.js]"]
  node_threat_matrix["Threat Coverage<br/>[threatMatrix.js]"]
  node_analytics_page["Analytics View<br/>[AnalyticsPage.jsx]"]
  node_model_page["Model Performance"]
end

node_network(("Mirrored Traffic"))
node_browser(("Dashboard User"))

node_network -->|"observes"| node_zeek
node_zeek -->|"writes logs"| node_producer
node_producer -->|"publishes events"| node_kafka
node_kafka -->|"delivers events"| node_consumer
node_consumer -->|"dispatches events"| node_detectors
node_consumer -->|"submits alerts"| node_correlator
node_correlator -->|"checks rates"| node_baseline
node_detectors -.->|"uses features"| node_features
node_detectors -->|"scores ambiguous flows"| node_tls_tier2
node_consumer -->|"appends alerts"| node_alert_store
node_consumer -->|"records evidence"| node_forensic
node_consumer -->|"writes exports"| node_exporter
node_alert_store -->|"reads alerts"| node_api
node_api -->|"builds STIX bundles"| node_exporter
node_browser -->|"views dashboard"| node_app
node_app -->|"polls and streams"| node_api
node_app -->|"renders page"| node_alerts_page
node_alerts_page -->|"renders feed"| node_alert_feed
node_app -->|"renders page"| node_correlation_page
node_app -->|"renders page"| node_export_page
node_app -->|"renders page"| node_architecture_page
node_architecture_page -->|"reads stages"| node_pipeline_stages
node_architecture_page -->|"renders status"| node_pipeline_status
node_architecture_page -->|"shows coverage"| node_threat_matrix
node_app -->|"renders page"| node_analytics_page
node_app -->|"renders page"| node_model_page

click node_producer "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/kafka_producer.py"
click node_consumer "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/stream_consumer.py"
click node_detectors "https://github.com/blackdeath-1708/odin-king-of-analysis/tree/main/backend/detectors"
click node_features "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/detectors/features.py"
click node_tls_tier2 "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/detectors/tier2_model.py"
click node_correlator "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/correlation/correlator.py"
click node_baseline "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/correlation/baseline.py"
click node_forensic "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/forensic_chain.py"
click node_exporter "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/alert_export.py"
click node_api "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/app.py"
click node_app "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/App.jsx"
click node_alerts_page "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/AlertsPage.jsx"
click node_alert_feed "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/components/AlertFeed.jsx"
click node_correlation_page "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/CorrelationPage.jsx"
click node_export_page "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/ExportPage.jsx"
click node_architecture_page "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/ArchitecturePage.jsx"
click node_pipeline_status "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/components/PipelineStatus.jsx"
click node_pipeline_stages "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/data/pipelineStages.js"
click node_threat_matrix "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/data/threatMatrix.js"
click node_analytics_page "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/AnalyticsPage.jsx"
click node_model_page "https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/ModelPerformancePage.jsx"

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_zeek,node_producer,node_kafka,node_browser toneBlue
class node_consumer,node_detectors,node_features,node_tls_tier2,node_correlator,node_baseline toneAmber
class node_alert_store,node_forensic,node_exporter toneMint
class node_api toneRose
class node_app,node_alerts_page,node_alert_feed,node_correlation_page,node_export_page,node_architecture_page,node_pipeline_status,node_pipeline_stages,node_threat_matrix,node_analytics_page,node_model_page,node_network toneIndigo
```

## Components

### Traffic Ingest

- **Zeek**
- [Kafka Producer](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/kafka_producer.py): `backend/kafka_producer.py`
- **Kafka**

### Threat Detection

- [Stream Consumer](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/stream_consumer.py): `backend/stream_consumer.py`
- [Six Detectors](https://github.com/blackdeath-1708/odin-king-of-analysis/tree/main/backend/detectors): `backend/detectors`
- [Feature Utilities](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/detectors/features.py): `backend/detectors/features.py`
- [TLS Tier-2 Model](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/detectors/tier2_model.py): `backend/detectors/tier2_model.py`
- [Alert Correlator](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/correlation/correlator.py): `backend/correlation/correlator.py`
- [Adaptive Baseline](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/correlation/baseline.py): `backend/correlation/baseline.py`

### Alerts and Evidence

- **Alert Log**
- [Forensic Chain](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/forensic_chain.py): `backend/forensic_chain.py`
- [Alert Export](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/alert_export.py): `backend/alert_export.py`

### API Service

- [Flask API](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/backend/app.py): `backend/app.py`

### Dashboard

- [React Dashboard](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Alert Views](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/AlertsPage.jsx): `frontend/src/pages/AlertsPage.jsx`
- [Alert Feed](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/components/AlertFeed.jsx): `frontend/src/components/AlertFeed.jsx`
- [Correlation View](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/CorrelationPage.jsx): `frontend/src/pages/CorrelationPage.jsx`
- [Export View](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/ExportPage.jsx): `frontend/src/pages/ExportPage.jsx`
- [Architecture View](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/ArchitecturePage.jsx): `frontend/src/pages/ArchitecturePage.jsx`
- [Pipeline Status](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/components/PipelineStatus.jsx): `frontend/src/components/PipelineStatus.jsx`
- [Pipeline Stages](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/data/pipelineStages.js): `frontend/src/data/pipelineStages.js`
- [Threat Coverage](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/data/threatMatrix.js): `frontend/src/data/threatMatrix.js`
- [Analytics View](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/AnalyticsPage.jsx): `frontend/src/pages/AnalyticsPage.jsx`
- [Model Performance](https://github.com/blackdeath-1708/odin-king-of-analysis/blob/main/frontend/src/pages/ModelPerformancePage.jsx): `frontend/src/pages/ModelPerformancePage.jsx`

### Other components

- **Mirrored Traffic**
- **Dashboard User**

## Connections

- Mirrored Traffic → Zeek: observes
- Zeek → Kafka Producer: writes logs
- Kafka Producer → Kafka: publishes events
- Kafka → Stream Consumer: delivers events
- Stream Consumer → Six Detectors: dispatches events (evidence: `backend/stream_consumer.py`)
- Stream Consumer → Alert Correlator: submits alerts (evidence: `backend/stream_consumer.py`)
- Alert Correlator → Adaptive Baseline: checks rates (evidence: `backend/correlation/correlator.py`)
- Six Detectors → Feature Utilities: uses features (evidence: `backend/detectors/ddos.py`)
- Six Detectors → TLS Tier-2 Model: scores ambiguous flows (evidence: `backend/detectors/tls_malware.py`)
- Stream Consumer → Alert Log: appends alerts
- Stream Consumer → Forensic Chain: records evidence (evidence: `backend/stream_consumer.py`)
- Stream Consumer → Alert Export: writes exports (evidence: `backend/stream_consumer.py`)
- Alert Log → Flask API: reads alerts
- Flask API → Alert Export: builds STIX bundles (evidence: `backend/app.py`)
- Dashboard User → React Dashboard: views dashboard
- React Dashboard → Flask API: polls and streams (evidence: `frontend/src/App.jsx`)
- React Dashboard → Alert Views: renders page (evidence: `frontend/src/App.jsx`)
- Alert Views → Alert Feed: renders feed (evidence: `frontend/src/pages/AlertsPage.jsx`)
- React Dashboard → Correlation View: renders page (evidence: `frontend/src/App.jsx`)
- React Dashboard → Export View: renders page (evidence: `frontend/src/App.jsx`)
- React Dashboard → Architecture View: renders page (evidence: `frontend/src/App.jsx`)
- Architecture View → Pipeline Stages: reads stages (evidence: `frontend/src/pages/ArchitecturePage.jsx`)
- Architecture View → Pipeline Status: renders status (evidence: `frontend/src/pages/ArchitecturePage.jsx`)
- Architecture View → Threat Coverage: shows coverage (evidence: `frontend/src/pages/ArchitecturePage.jsx`)
- React Dashboard → Analytics View: renders page (evidence: `frontend/src/App.jsx`)
- React Dashboard → Model Performance: renders page (evidence: `frontend/src/App.jsx`)
