# sannidhisriram-06/identity-threat-detection-lab architecture

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

- Interactive diagram: https://gitdiagram.com/sannidhisriram-06/identity-threat-detection-lab
- Repository: https://github.com/sannidhisriram-06/identity-threat-detection-lab

## Overview

This repository is an AWS identity-threat detection and response lab. Its principal workflow provisions an AWS host and telemetry sources, runs attack/JIT-access simulations, feeds host and CloudTrail events into Wazuh for detection, and presents alerts for SOC response. Vault brokers short-lived IAM credentials; Terraform, Docker configuration, and shell scripts define deployment and operation. The graph follows documented architecture and README relationships only; no source excerpts were available, so implementation-level calls are not asserted.

Main entry points: [`docker/config/wazuh_cluster/wazuh_manager.conf.tpl`](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/config/wazuh_cluster/wazuh_manager.conf.tpl) (Wazuh Manager), [`terraform`](https://github.com/sannidhisriram-06/identity-threat-detection-lab/tree/main/terraform) (AWS Infrastructure), [`docker/vault`](https://github.com/sannidhisriram-06/identity-threat-detection-lab/tree/main/docker/vault) (Vault), [`terraform/cloudtrail.tf`](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/terraform/cloudtrail.tf) (CloudTrail)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provisioning["AWS Provisioning"]
  node_terraform["AWS Infrastructure"]
  node_aws_host["EC2 Lab Host<br/>[ec2.tf]"]
end

subgraph group_identity["Identity Brokering"]
  node_vault["Vault"]
  node_vault_init["Vault AWS Setup<br/>[init_vault_aws.sh]"]
  node_iam["AWS IAM<br/>[iam.tf]"]
end

subgraph group_telemetry["Threat Telemetry"]
  node_cloudtrail["CloudTrail<br/>[cloudtrail.tf]"]
  node_s3[("CloudTrail S3<br/>[cloudtrail.tf]")]
  node_host_logs["Host Auth Logs"]
end

subgraph group_detection["Detection and Response"]
  node_wazuh_manager["Wazuh Manager"]
  node_wazuh_rules["Custom Rules<br/>[local_rules.xml]"]
  node_wazuh_indexer[("Wazuh Indexer<br/>[wazuh.indexer.yml]")]
  node_wazuh_dashboard["Wazuh Dashboard<br/>[wazuh.yml]"]
  node_runbook["Incident Runbook"]
end

subgraph group_operations["Lab Operations"]
  node_docker_stack["Docker Stack<br/>[docker-compose.yml]"]
  node_simulations["Attack Simulations"]
  node_bootstrap["Stack Bootstrap<br/>[bootstrap_stack.sh]"]
  node_verification["Stack Verification<br/>[verify_stack.sh]"]
end

node_engineer(("Lab Operator"))
node_soc(("SOC Analyst"))

node_engineer -->|"provisions"| node_terraform
node_terraform -->|"creates"| node_aws_host
node_terraform -->|"configures"| node_cloudtrail
node_cloudtrail -->|"delivers logs"| node_s3
node_aws_host -->|"runs"| node_docker_stack
node_engineer -->|"initializes"| node_vault_init
node_vault_init -->|"configures"| node_vault
node_simulations -->|"generates activity"| node_host_logs
node_simulations -->|"requests credentials"| node_vault
node_vault -->|"creates IAM users"| node_iam
node_iam -->|"emits API events"| node_cloudtrail
node_host_logs -->|"feeds auth logs"| node_wazuh_manager
node_s3 -->|"polls CloudTrail"| node_wazuh_manager
node_wazuh_manager -->|"evaluates rules"| node_wazuh_rules
node_wazuh_manager -.->|"indexes alerts"| node_wazuh_indexer
node_wazuh_indexer -->|"serves events"| node_wazuh_dashboard
node_soc -->|"reviews alerts"| node_wazuh_dashboard
node_soc -->|"uses procedures"| node_runbook
node_engineer -->|"starts stack"| node_bootstrap
node_engineer -->|"verifies stack"| node_verification

click node_terraform "https://github.com/sannidhisriram-06/identity-threat-detection-lab/tree/main/terraform"
click node_aws_host "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/terraform/ec2.tf"
click node_cloudtrail "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/terraform/cloudtrail.tf"
click node_s3 "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/terraform/cloudtrail.tf"
click node_docker_stack "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/docker-compose.yml"
click node_vault "https://github.com/sannidhisriram-06/identity-threat-detection-lab/tree/main/docker/vault"
click node_vault_init "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/vault/scripts/init_vault_aws.sh"
click node_iam "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/terraform/iam.tf"
click node_simulations "https://github.com/sannidhisriram-06/identity-threat-detection-lab/tree/main/simulations"
click node_wazuh_manager "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/config/wazuh_cluster/wazuh_manager.conf.tpl"
click node_wazuh_rules "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/wazuh/rules/local_rules.xml"
click node_wazuh_indexer "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/config/wazuh_indexer/wazuh.indexer.yml"
click node_wazuh_dashboard "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/config/wazuh_dashboard/wazuh.yml"
click node_runbook "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docs/INCIDENT_RESPONSE_RUNBOOK.md"
click node_bootstrap "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/scripts/bootstrap_stack.sh"
click node_verification "https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/scripts/verify_stack.sh"

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_terraform,node_aws_host toneBlue
class node_vault,node_vault_init,node_iam toneAmber
class node_cloudtrail,node_s3,node_host_logs toneMint
class node_wazuh_manager,node_wazuh_rules,node_wazuh_indexer,node_wazuh_dashboard,node_runbook toneRose
class node_docker_stack,node_simulations,node_bootstrap,node_verification,node_engineer,node_soc toneIndigo
```

## Components

### AWS Provisioning

- [AWS Infrastructure](https://github.com/sannidhisriram-06/identity-threat-detection-lab/tree/main/terraform): `terraform`
- [EC2 Lab Host](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/terraform/ec2.tf): `terraform/ec2.tf`

### Identity Brokering

- [Vault](https://github.com/sannidhisriram-06/identity-threat-detection-lab/tree/main/docker/vault): `docker/vault`
- [Vault AWS Setup](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/vault/scripts/init_vault_aws.sh): `docker/vault/scripts/init_vault_aws.sh`
- [AWS IAM](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/terraform/iam.tf): `terraform/iam.tf`

### Threat Telemetry

- [CloudTrail](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/terraform/cloudtrail.tf): `terraform/cloudtrail.tf`
- [CloudTrail S3](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/terraform/cloudtrail.tf): `terraform/cloudtrail.tf`
- **Host Auth Logs**

### Detection and Response

- [Wazuh Manager](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/config/wazuh_cluster/wazuh_manager.conf.tpl): `docker/config/wazuh_cluster/wazuh_manager.conf.tpl`
- [Custom Rules](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/wazuh/rules/local_rules.xml): `docker/wazuh/rules/local_rules.xml`
- [Wazuh Indexer](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/config/wazuh_indexer/wazuh.indexer.yml): `docker/config/wazuh_indexer/wazuh.indexer.yml`
- [Wazuh Dashboard](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/config/wazuh_dashboard/wazuh.yml): `docker/config/wazuh_dashboard/wazuh.yml`
- [Incident Runbook](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docs/INCIDENT_RESPONSE_RUNBOOK.md): `docs/INCIDENT_RESPONSE_RUNBOOK.md`

### Lab Operations

- [Docker Stack](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/docker/docker-compose.yml): `docker/docker-compose.yml`
- [Attack Simulations](https://github.com/sannidhisriram-06/identity-threat-detection-lab/tree/main/simulations): `simulations`
- [Stack Bootstrap](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/scripts/bootstrap_stack.sh): `scripts/bootstrap_stack.sh`
- [Stack Verification](https://github.com/sannidhisriram-06/identity-threat-detection-lab/blob/main/scripts/verify_stack.sh): `scripts/verify_stack.sh`

### Other components

- **Lab Operator**
- **SOC Analyst**

## Connections

- Lab Operator → AWS Infrastructure: provisions (evidence: `README.md`)
- AWS Infrastructure → EC2 Lab Host: creates (evidence: `README.md`)
- AWS Infrastructure → CloudTrail: configures (evidence: `README.md`)
- CloudTrail → CloudTrail S3: delivers logs (evidence: `README.md`)
- EC2 Lab Host → Docker Stack: runs (evidence: `README.md`)
- Lab Operator → Vault AWS Setup: initializes (evidence: `README.md`)
- Vault AWS Setup → Vault: configures (evidence: `README.md`)
- Attack Simulations → Host Auth Logs: generates activity (evidence: `README.md`)
- Attack Simulations → Vault: requests credentials (evidence: `README.md`)
- Vault → AWS IAM: creates IAM users (evidence: `README.md`)
- AWS IAM → CloudTrail: emits API events (evidence: `README.md`)
- Host Auth Logs → Wazuh Manager: feeds auth logs (evidence: `README.md`)
- CloudTrail S3 → Wazuh Manager: polls CloudTrail (evidence: `README.md`)
- Wazuh Manager → Custom Rules: evaluates rules (evidence: `README.md`)
- Wazuh Manager → Wazuh Indexer: indexes alerts
- Wazuh Indexer → Wazuh Dashboard: serves events (evidence: `README.md`)
- SOC Analyst → Wazuh Dashboard: reviews alerts (evidence: `README.md`)
- SOC Analyst → Incident Runbook: uses procedures (evidence: `README.md`)
- Lab Operator → Stack Bootstrap: starts stack (evidence: `README.md`)
- Lab Operator → Stack Verification: verifies stack (evidence: `README.md`)
