# kasusathvikamary/mitm-sentinel architecture

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

- Interactive diagram: https://gitdiagram.com/kasusathvikamary/mitm-sentinel
- Repository: https://github.com/kasusathvikamary/mitm-sentinel

## Overview

MITM Sentinel monitors live or synthetic network traffic, normalizes packets, checks them against four threat detectors, and can apply threat-specific countermeasures. Alerts are recorded and sent to desktop, webhook, and dashboard consumers. The CLI exposes monitoring, status, and simulation; the dashboard provides state and alert views, live telemetry, simulation controls, and a defense toggle. The graph includes documented detection and defense capabilities, including modules whose source was not sampled. Connections without direct excerpt evidence rely on README statements or are marked unverified.

Main entry points: [`src/core/engine.py`](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/engine.py) (Sentinel Engine), [`src/web/app.py`](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/web/app.py) (Dashboard API), [`src/alerts/alert_manager.py`](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/alerts/alert_manager.py) (Alert Manager), [`src/core/packet_capture.py`](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/packet_capture.py) (Packet Capture)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry Points"]
  node_cli["CLI Commands<br/>[main.py]"]
  node_engine["Sentinel Engine<br/>[engine.py]"]
end

subgraph group_ingest["Capture And State"]
  node_capture["Packet Capture<br/>[packet_capture.py]"]
  node_state[("Network State<br/>[network_state.py]")]
  node_eventbus["Event Bus<br/>[event_bus.py]"]
end

subgraph group_detect["Threat Detection"]
  node_arpdet["ARP Detector"]
  node_dnsdet["DNS Detector"]
  node_ssldet["TLS Detector"]
  node_gatewaydet["Gateway Detector"]
end

subgraph group_respond["Response And Alerts"]
  node_arpdef["ARP Immunity<br/>[arp_immunity.py]"]
  node_firewall["Host Quarantine"]
  node_dnsdef["DNS Enforcement"]
  node_killer["Connection Killer"]
  node_alerts["Alert Manager<br/>[alert_manager.py]"]
  node_desktop["Desktop Notifier"]
  node_logger["Audit Logger<br/>[logger.py]"]
  node_webhook["Webhook Notifier"]
end

subgraph group_dashboard["Dashboard And Simulation"]
  node_webapp["Dashboard API<br/>[app.py]"]
  node_webui["Dashboard UI<br/>[app.js]"]
  node_simulator["Attack Simulator"]
end

node_operator(("Operator"))
node_network(("Network Traffic"))
node_external_dns(("DoH Resolvers"))
node_webhook_service(("Webhook Service"))

node_operator -->|"runs command"| node_cli
node_cli -->|"creates engine"| node_engine
node_cli -->|"runs simulation"| node_simulator
node_network -->|"provides traffic"| node_capture
node_engine -->|"configures callback"| node_capture
node_capture -->|"feeds packets"| node_engine
node_engine -->|"tracks baseline"| node_state
node_engine -->|"publishes events"| node_eventbus
node_engine -->|"runs analysis"| node_arpdet
node_engine -->|"runs analysis"| node_dnsdet
node_engine -->|"runs analysis"| node_ssldet
node_engine -->|"runs analysis"| node_gatewaydet
node_arpdet -->|"checks mappings"| node_state
node_engine -->|"executes response"| node_arpdef
node_engine -->|"executes response"| node_firewall
node_engine -->|"executes response"| node_dnsdef
node_engine -->|"executes response"| node_killer
node_arpdef -->|"updates ARP table"| node_state
node_dnsdef -.->|"uses DoH fallback"| node_external_dns
node_engine -.->|"dispatches alerts"| node_alerts
node_alerts -->|"writes audit trail"| node_logger
node_alerts -->|"notifies desktop"| node_desktop
node_alerts -->|"sends alert"| node_webhook
node_webhook -->|"posts alert"| node_webhook_service
node_alerts -->|"publishes alert"| node_eventbus
node_webapp -->|"subscribes events"| node_eventbus
node_eventbus -->|"broadcasts telemetry"| node_webapp
node_webapp -->|"serves state"| node_state
node_webapp -->|"serves history"| node_alerts
node_webapp -->|"triggers scenarios"| node_simulator
node_simulator -->|"feeds packets"| node_capture
node_operator -->|"opens dashboard"| node_webapp
node_webapp -->|"serves interface"| node_webui

click node_cli "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/main.py"
click node_engine "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/engine.py"
click node_capture "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/packet_capture.py"
click node_state "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/network_state.py"
click node_eventbus "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/event_bus.py"
click node_arpdet "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/detectors/arp_spoof_detector.py"
click node_dnsdet "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/detectors/dns_spoof_detector.py"
click node_ssldet "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/detectors/ssl_tamper_detector.py"
click node_gatewaydet "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/detectors/rogue_gateway_detector.py"
click node_arpdef "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/defense/arp_immunity.py"
click node_firewall "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/defense/firewall_blocker.py"
click node_dnsdef "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/defense/dns_sec_enforcer.py"
click node_killer "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/defense/connection_killer.py"
click node_alerts "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/alerts/alert_manager.py"
click node_desktop "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/alerts/desktop_notifier.py"
click node_logger "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/alerts/logger.py"
click node_webhook "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/alerts/webhook_notifier.py"
click node_webapp "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/web/app.py"
click node_webui "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/web/static/app.js"
click node_simulator "https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/simulator/attack_simulator.py"

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_cli,node_engine toneBlue
class node_capture,node_state,node_eventbus toneAmber
class node_arpdet,node_dnsdet,node_ssldet,node_gatewaydet,node_webhook_service toneMint
class node_arpdef,node_firewall,node_dnsdef,node_killer,node_alerts,node_desktop,node_logger,node_webhook toneRose
class node_webapp,node_webui,node_simulator,node_operator,node_network,node_external_dns toneIndigo
```

## Components

### Entry Points

- [CLI Commands](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/main.py): `src/main.py`
- [Sentinel Engine](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/engine.py): `src/core/engine.py`

### Capture And State

- [Packet Capture](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/packet_capture.py): `src/core/packet_capture.py`
- [Network State](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/network_state.py): `src/core/network_state.py`
- [Event Bus](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/core/event_bus.py): `src/core/event_bus.py`

### Threat Detection

- [ARP Detector](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/detectors/arp_spoof_detector.py): `src/detectors/arp_spoof_detector.py`
- [DNS Detector](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/detectors/dns_spoof_detector.py): `src/detectors/dns_spoof_detector.py`
- [TLS Detector](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/detectors/ssl_tamper_detector.py): `src/detectors/ssl_tamper_detector.py`
- [Gateway Detector](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/detectors/rogue_gateway_detector.py): `src/detectors/rogue_gateway_detector.py`

### Response And Alerts

- [ARP Immunity](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/defense/arp_immunity.py): `src/defense/arp_immunity.py`
- [Host Quarantine](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/defense/firewall_blocker.py): `src/defense/firewall_blocker.py`
- [DNS Enforcement](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/defense/dns_sec_enforcer.py): `src/defense/dns_sec_enforcer.py`
- [Connection Killer](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/defense/connection_killer.py): `src/defense/connection_killer.py`
- [Alert Manager](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/alerts/alert_manager.py): `src/alerts/alert_manager.py`
- [Desktop Notifier](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/alerts/desktop_notifier.py): `src/alerts/desktop_notifier.py`
- [Audit Logger](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/alerts/logger.py): `src/alerts/logger.py`
- [Webhook Notifier](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/alerts/webhook_notifier.py): `src/alerts/webhook_notifier.py`

### Dashboard And Simulation

- [Dashboard API](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/web/app.py): `src/web/app.py`
- [Dashboard UI](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/web/static/app.js): `src/web/static/app.js`
- [Attack Simulator](https://github.com/kasusathvikamary/mitm-sentinel/blob/main/src/simulator/attack_simulator.py): `src/simulator/attack_simulator.py`

### Other components

- **Operator**
- **Network Traffic**
- **DoH Resolvers**
- **Webhook Service**

## Connections

- Operator → CLI Commands: runs command (evidence: `src/main.py`)
- CLI Commands → Sentinel Engine: creates engine (evidence: `src/main.py`)
- CLI Commands → Attack Simulator: runs simulation (evidence: `src/main.py`)
- Network Traffic → Packet Capture: provides traffic (evidence: `README.md`)
- Sentinel Engine → Packet Capture: configures callback (evidence: `src/core/engine.py`)
- Packet Capture → Sentinel Engine: feeds packets (evidence: `src/core/engine.py`)
- Sentinel Engine → Network State: tracks baseline (evidence: `src/core/engine.py`)
- Sentinel Engine → Event Bus: publishes events (evidence: `src/core/engine.py`)
- Sentinel Engine → ARP Detector: runs analysis (evidence: `src/core/engine.py`)
- Sentinel Engine → DNS Detector: runs analysis (evidence: `src/core/engine.py`)
- Sentinel Engine → TLS Detector: runs analysis (evidence: `src/core/engine.py`)
- Sentinel Engine → Gateway Detector: runs analysis (evidence: `src/core/engine.py`)
- ARP Detector → Network State: checks mappings (evidence: `src/detectors/arp_spoof_detector.py`)
- Sentinel Engine → ARP Immunity: executes response (evidence: `src/core/engine.py`)
- Sentinel Engine → Host Quarantine: executes response (evidence: `src/core/engine.py`)
- Sentinel Engine → DNS Enforcement: executes response (evidence: `src/core/engine.py`)
- Sentinel Engine → Connection Killer: executes response (evidence: `src/core/engine.py`)
- ARP Immunity → Network State: updates ARP table (evidence: `src/defense/arp_immunity.py`)
- DNS Enforcement → DoH Resolvers: uses DoH fallback (evidence: `README.md`)
- Sentinel Engine → Alert Manager: dispatches alerts (evidence: `src/core/engine.py`)
- Alert Manager → Audit Logger: writes audit trail (evidence: `src/alerts/alert_manager.py`)
- Alert Manager → Desktop Notifier: notifies desktop (evidence: `src/alerts/alert_manager.py`)
- Alert Manager → Webhook Notifier: sends alert (evidence: `src/alerts/alert_manager.py`)
- Webhook Notifier → Webhook Service: posts alert (evidence: `src/alerts/webhook_notifier.py`)
- Alert Manager → Event Bus: publishes alert (evidence: `src/alerts/alert_manager.py`)
- Dashboard API → Event Bus: subscribes events (evidence: `src/web/app.py`)
- Event Bus → Dashboard API: broadcasts telemetry (evidence: `src/web/app.py`)
- Dashboard API → Network State: serves state (evidence: `src/web/app.py`)
- Dashboard API → Alert Manager: serves history (evidence: `src/web/app.py`)
- Dashboard API → Attack Simulator: triggers scenarios (evidence: `src/web/app.py`)
- Attack Simulator → Packet Capture: feeds packets (evidence: `src/simulator/attack_simulator.py`)
- Operator → Dashboard API: opens dashboard (evidence: `README.md`)
- Dashboard API → Dashboard UI: serves interface (evidence: `README.md`)
