# mugheeskhan5/detection-engineering architecture

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

- Interactive diagram: https://gitdiagram.com/mugheeskhan5/detection-engineering
- Repository: https://github.com/mugheeskhan5/detection-engineering

## Overview

This repository implements a detection-engineering workflow: trigger selected ATT&CK techniques on a Windows lab VM, check and convert their Sigma rules, query recent Elasticsearch telemetry, write verdict reports, and render an ATT&CK Navigator heatmap. The README documents telemetry collection and the lab topology; the sampled pipeline shows the execution and report-generation logic. The graph preserves the documented telemetry and visualization capabilities, but does not map unsampled workflow internals or claim that GitHub Actions implements a specific call path.

Main entry points: [`scripts/pipeline.py`](https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py) (Pipeline runner), [`rules`](https://github.com/mugheeskhan5/detection-engineering/tree/main/rules) (Sigma rules), [`heatmap_layer.json`](https://github.com/mugheeskhan5/detection-engineering/blob/main/heatmap_layer.json) (ATT&CK heatmap)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lab["Lab telemetry"]
  node_windows["Windows VM"]
  node_sysmon["Sysmon logs"]
  node_winlogbeat["Winlogbeat"]
  node_elasticsearch[("Elasticsearch")]
end

subgraph group_detection["Detection pipeline"]
  node_runner["Pipeline runner<br/>[pipeline.py]"]
  node_trigger["Technique trigger<br/>[pipeline.py]"]
  node_rules["Sigma rules"]
  node_lint["Rule linting<br/>[pipeline.py]"]
  node_validation["Rule validation<br/>[pipeline.py]"]
  node_conversion["Sigma conversion<br/>[pipeline.py]"]
  node_query["Telemetry query<br/>[pipeline.py]"]
end

subgraph group_coverage["Coverage outputs"]
  node_report["Verdict reports<br/>[pipeline.py]"]
  node_latest["Latest verdicts<br/>[pipeline.py]"]
  node_heatmap["ATT&amp;CK heatmap<br/>[heatmap_layer.json]"]
end

node_engineer(("Detection engineer"))

node_engineer -->|"starts pipeline"| node_runner
node_runner -->|"calls trigger"| node_trigger
node_trigger -->|"runs commands"| node_windows
node_windows -->|"generates events"| node_sysmon
node_sysmon -->|"collects logs"| node_winlogbeat
node_winlogbeat -->|"ships telemetry"| node_elasticsearch
node_runner -->|"calls lint"| node_lint
node_runner -->|"calls validation"| node_validation
node_runner -->|"calls conversion"| node_conversion
node_rules -->|"checks rule"| node_lint
node_rules -->|"reads rule"| node_validation
node_rules -->|"converts rule"| node_conversion
node_runner -->|"calls query"| node_query
node_conversion -->|"supplies query"| node_query
node_query -->|"searches events"| node_elasticsearch
node_runner -->|"writes verdict"| node_report
node_runner -->|"loads reports"| node_latest
node_latest -->|"reads latest"| node_report
node_runner -->|"writes layer"| node_heatmap

click node_runner "https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py"
click node_trigger "https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py"
click node_rules "https://github.com/mugheeskhan5/detection-engineering/tree/main/rules"
click node_lint "https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py"
click node_validation "https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py"
click node_conversion "https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py"
click node_query "https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py"
click node_report "https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py"
click node_latest "https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py"
click node_heatmap "https://github.com/mugheeskhan5/detection-engineering/blob/main/heatmap_layer.json"

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_windows,node_sysmon,node_winlogbeat,node_elasticsearch toneBlue
class node_runner,node_trigger,node_rules,node_lint,node_validation,node_conversion,node_query toneAmber
class node_report,node_latest,node_heatmap toneMint
class node_engineer toneIndigo
```

## Components

### Lab telemetry

- **Windows VM**
- **Sysmon logs**
- **Winlogbeat**
- **Elasticsearch**

### Detection pipeline

- [Pipeline runner](https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py): `scripts/pipeline.py`
- [Technique trigger](https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py): `scripts/pipeline.py`
- [Sigma rules](https://github.com/mugheeskhan5/detection-engineering/tree/main/rules): `rules`
- [Rule linting](https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py): `scripts/pipeline.py`
- [Rule validation](https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py): `scripts/pipeline.py`
- [Sigma conversion](https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py): `scripts/pipeline.py`
- [Telemetry query](https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py): `scripts/pipeline.py`

### Coverage outputs

- [Verdict reports](https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py): `scripts/pipeline.py`
- [Latest verdicts](https://github.com/mugheeskhan5/detection-engineering/blob/main/scripts/pipeline.py): `scripts/pipeline.py`
- [ATT&CK heatmap](https://github.com/mugheeskhan5/detection-engineering/blob/main/heatmap_layer.json): `heatmap_layer.json`

### Other components

- **Detection engineer**

## Connections

- Detection engineer → Pipeline runner: starts pipeline (evidence: `README.md`)
- Pipeline runner → Technique trigger: calls trigger (evidence: `scripts/pipeline.py`)
- Technique trigger → Windows VM: runs commands (evidence: `scripts/pipeline.py`)
- Windows VM → Sysmon logs: generates events (evidence: `README.md`)
- Sysmon logs → Winlogbeat: collects logs (evidence: `README.md`)
- Winlogbeat → Elasticsearch: ships telemetry (evidence: `README.md`)
- Pipeline runner → Rule linting: calls lint (evidence: `scripts/pipeline.py`)
- Pipeline runner → Rule validation: calls validation (evidence: `scripts/pipeline.py`)
- Pipeline runner → Sigma conversion: calls conversion (evidence: `scripts/pipeline.py`)
- Sigma rules → Rule linting: checks rule (evidence: `scripts/pipeline.py`)
- Sigma rules → Rule validation: reads rule (evidence: `scripts/pipeline.py`)
- Sigma rules → Sigma conversion: converts rule (evidence: `scripts/pipeline.py`)
- Pipeline runner → Telemetry query: calls query (evidence: `scripts/pipeline.py`)
- Sigma conversion → Telemetry query: supplies query (evidence: `scripts/pipeline.py`)
- Telemetry query → Elasticsearch: searches events (evidence: `scripts/pipeline.py`)
- Pipeline runner → Verdict reports: writes verdict (evidence: `scripts/pipeline.py`)
- Pipeline runner → Latest verdicts: loads reports (evidence: `scripts/pipeline.py`)
- Latest verdicts → Verdict reports: reads latest (evidence: `scripts/pipeline.py`)
- Pipeline runner → ATT&CK heatmap: writes layer (evidence: `scripts/pipeline.py`)
