# tonytrapper/automate-dfir architecture

> Architecture diagram of the GitHub repository tonytrapper/automate-dfir, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tonytrapper/automate-dfir
- Repository: https://github.com/tonytrapper/automate-dfir

## Overview

DFIR AI is an offline Windows-forensics analysis tool: a user supplies Hayabusa exports, snapshots, folders, or ZIP evidence; the CLI ingests and normalizes inputs, applies deterministic detections and temporal correlations, optionally requests local Ollama hypotheses, and writes traceable preliminary reports. Windows acquisition and direct EVTX processing are separate supported branches. The README documents several capabilities whose implementation was not sampled; those links are shown only where documented, and unsampled internals are not inferred.

Main entry points: [`main.py`](https://github.com/tonytrapper/automate-dfir/blob/main/main.py) (Analysis CLI), [`dfir_ia/ingest.py`](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/ingest.py) (Ingest and normalize), [`dfir_ia/ai.py`](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/ai.py) (AI review), [`dfir_ia/report.py`](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/report.py) (Report generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_acquisition["Evidence acquisition"]
  node_collector["Windows collector"]
  node_evidence["Evidence ZIP"]
end

subgraph group_analysis["Ingestion and analysis"]
  node_cli["Analysis CLI<br/>[main.py]"]
  node_ingest["Ingest and normalize<br/>[ingest.py]"]
  node_events["Events and snapshots<br/>[ingest.py]"]
  node_detect["Rules and correlation<br/>[detect.py]"]
  node_findings["Findings<br/>[detect.py]"]
end

subgraph group_enrichment["Optional enrichment"]
  node_ai["AI review<br/>[ai.py]"]
end

subgraph group_outputs["Reporting and traceability"]
  node_report["Report generation<br/>[report.py]"]
  node_artifacts["Reports and timeline<br/>[report.py]"]
end

node_analyst(("Analyst"))
node_hayabusa["Hayabusa"]
node_ollama["Ollama local"]

node_analyst -->|"runs acquisition"| node_collector
node_collector -->|"packages evidence"| node_evidence
node_analyst -->|"provides inputs"| node_cli
node_cli -->|"loads sources"| node_ingest
node_ingest -.->|"invokes for EVTX"| node_hayabusa
node_hayabusa -->|"supplies timeline"| node_ingest
node_ingest -->|"normalizes inputs"| node_events
node_cli -->|"runs detections"| node_detect
node_events -->|"analyzes events"| node_detect
node_detect -->|"returns findings"| node_findings
node_cli -->|"requests optional review"| node_ai
node_findings -->|"summarizes findings"| node_ai
node_ai -->|"posts locally"| node_ollama
node_ai -->|"returns hypotheses"| node_cli
node_cli -->|"builds reports"| node_report
node_findings -->|"includes findings"| node_report
node_events -->|"includes timeline and manifest"| node_report
node_report -->|"writes outputs"| node_artifacts

click node_cli "https://github.com/tonytrapper/automate-dfir/blob/main/main.py"
click node_collector "https://github.com/tonytrapper/automate-dfir/blob/main/collectors/Collect-WindowsEvidence.ps1"
click node_ingest "https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/ingest.py"
click node_events "https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/ingest.py"
click node_detect "https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/detect.py"
click node_findings "https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/detect.py"
click node_ai "https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/ai.py"
click node_report "https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/report.py"
click node_artifacts "https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/report.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_collector,node_evidence toneBlue
class node_cli,node_ingest,node_events,node_detect,node_findings toneAmber
class node_ai toneMint
class node_report,node_artifacts toneRose
class node_analyst,node_hayabusa,node_ollama toneIndigo
```

## Components

### Evidence acquisition

- [Windows collector](https://github.com/tonytrapper/automate-dfir/blob/main/collectors/Collect-WindowsEvidence.ps1): `collectors/Collect-WindowsEvidence.ps1`
- **Evidence ZIP**

### Ingestion and analysis

- [Analysis CLI](https://github.com/tonytrapper/automate-dfir/blob/main/main.py): `main.py`
- [Ingest and normalize](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/ingest.py): `dfir_ia/ingest.py`
- [Events and snapshots](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/ingest.py): `dfir_ia/ingest.py`
- [Rules and correlation](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/detect.py): `dfir_ia/detect.py`
- [Findings](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/detect.py): `dfir_ia/detect.py`

### Optional enrichment

- [AI review](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/ai.py): `dfir_ia/ai.py`

### Reporting and traceability

- [Report generation](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/report.py): `dfir_ia/report.py`
- [Reports and timeline](https://github.com/tonytrapper/automate-dfir/blob/main/dfir_ia/report.py): `dfir_ia/report.py`

### Other components

- **Analyst**
- **Hayabusa**
- **Ollama local**

## Connections

- Analyst → Windows collector: runs acquisition (evidence: `README.md`)
- Windows collector → Evidence ZIP: packages evidence (evidence: `README.md`)
- Analyst → Analysis CLI: provides inputs (evidence: `README.md`)
- Analysis CLI → Ingest and normalize: loads sources (evidence: `main.py`)
- Ingest and normalize → Hayabusa: invokes for EVTX (evidence: `dfir_ia/ingest.py`)
- Hayabusa → Ingest and normalize: supplies timeline (evidence: `dfir_ia/ingest.py`)
- Ingest and normalize → Events and snapshots: normalizes inputs (evidence: `dfir_ia/ingest.py`)
- Analysis CLI → Rules and correlation: runs detections (evidence: `main.py`)
- Events and snapshots → Rules and correlation: analyzes events (evidence: `main.py`)
- Rules and correlation → Findings: returns findings (evidence: `dfir_ia/detect.py`)
- Analysis CLI → AI review: requests optional review (evidence: `main.py`)
- Findings → AI review: summarizes findings (evidence: `dfir_ia/ai.py`)
- AI review → Ollama local: posts locally (evidence: `dfir_ia/ai.py`)
- AI review → Analysis CLI: returns hypotheses (evidence: `dfir_ia/ai.py`)
- Analysis CLI → Report generation: builds reports (evidence: `main.py`)
- Findings → Report generation: includes findings (evidence: `main.py`)
- Events and snapshots → Report generation: includes timeline and manifest (evidence: `main.py`)
- Report generation → Reports and timeline: writes outputs (evidence: `dfir_ia/report.py`)
