# sankar062003/ai-soc-alert-triage architecture

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

- Interactive diagram: https://gitdiagram.com/sankar062003/ai-soc-alert-triage
- Repository: https://github.com/sankar062003/ai-soc-alert-triage

## Overview

This repository is a home-lab SOC triage tool and investigation record. Its main workflow reads Wazuh alert files, extracts evidence, assigns a deterministic code verdict, asks a local LLM for explanatory notes, collects an analyst decision, and saves a Markdown report. Separate documented capabilities include a custom Wazuh persistence detection rule and a full simulated-attack investigation. The runtime relationships are supported by the `triage.py` excerpt; the README documents the broader capabilities. Other source files were not sampled.

Main entry points: [`triage.py`](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py) (Triage runner), [`alert1.json`](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/alert1.json) (Alert 1), [`alert3.json`](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/alert3.json) (Alert 3), [`detection-rules/schtasks-persistence-rule.xml`](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/detection-rules/schtasks-persistence-rule.xml) (Scheduled-task rule)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_triage["Alert triage"]
  node_alert1["Alert 1<br/>[alert1.json]"]
  node_alert3["Alert 3<br/>[alert3.json]"]
  node_triage_cli["Triage runner<br/>[triage.py]"]
  node_alert_loader["Alert extraction<br/>[triage.py]"]
  node_verdict_checks["Deterministic checks<br/>[triage.py]"]
  node_evidence_builder["Evidence assembly<br/>[triage.py]"]
  node_ai_notes["AI explanation<br/>[triage.py]"]
  node_analyst_review["Decision capture<br/>[triage.py]"]
  node_report_writer["Report generation<br/>[triage.py]"]
  node_reports["Triage reports"]
end

subgraph group_integrations["Triage integrations"]
  node_wazuh["Wazuh SIEM"]
  node_local_llm["Local LLM"]
end

subgraph group_detection["Detection engineering"]
  node_persistence_rule["Scheduled-task rule"]
end

subgraph group_investigation["Attack investigation"]
  node_incident["Attack investigation"]
end

node_analyst(("SOC analyst"))

node_wazuh -->|"provides alert"| node_alert1
node_wazuh -->|"provides alert"| node_alert3
node_alert1 -->|"supplies JSON"| node_alert_loader
node_alert3 -->|"supplies JSON"| node_alert_loader
node_triage_cli -->|"loads alerts"| node_alert_loader
node_triage_cli -->|"checks context"| node_verdict_checks
node_triage_cli -->|"builds evidence"| node_evidence_builder
node_triage_cli -->|"requests notes"| node_ai_notes
node_triage_cli -->|"collects decision"| node_analyst_review
node_triage_cli -->|"writes report"| node_report_writer
node_alert_loader -->|"passes alert data"| node_verdict_checks
node_alert_loader -->|"passes alert data"| node_evidence_builder
node_verdict_checks -->|"passes checks"| node_evidence_builder
node_evidence_builder -->|"provides evidence"| node_ai_notes
node_ai_notes -->|"requests explanation"| node_local_llm
node_analyst -->|"records decision"| node_analyst_review
node_report_writer -->|"saves Markdown"| node_reports
node_persistence_rule -->|"adds detection"| node_wazuh

click node_alert1 "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/alert1.json"
click node_alert3 "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/alert3.json"
click node_triage_cli "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py"
click node_alert_loader "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py"
click node_verdict_checks "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py"
click node_evidence_builder "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py"
click node_ai_notes "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py"
click node_analyst_review "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py"
click node_report_writer "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py"
click node_reports "https://github.com/sankar062003/ai-soc-alert-triage/tree/main/reports"
click node_persistence_rule "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/detection-rules/schtasks-persistence-rule.xml"
click node_incident "https://github.com/sankar062003/ai-soc-alert-triage/blob/main/incident-report-lab2.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_alert1,node_alert3,node_triage_cli,node_alert_loader,node_verdict_checks,node_evidence_builder,node_ai_notes,node_analyst_review,node_report_writer,node_reports toneBlue
class node_wazuh,node_local_llm toneAmber
class node_persistence_rule toneMint
class node_incident toneRose
class node_analyst toneIndigo
```

## Components

### Alert triage

- [Alert 1](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/alert1.json): `alert1.json`
- [Alert 3](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/alert3.json): `alert3.json`
- [Triage runner](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py): `triage.py`
- [Alert extraction](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py): `triage.py`
- [Deterministic checks](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py): `triage.py`
- [Evidence assembly](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py): `triage.py`
- [AI explanation](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py): `triage.py`
- [Decision capture](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py): `triage.py`
- [Report generation](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/triage.py): `triage.py`
- [Triage reports](https://github.com/sankar062003/ai-soc-alert-triage/tree/main/reports): `reports`

### Triage integrations

- **Wazuh SIEM**
- **Local LLM**

### Detection engineering

- [Scheduled-task rule](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/detection-rules/schtasks-persistence-rule.xml): `detection-rules/schtasks-persistence-rule.xml`

### Attack investigation

- [Attack investigation](https://github.com/sankar062003/ai-soc-alert-triage/blob/main/incident-report-lab2.md): `incident-report-lab2.md`

### Other components

- **SOC analyst**

## Connections

- Wazuh SIEM → Alert 1: provides alert (evidence: `README.md`)
- Wazuh SIEM → Alert 3: provides alert (evidence: `README.md`)
- Alert 1 → Alert extraction: supplies JSON (evidence: `triage.py`)
- Alert 3 → Alert extraction: supplies JSON (evidence: `triage.py`)
- Triage runner → Alert extraction: loads alerts (evidence: `triage.py`)
- Triage runner → Deterministic checks: checks context (evidence: `triage.py`)
- Triage runner → Evidence assembly: builds evidence (evidence: `triage.py`)
- Triage runner → AI explanation: requests notes (evidence: `triage.py`)
- Triage runner → Decision capture: collects decision (evidence: `triage.py`)
- Triage runner → Report generation: writes report (evidence: `triage.py`)
- Alert extraction → Deterministic checks: passes alert data (evidence: `triage.py`)
- Alert extraction → Evidence assembly: passes alert data (evidence: `triage.py`)
- Deterministic checks → Evidence assembly: passes checks (evidence: `triage.py`)
- Evidence assembly → AI explanation: provides evidence (evidence: `triage.py`)
- AI explanation → Local LLM: requests explanation (evidence: `triage.py`)
- SOC analyst → Decision capture: records decision (evidence: `triage.py`)
- Report generation → Triage reports: saves Markdown (evidence: `triage.py`)
- Scheduled-task rule → Wazuh SIEM: adds detection (evidence: `README.md`)
