# subiii-007/mini-soc-detection-engine architecture

> Architecture diagram of the GitHub repository subiii-007/mini-soc-detection-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/subiii-007/mini-soc-detection-engine
- Repository: https://github.com/subiii-007/mini-soc-detection-engine

## Overview

Mini SOC Detection Engine reads SSH and Windows-style logs, applies JSON rules to produce MITRE-tagged alerts, then groups alerts by source and generates a Markdown incident report. The documented workflow is split between detector.py and report.py; the report script obtains alerts through detector.collect_alerts before correlating and formatting them. The README documents the supported detections and report capability; sampled source excerpts show the implementation and calls. Sample-log files are not listed individually in the supplied tree, so they are represented as an unpathed input.

Main entry points: [`detector.py`](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/detector.py) (SSH detection), [`report.py`](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/report.py) (Report builder), [`rules/ssh_bruteforce.json`](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/rules/ssh_bruteforce.json) (SSH rule), [`rules/windows_rules.json`](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/rules/windows_rules.json) (Windows rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Inputs and rules"]
  node_logs["Sample logs"]
  node_ssh_rules["SSH rule"]
  node_windows_rules["Windows rules<br/>[windows_rules.json]"]
end

subgraph group_detection["Detection"]
  node_ssh_detection["SSH detection<br/>[detector.py]"]
  node_windows_detection["Windows detection<br/>[detector.py]"]
  node_alert_output["Print alerts<br/>[detector.py]"]
  node_collect["Collect alerts<br/>[detector.py]"]
end

subgraph group_reporting["Correlation and reporting"]
  node_correlate["Source correlation<br/>[report.py]"]
  node_report_builder["Report builder<br/>[report.py]"]
  node_incident_report["Incident report<br/>[incident-report.md]"]
end

node_analyst(("Analyst"))

node_analyst -->|"runs detector"| node_alert_output
node_analyst -->|"runs report"| node_report_builder
node_logs -->|"reads SSH logs"| node_ssh_detection
node_logs -->|"reads Windows logs"| node_windows_detection
node_ssh_rules -->|"configures"| node_ssh_detection
node_windows_rules -->|"configures"| node_windows_detection
node_ssh_detection -->|"returns alerts"| node_alert_output
node_windows_detection -->|"returns alerts"| node_alert_output
node_ssh_detection -->|"collects alerts"| node_collect
node_windows_detection -->|"collects alerts"| node_collect
node_collect -->|"provides alerts"| node_report_builder
node_report_builder -->|"groups sources"| node_correlate
node_report_builder -->|"writes report"| node_incident_report

click node_ssh_rules "https://github.com/subiii-007/mini-soc-detection-engine/blob/main/rules/ssh_bruteforce.json"
click node_windows_rules "https://github.com/subiii-007/mini-soc-detection-engine/blob/main/rules/windows_rules.json"
click node_ssh_detection "https://github.com/subiii-007/mini-soc-detection-engine/blob/main/detector.py"
click node_windows_detection "https://github.com/subiii-007/mini-soc-detection-engine/blob/main/detector.py"
click node_alert_output "https://github.com/subiii-007/mini-soc-detection-engine/blob/main/detector.py"
click node_collect "https://github.com/subiii-007/mini-soc-detection-engine/blob/main/detector.py"
click node_correlate "https://github.com/subiii-007/mini-soc-detection-engine/blob/main/report.py"
click node_report_builder "https://github.com/subiii-007/mini-soc-detection-engine/blob/main/report.py"
click node_incident_report "https://github.com/subiii-007/mini-soc-detection-engine/blob/main/reports/incident-report.md"

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_logs,node_ssh_rules,node_windows_rules toneBlue
class node_ssh_detection,node_windows_detection,node_alert_output,node_collect toneAmber
class node_correlate,node_report_builder,node_incident_report toneMint
class node_analyst toneIndigo
```

## Components

### Inputs and rules

- **Sample logs**
- [SSH rule](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/rules/ssh_bruteforce.json): `rules/ssh_bruteforce.json`
- [Windows rules](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/rules/windows_rules.json): `rules/windows_rules.json`

### Detection

- [SSH detection](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/detector.py): `detector.py`
- [Windows detection](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/detector.py): `detector.py`
- [Print alerts](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/detector.py): `detector.py`
- [Collect alerts](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/detector.py): `detector.py`

### Correlation and reporting

- [Source correlation](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/report.py): `report.py`
- [Report builder](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/report.py): `report.py`
- [Incident report](https://github.com/subiii-007/mini-soc-detection-engine/blob/main/reports/incident-report.md): `reports/incident-report.md`

### Other components

- **Analyst**

## Connections

- Analyst → Print alerts: runs detector (evidence: `README.md`)
- Analyst → Report builder: runs report (evidence: `README.md`)
- Sample logs → SSH detection: reads SSH logs (evidence: `detector.py`)
- Sample logs → Windows detection: reads Windows logs (evidence: `detector.py`)
- SSH rule → SSH detection: configures (evidence: `detector.py`)
- Windows rules → Windows detection: configures (evidence: `detector.py`)
- SSH detection → Print alerts: returns alerts (evidence: `detector.py`)
- Windows detection → Print alerts: returns alerts (evidence: `detector.py`)
- SSH detection → Collect alerts: collects alerts (evidence: `detector.py`)
- Windows detection → Collect alerts: collects alerts (evidence: `detector.py`)
- Collect alerts → Report builder: provides alerts (evidence: `report.py`)
- Report builder → Source correlation: groups sources (evidence: `report.py`)
- Report builder → Incident report: writes report (evidence: `report.py`)
