# securigeek/m365-investigation-toolkit architecture

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

- Interactive diagram: https://gitdiagram.com/securigeek/m365-investigation-toolkit
- Repository: https://github.com/securigeek/m365-investigation-toolkit

## Overview

This is a read-only Microsoft 365 and Entra ID investigation toolkit. Analysts launch a guided investigation, authenticate through delegated browser sign-in, collect tenant evidence (optionally using investigation pivots), then receive verdicts and structured reports. The graph preserves the documented Exchange, identity, audit, threat-detection, and branded-reporting capabilities. Source excerpts were unavailable, so relationships are limited to those stated in the README; the README does not identify every internal call or output format.

Main entry points: [`src/Invoke-InvestigationCollector.ps1`](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/Invoke-InvestigationCollector.ps1) (Investigation orchestration), [`Run-Investigation-Collector.ps1`](https://github.com/securigeek/m365-investigation-toolkit/blob/main/Run-Investigation-Collector.ps1) (Investigation launcher), [`src/lib/reporting.ps1`](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/reporting.ps1) (Investigation reports), [`src/lib/auth.ps1`](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/auth.ps1) (Delegated authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Investigation workflow"]
  node_launcher["Investigation launcher"]
  node_collector["Investigation orchestration"]
  node_authentication["Delegated authentication<br/>[auth.ps1]"]
end

subgraph group_exchange["Exchange evidence"]
  node_exchange_checks["Exchange checks"]
  node_mailbox_forwarding["Mailbox forwarding"]
  node_inbox_rules["Inbox rules"]
  node_transport_connectors["Transport and connectors"]
  node_message_trace["Message trace pivots"]
  node_quarantine["Quarantine pivots"]
end

subgraph group_identity["Identity and audit"]
  node_identity_checks["Identity sign-ins"]
  node_directory_audit["Directory audit"]
  node_unified_audit["Unified audit log"]
  node_access_checks["Consent and roles"]
end

subgraph group_analysis["Detection and reporting"]
  node_detections["Threat detections<br/>[detections.ps1]"]
  node_verdict["Confidence-aware verdict"]
  node_reporting["Investigation reports<br/>[reporting.ps1]"]
  node_branded_reports["Branded presentations"]
end

node_analyst(("Analyst"))
node_microsoft_services(("Microsoft 365 services"))

node_analyst -->|"starts investigation"| node_launcher
node_launcher -->|"runs collection"| node_collector
node_collector -->|"signs in"| node_authentication
node_collector -->|"collects evidence"| node_exchange_checks
node_collector -->|"collects evidence"| node_identity_checks
node_collector -->|"collects evidence"| node_directory_audit
node_collector -->|"collects evidence"| node_unified_audit
node_collector -->|"collects evidence"| node_access_checks
node_collector -->|"applies pivots"| node_message_trace
node_collector -->|"applies pivots"| node_quarantine
node_collector -->|"collects evidence"| node_mailbox_forwarding
node_collector -->|"collects evidence"| node_inbox_rules
node_collector -->|"collects evidence"| node_transport_connectors
node_collector -->|"queries tenant"| node_microsoft_services
node_collector -->|"assesses indicators"| node_detections
node_collector -->|"generates verdict"| node_verdict
node_collector -->|"generates outputs"| node_reporting
node_reporting -->|"creates presentations"| node_branded_reports

click node_launcher "https://github.com/securigeek/m365-investigation-toolkit/blob/main/Run-Investigation-Collector.ps1"
click node_collector "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/Invoke-InvestigationCollector.ps1"
click node_authentication "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/auth.ps1"
click node_exchange_checks "https://github.com/securigeek/m365-investigation-toolkit/tree/main/src/collectors"
click node_mailbox_forwarding "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantMailboxForwarding.ps1"
click node_inbox_rules "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantInboxRules.ps1"
click node_transport_connectors "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantTransportRules.ps1"
click node_message_trace "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantMessageTracePivot.ps1"
click node_quarantine "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantQuarantinePivot.ps1"
click node_identity_checks "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantInteractiveSignins.ps1"
click node_directory_audit "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantDirectoryAuditLog.ps1"
click node_unified_audit "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantUnifiedAuditLog.ps1"
click node_access_checks "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantConsentGrants.ps1"
click node_detections "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/detections.ps1"
click node_verdict "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/forensic-normalization.ps1"
click node_reporting "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/reporting.ps1"
click node_branded_reports "https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/branded-pptx-generator.ps1"

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_launcher,node_collector,node_authentication toneBlue
class node_exchange_checks,node_mailbox_forwarding,node_inbox_rules,node_transport_connectors,node_message_trace,node_quarantine toneAmber
class node_identity_checks,node_directory_audit,node_unified_audit,node_access_checks toneMint
class node_detections,node_verdict,node_reporting,node_branded_reports toneRose
class node_analyst,node_microsoft_services toneIndigo
```

## Components

### Investigation workflow

- [Investigation launcher](https://github.com/securigeek/m365-investigation-toolkit/blob/main/Run-Investigation-Collector.ps1): `Run-Investigation-Collector.ps1`
- [Investigation orchestration](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/Invoke-InvestigationCollector.ps1): `src/Invoke-InvestigationCollector.ps1`
- [Delegated authentication](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/auth.ps1): `src/lib/auth.ps1`

### Exchange evidence

- [Exchange checks](https://github.com/securigeek/m365-investigation-toolkit/tree/main/src/collectors): `src/collectors`
- [Mailbox forwarding](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantMailboxForwarding.ps1): `src/collectors/Get-TenantMailboxForwarding.ps1`
- [Inbox rules](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantInboxRules.ps1): `src/collectors/Get-TenantInboxRules.ps1`
- [Transport and connectors](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantTransportRules.ps1): `src/collectors/Get-TenantTransportRules.ps1`
- [Message trace pivots](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantMessageTracePivot.ps1): `src/collectors/Get-TenantMessageTracePivot.ps1`
- [Quarantine pivots](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantQuarantinePivot.ps1): `src/collectors/Get-TenantQuarantinePivot.ps1`

### Identity and audit

- [Identity sign-ins](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantInteractiveSignins.ps1): `src/collectors/Get-TenantInteractiveSignins.ps1`
- [Directory audit](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantDirectoryAuditLog.ps1): `src/collectors/Get-TenantDirectoryAuditLog.ps1`
- [Unified audit log](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantUnifiedAuditLog.ps1): `src/collectors/Get-TenantUnifiedAuditLog.ps1`
- [Consent and roles](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/collectors/Get-TenantConsentGrants.ps1): `src/collectors/Get-TenantConsentGrants.ps1`

### Detection and reporting

- [Threat detections](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/detections.ps1): `src/lib/detections.ps1`
- [Confidence-aware verdict](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/forensic-normalization.ps1): `src/lib/forensic-normalization.ps1`
- [Investigation reports](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/reporting.ps1): `src/lib/reporting.ps1`
- [Branded presentations](https://github.com/securigeek/m365-investigation-toolkit/blob/main/src/lib/branded-pptx-generator.ps1): `src/lib/branded-pptx-generator.ps1`

### Other components

- **Analyst**
- **Microsoft 365 services**

## Connections

- Analyst → Investigation launcher: starts investigation (evidence: `README.md`)
- Investigation launcher → Investigation orchestration: runs collection (evidence: `README.md`)
- Investigation orchestration → Delegated authentication: signs in (evidence: `README.md`)
- Investigation orchestration → Exchange checks: collects evidence (evidence: `README.md`)
- Investigation orchestration → Identity sign-ins: collects evidence (evidence: `README.md`)
- Investigation orchestration → Directory audit: collects evidence (evidence: `README.md`)
- Investigation orchestration → Unified audit log: collects evidence (evidence: `README.md`)
- Investigation orchestration → Consent and roles: collects evidence (evidence: `README.md`)
- Investigation orchestration → Message trace pivots: applies pivots (evidence: `README.md`)
- Investigation orchestration → Quarantine pivots: applies pivots (evidence: `README.md`)
- Investigation orchestration → Mailbox forwarding: collects evidence (evidence: `README.md`)
- Investigation orchestration → Inbox rules: collects evidence (evidence: `README.md`)
- Investigation orchestration → Transport and connectors: collects evidence (evidence: `README.md`)
- Investigation orchestration → Microsoft 365 services: queries tenant (evidence: `README.md`)
- Investigation orchestration → Threat detections: assesses indicators (evidence: `README.md`)
- Investigation orchestration → Confidence-aware verdict: generates verdict (evidence: `README.md`)
- Investigation orchestration → Investigation reports: generates outputs (evidence: `README.md`)
- Investigation reports → Branded presentations: creates presentations (evidence: `README.md`)
