# le0vip3r/ssh-honeypot-soc architecture

> Architecture diagram of the GitHub repository le0vip3r/ssh-honeypot-soc, 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/le0vip3r/ssh-honeypot-soc
- Repository: https://github.com/le0vip3r/ssh-honeypot-soc

## Overview

This is a hands-on SSH honeypot SOC lab: Cowrie captures SSH activity as JSON events, which feed a live failed-login detector, an offline analyzer, and a Flask dashboard. The graph preserves those distinct capture, detection, analysis, and presentation stages, plus alert storage and the dashboard’s event and alert views. Source excerpts establish the detector and dashboard’s Docker-based Cowrie access; README documents the Cowrie event flow and local-log analysis. Cowrie and runtime data paths are documented, not repository source files.

Main entry points: [`dashboard/app.py`](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/dashboard/app.py) (Dashboard Route), [`scripts/live_detector.py`](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/scripts/live_detector.py) (Live Detector), [`scripts/analyze_logs.py`](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/scripts/analyze_logs.py) (Offline Log Analyzer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["SSH Capture"]
  node_cowrie["Cowrie Honeypot"]
  node_events["Cowrie JSON Events"]
end

subgraph group_detection["Detection"]
  node_detector["Live Detector<br/>[live_detector.py]"]
  node_threshold["Failed-Login Threshold<br/>[live_detector.py]"]
  node_alertlog[("Alert Log")]
end

subgraph group_analysis["Log Analysis"]
  node_analyzer["Offline Log Analyzer<br/>[analyze_logs.py]"]
end

subgraph group_dashboard["SOC Dashboard"]
  node_dashboardapp["Dashboard Route<br/>[app.py]"]
  node_eventsummary["Login Metrics &amp; Trends<br/>[app.py]"]
  node_eventtable["Recent Cowrie Events<br/>[app.py]"]
  node_alertview["Recent Alerts<br/>[app.py]"]
end

node_client(("SSH Client / Test Traffic"))
node_operator(("SOC Operator"))

node_client -->|"sends traffic"| node_cowrie
node_cowrie -->|"records events"| node_events
node_events -->|"streams events"| node_detector
node_detector -->|"checks attempts"| node_threshold
node_detector -->|"appends alerts"| node_alertlog
node_events -->|"reads local copy"| node_analyzer
node_dashboardapp -->|"fetches via Docker"| node_cowrie
node_dashboardapp -->|"computes metrics"| node_eventsummary
node_dashboardapp -->|"selects recent events"| node_eventtable
node_dashboardapp -->|"reads alerts"| node_alertlog
node_dashboardapp -->|"renders alerts"| node_alertview
node_eventsummary -->|"displays activity"| node_operator
node_eventtable -->|"displays events"| node_operator
node_alertview -->|"displays alerts"| node_operator

click node_detector "https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/scripts/live_detector.py"
click node_threshold "https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/scripts/live_detector.py"
click node_analyzer "https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/scripts/analyze_logs.py"
click node_dashboardapp "https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/dashboard/app.py"
click node_eventsummary "https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/dashboard/app.py"
click node_eventtable "https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/dashboard/app.py"
click node_alertview "https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/dashboard/app.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_cowrie,node_events,node_client toneBlue
class node_detector,node_threshold,node_alertlog toneAmber
class node_analyzer toneMint
class node_dashboardapp,node_eventsummary,node_eventtable,node_alertview toneRose
class node_operator toneIndigo
```

## Components

### SSH Capture

- **Cowrie Honeypot**
- **Cowrie JSON Events**

### Detection

- [Live Detector](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/scripts/live_detector.py): `scripts/live_detector.py`
- [Failed-Login Threshold](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/scripts/live_detector.py): `scripts/live_detector.py`
- **Alert Log**

### Log Analysis

- [Offline Log Analyzer](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/scripts/analyze_logs.py): `scripts/analyze_logs.py`

### SOC Dashboard

- [Dashboard Route](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/dashboard/app.py): `dashboard/app.py`
- [Login Metrics & Trends](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/dashboard/app.py): `dashboard/app.py`
- [Recent Cowrie Events](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/dashboard/app.py): `dashboard/app.py`
- [Recent Alerts](https://github.com/le0vip3r/ssh-honeypot-soc/blob/main/dashboard/app.py): `dashboard/app.py`

### Other components

- **SSH Client / Test Traffic**
- **SOC Operator**

## Connections

- SSH Client / Test Traffic → Cowrie Honeypot: sends traffic (evidence: `README.md`)
- Cowrie Honeypot → Cowrie JSON Events: records events (evidence: `README.md`)
- Cowrie JSON Events → Live Detector: streams events (evidence: `scripts/live_detector.py`)
- Live Detector → Failed-Login Threshold: checks attempts (evidence: `scripts/live_detector.py`)
- Live Detector → Alert Log: appends alerts (evidence: `scripts/live_detector.py`)
- Cowrie JSON Events → Offline Log Analyzer: reads local copy (evidence: `README.md`)
- Dashboard Route → Cowrie Honeypot: fetches via Docker (evidence: `dashboard/app.py`)
- Dashboard Route → Login Metrics & Trends: computes metrics (evidence: `dashboard/app.py`)
- Dashboard Route → Recent Cowrie Events: selects recent events (evidence: `dashboard/app.py`)
- Dashboard Route → Alert Log: reads alerts (evidence: `dashboard/app.py`)
- Dashboard Route → Recent Alerts: renders alerts (evidence: `dashboard/app.py`)
- Login Metrics & Trends → SOC Operator: displays activity (evidence: `dashboard/app.py`)
- Recent Cowrie Events → SOC Operator: displays events (evidence: `dashboard/app.py`)
- Recent Alerts → SOC Operator: displays alerts (evidence: `dashboard/app.py`)
