# kamboj10/cloudwarden architecture

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

- Interactive diagram: https://gitdiagram.com/kamboj10/cloudwarden
- Repository: https://github.com/kamboj10/cloudwarden

## Overview

CloudWarden is a read-only AWS/Azure security scanner. The principal workflow starts with a user choosing providers and scan options, runs provider-specific checks, combines findings and errors, renders a text/JSON/HTML report, and returns a severity-based exit status. README-described check coverage is grouped by domain; the excerpts show the check implementations and orchestration, but not every individual AWS check body.

Main entry points: [`cloudwarden/cli.py`](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/cli.py) (CLI orchestration), [`cloudwarden/models.py`](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/models.py) (Scan result model), [`cloudwarden/aws_checks.py`](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/aws_checks.py) (EC2 and VPC), [`cloudwarden/azure_checks.py`](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/azure_checks.py) (NSG exposure)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Scan entry"]
  node_cli["CLI orchestration<br/>[cli.py]"]
end

subgraph group_aws["AWS checks"]
  node_aws_ec2["EC2 and VPC<br/>[aws_checks.py]"]
  node_aws_storage["S3 access<br/>[aws_checks.py]"]
  node_aws_iam["IAM controls<br/>[aws_checks.py]"]
end

subgraph group_azure["Azure checks"]
  node_azure_nsg["NSG exposure<br/>[azure_checks.py]"]
  node_azure_storage["Storage controls<br/>[azure_checks.py]"]
end

subgraph group_results["Results and reporting"]
  node_result_model["Scan result model<br/>[models.py]"]
  node_renderers["Report renderers<br/>[report.py]"]
end

node_operator(("Operator"))
node_aws_account[("AWS account")]
node_azure_account[("Azure subscription")]
node_report_user(("Report consumer"))

node_operator -->|"selects scan"| node_cli
node_cli -->|"runs checks"| node_aws_ec2
node_cli -->|"runs checks"| node_aws_storage
node_cli -->|"runs checks"| node_aws_iam
node_cli -->|"runs checks"| node_azure_nsg
node_cli -->|"runs checks"| node_azure_storage
node_aws_ec2 -->|"reads resources"| node_aws_account
node_aws_storage -->|"reads resources"| node_aws_account
node_aws_iam -->|"reads resources"| node_aws_account
node_azure_nsg -->|"reads resources"| node_azure_account
node_azure_storage -->|"reads resources"| node_azure_account
node_aws_ec2 -->|"returns findings"| node_result_model
node_aws_storage -->|"returns findings"| node_result_model
node_aws_iam -->|"returns findings"| node_result_model
node_azure_nsg -->|"returns findings"| node_result_model
node_azure_storage -->|"returns findings"| node_result_model
node_cli -->|"merges results"| node_result_model
node_cli -->|"selects renderer"| node_renderers
node_renderers -->|"formats findings"| node_result_model
node_cli -->|"writes report"| node_report_user

click node_cli "https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/cli.py"
click node_aws_ec2 "https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/aws_checks.py"
click node_aws_storage "https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/aws_checks.py"
click node_aws_iam "https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/aws_checks.py"
click node_azure_nsg "https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/azure_checks.py"
click node_azure_storage "https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/azure_checks.py"
click node_result_model "https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/models.py"
click node_renderers "https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/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_cli toneBlue
class node_aws_ec2,node_aws_storage,node_aws_iam,node_aws_account,node_azure_account toneAmber
class node_azure_nsg,node_azure_storage toneMint
class node_result_model,node_renderers toneRose
class node_operator,node_report_user toneIndigo
```

## Components

### Scan entry

- [CLI orchestration](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/cli.py): `cloudwarden/cli.py`

### AWS checks

- [EC2 and VPC](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/aws_checks.py): `cloudwarden/aws_checks.py`
- [S3 access](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/aws_checks.py): `cloudwarden/aws_checks.py`
- [IAM controls](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/aws_checks.py): `cloudwarden/aws_checks.py`

### Azure checks

- [NSG exposure](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/azure_checks.py): `cloudwarden/azure_checks.py`
- [Storage controls](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/azure_checks.py): `cloudwarden/azure_checks.py`

### Results and reporting

- [Scan result model](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/models.py): `cloudwarden/models.py`
- [Report renderers](https://github.com/kamboj10/cloudwarden/blob/main/cloudwarden/report.py): `cloudwarden/report.py`

### Other components

- **Operator**
- **AWS account**
- **Azure subscription**
- **Report consumer**

## Connections

- Operator → CLI orchestration: selects scan (evidence: `README.md`)
- CLI orchestration → EC2 and VPC: runs checks (evidence: `README.md`)
- CLI orchestration → S3 access: runs checks (evidence: `README.md`)
- CLI orchestration → IAM controls: runs checks (evidence: `README.md`)
- CLI orchestration → NSG exposure: runs checks (evidence: `README.md`)
- CLI orchestration → Storage controls: runs checks (evidence: `README.md`)
- EC2 and VPC → AWS account: reads resources (evidence: `README.md`)
- S3 access → AWS account: reads resources (evidence: `README.md`)
- IAM controls → AWS account: reads resources (evidence: `README.md`)
- NSG exposure → Azure subscription: reads resources (evidence: `README.md`)
- Storage controls → Azure subscription: reads resources (evidence: `README.md`)
- EC2 and VPC → Scan result model: returns findings (evidence: `cloudwarden/aws_checks.py`)
- S3 access → Scan result model: returns findings (evidence: `cloudwarden/aws_checks.py`)
- IAM controls → Scan result model: returns findings (evidence: `cloudwarden/aws_checks.py`)
- NSG exposure → Scan result model: returns findings (evidence: `cloudwarden/azure_checks.py`)
- Storage controls → Scan result model: returns findings (evidence: `cloudwarden/azure_checks.py`)
- CLI orchestration → Scan result model: merges results (evidence: `cloudwarden/cli.py`)
- CLI orchestration → Report renderers: selects renderer (evidence: `cloudwarden/cli.py`)
- Report renderers → Scan result model: formats findings (evidence: `cloudwarden/report.py`)
- CLI orchestration → Report consumer: writes report (evidence: `cloudwarden/cli.py`)
