# bigsnack7/terraform-honeypot_lab-v2.0 architecture

> Architecture diagram of the GitHub repository bigsnack7/terraform-honeypot_lab-v2.0, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bigsnack7/terraform-honeypot_lab-v2.0
- Repository: https://github.com/bigsnack7/terraform-honeypot_lab-v2.0

## Overview

This repository is an AWS honeypot and security landing-zone deployment, not a general Terraform library. Its main workflow is an operator-triggered GitHub Actions deployment using short-lived OIDC credentials to provision isolated Cowrie, web, and Windows decoys, then centralize telemetry for analyst investigation with saved CloudWatch Logs Insights queries. Optional security services and plan/IAM/provenance checks support that deployment. The README documents capabilities, but sampled source is limited to the validation scripts, so infrastructure wiring is represented only where the README supports it.

Main entry points: [`terraform/main.tf`](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/main.tf) (Terraform deployment), [`terraform/modules/monitoring/main.tf`](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/monitoring/main.tf) (CloudWatch monitoring), [`.github/workflows`](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/tree/main/.github/workflows) (GitHub Actions), [`terraform/modules/linux-honeypot/main.tf`](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/linux-honeypot/main.tf) (Cowrie SSH decoy)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_deployment["Deployment and state"]
  node_actions["GitHub Actions<br/>[workflows]"]
  node_oidc["OIDC deployment roles"]
  node_terraform["Terraform deployment<br/>[main.tf]"]
  node_state[("Remote state bootstrap<br/>[main.tf]")]
  node_plan_guard["Plan safety guard<br/>[guard-plan.py]"]
  node_iam_check["IAM policy validation"]
  node_provenance["Plan provenance check"]
end

subgraph group_decoys["Honeypot decoys"]
  node_network["Isolated decoy networks<br/>[main.tf]"]
  node_linux["Cowrie SSH decoy<br/>[main.tf]"]
  node_web["Flask web decoy<br/>[main.tf]"]
  node_windows["Windows RDP decoy<br/>[main.tf]"]
end

subgraph group_security["Security controls"]
  node_iam["Workload IAM<br/>[main.tf]"]
  node_baseline["Security baseline<br/>[main.tf]"]
  node_cloudtrail["CloudTrail audit<br/>[main.tf]"]
end

subgraph group_telemetry["Telemetry and investigation"]
  node_cloudwatch["CloudWatch monitoring<br/>[main.tf]"]
  node_queries["Investigation queries"]
end

node_operator(("Operator"))
node_aws["AWS"]
node_analyst(("Security analyst"))

node_operator -->|"triggers deployment"| node_actions
node_actions -->|"assumes short-lived roles"| node_oidc
node_actions -->|"deploys infrastructure"| node_terraform
node_terraform -.->|"uses remote state"| node_state
node_terraform -->|"provisions networks"| node_network
node_terraform -->|"provisions decoy"| node_linux
node_terraform -->|"provisions decoy"| node_web
node_terraform -->|"provisions decoy"| node_windows
node_terraform -.->|"configures access"| node_iam
node_terraform -->|"enables optionally"| node_baseline
node_terraform -->|"enables audit events"| node_cloudtrail
node_terraform -->|"configures telemetry"| node_cloudwatch
node_linux -->|"sends telemetry"| node_cloudwatch
node_web -->|"sends telemetry"| node_cloudwatch
node_windows -->|"sends telemetry"| node_cloudwatch
node_analyst -->|"runs investigations"| node_queries
node_queries -->|"queries log data"| node_cloudwatch
node_terraform -.->|"checks plans"| node_plan_guard
node_terraform -.->|"validates policies"| node_iam_check
node_actions -.->|"verifies plan approval"| node_provenance
node_terraform -->|"provisions resources"| node_aws

click node_actions "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/tree/main/.github/workflows"
click node_oidc "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/tree/main/terraform/github-oidc"
click node_terraform "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/main.tf"
click node_state "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/bootstrap-state/main.tf"
click node_plan_guard "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/scripts/guard-plan.py"
click node_iam_check "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/scripts/validate-iam-policies.py"
click node_provenance "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/scripts/verify_plan_provenance.py"
click node_network "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/networking/main.tf"
click node_linux "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/linux-honeypot/main.tf"
click node_web "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/web-honeypot/main.tf"
click node_windows "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/windows-honeypot/main.tf"
click node_iam "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/iam/main.tf"
click node_baseline "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/security/main.tf"
click node_cloudtrail "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/main.tf"
click node_cloudwatch "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/monitoring/main.tf"
click node_queries "https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/tree/main/detections/cloudwatch-logs-insights"

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_actions,node_oidc,node_terraform,node_state,node_plan_guard,node_iam_check,node_provenance toneBlue
class node_network,node_linux,node_web,node_windows toneAmber
class node_iam,node_baseline,node_cloudtrail toneMint
class node_cloudwatch,node_queries toneRose
class node_operator,node_aws,node_analyst toneIndigo
```

## Components

### Deployment and state

- [GitHub Actions](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/tree/main/.github/workflows): `.github/workflows`
- [OIDC deployment roles](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/tree/main/terraform/github-oidc): `terraform/github-oidc`
- [Terraform deployment](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/main.tf): `terraform/main.tf`
- [Remote state bootstrap](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/bootstrap-state/main.tf): `terraform/bootstrap-state/main.tf`
- [Plan safety guard](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/scripts/guard-plan.py): `terraform/scripts/guard-plan.py`
- [IAM policy validation](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/scripts/validate-iam-policies.py): `terraform/scripts/validate-iam-policies.py`
- [Plan provenance check](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/scripts/verify_plan_provenance.py): `terraform/scripts/verify_plan_provenance.py`

### Honeypot decoys

- [Isolated decoy networks](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/networking/main.tf): `terraform/modules/networking/main.tf`
- [Cowrie SSH decoy](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/linux-honeypot/main.tf): `terraform/modules/linux-honeypot/main.tf`
- [Flask web decoy](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/web-honeypot/main.tf): `terraform/modules/web-honeypot/main.tf`
- [Windows RDP decoy](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/windows-honeypot/main.tf): `terraform/modules/windows-honeypot/main.tf`

### Security controls

- [Workload IAM](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/iam/main.tf): `terraform/modules/iam/main.tf`
- [Security baseline](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/security/main.tf): `terraform/modules/security/main.tf`
- [CloudTrail audit](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/main.tf): `terraform/main.tf`

### Telemetry and investigation

- [CloudWatch monitoring](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/blob/main/terraform/modules/monitoring/main.tf): `terraform/modules/monitoring/main.tf`
- [Investigation queries](https://github.com/bigsnack7/terraform-honeypot_lab-v2.0/tree/main/detections/cloudwatch-logs-insights): `detections/cloudwatch-logs-insights`

### Other components

- **Operator**
- **AWS**
- **Security analyst**

## Connections

- Operator → GitHub Actions: triggers deployment (evidence: `README.md`)
- GitHub Actions → OIDC deployment roles: assumes short-lived roles (evidence: `README.md`)
- GitHub Actions → Terraform deployment: deploys infrastructure (evidence: `README.md`)
- Terraform deployment → Remote state bootstrap: uses remote state
- Terraform deployment → Isolated decoy networks: provisions networks (evidence: `README.md`)
- Terraform deployment → Cowrie SSH decoy: provisions decoy (evidence: `README.md`)
- Terraform deployment → Flask web decoy: provisions decoy (evidence: `README.md`)
- Terraform deployment → Windows RDP decoy: provisions decoy (evidence: `README.md`)
- Terraform deployment → Workload IAM: configures access
- Terraform deployment → Security baseline: enables optionally (evidence: `README.md`)
- Terraform deployment → CloudTrail audit: enables audit events (evidence: `README.md`)
- Terraform deployment → CloudWatch monitoring: configures telemetry (evidence: `README.md`)
- Cowrie SSH decoy → CloudWatch monitoring: sends telemetry (evidence: `README.md`)
- Flask web decoy → CloudWatch monitoring: sends telemetry (evidence: `README.md`)
- Windows RDP decoy → CloudWatch monitoring: sends telemetry (evidence: `README.md`)
- Security analyst → Investigation queries: runs investigations (evidence: `README.md`)
- Investigation queries → CloudWatch monitoring: queries log data (evidence: `README.md`)
- Terraform deployment → Plan safety guard: checks plans
- Terraform deployment → IAM policy validation: validates policies
- GitHub Actions → Plan provenance check: verifies plan approval
- Terraform deployment → AWS: provisions resources (evidence: `README.md`)
