# frangelbarrera/cloud-misconfig-scanner architecture

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

- Interactive diagram: https://gitdiagram.com/frangelbarrera/cloud-misconfig-scanner
- Repository: https://github.com/frangelbarrera/cloud-misconfig-scanner

## Overview

Cloud Misconfig Scanner is a CLI for finding cloud-storage misconfigurations. The principal workflow parses provider and output options, runs the selected scanner(s), combines findings, then filters and emits text, JSON, or HTML; findings also determine the CLI exit status. AWS S3 performs real API checks when credentials are available and can fall back to simulated findings. Azure Blob and GCP Storage are currently simulated. The README documents the provider capabilities; unsampled rule YAML contents and internal scanner details are not inferred here.

Main entry points: [`cms/cli.py`](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/cli.py) (CLI orchestration), [`cms/core/models.py`](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/core/models.py) (Finding models), [`cms/providers/aws_s3.py`](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/aws_s3.py) (AWS S3 scanner), [`cms/providers/azure_blob.py`](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/azure_blob.py) (Azure Blob scanner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI workflow"]
  node_legacy["Legacy entry<br/>[cms.py]"]
  node_module_entry["Module entry<br/>[__main__.py]"]
  node_cli["CLI orchestration<br/>[cli.py]"]
end

subgraph group_scanning["Provider scanning"]
  node_aws["AWS S3 scanner<br/>[aws_s3.py]"]
  node_azure["Azure Blob scanner<br/>[azure_blob.py]"]
  node_gcp["GCP Storage scanner<br/>[gcp_storage.py]"]
  node_base["Provider base<br/>[base.py]"]
end

subgraph group_rules["Rules and findings"]
  node_rule_loader["Rule registry<br/>[rules.py]"]
  node_rule_data["Provider rule sets"]
  node_models["Finding models<br/>[models.py]"]
end

subgraph group_output["Reports"]
  node_reporter["Text and JSON<br/>[reporter.py]"]
  node_html_reporter["HTML report<br/>[html_reporter.py]"]
end

node_operator(("CLI user"))
node_cloud_apis{{"AWS APIs"}}

node_operator -->|"launches"| node_legacy
node_operator -->|"launches"| node_module_entry
node_legacy -->|"delegates"| node_cli
node_module_entry -->|"invokes"| node_cli
node_cli -->|"runs"| node_aws
node_cli -->|"runs"| node_azure
node_cli -->|"runs"| node_gcp
node_aws -->|"queries"| node_cloud_apis
node_aws -->|"loads rules"| node_rule_loader
node_azure -->|"loads rules"| node_rule_loader
node_gcp -->|"loads rules"| node_rule_loader
node_rule_data -->|"loaded by"| node_rule_loader
node_aws -->|"subclasses"| node_base
node_azure -->|"subclasses"| node_base
node_gcp -->|"subclasses"| node_base
node_cli -->|"prints text or JSON"| node_reporter
node_cli -->|"generates HTML"| node_html_reporter
node_cli -->|"merges results"| node_models
node_aws -->|"creates findings"| node_models
node_azure -->|"creates findings"| node_models
node_gcp -->|"creates findings"| node_models
node_reporter -->|"formats findings"| node_models
node_html_reporter -->|"renders findings"| node_models

click node_legacy "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms.py"
click node_module_entry "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/__main__.py"
click node_cli "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/cli.py"
click node_aws "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/aws_s3.py"
click node_azure "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/azure_blob.py"
click node_gcp "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/gcp_storage.py"
click node_base "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/base.py"
click node_rule_loader "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/core/rules.py"
click node_rule_data "https://github.com/frangelbarrera/cloud-misconfig-scanner/tree/main/cms/checks"
click node_models "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/core/models.py"
click node_reporter "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/core/reporter.py"
click node_html_reporter "https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/core/html_reporter.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_legacy,node_module_entry,node_cli,node_operator toneBlue
class node_aws,node_azure,node_gcp,node_base toneAmber
class node_rule_loader,node_rule_data,node_models,node_cloud_apis toneMint
class node_reporter,node_html_reporter toneRose
```

## Components

### CLI workflow

- [Legacy entry](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms.py): `cms.py`
- [Module entry](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/__main__.py): `cms/__main__.py`
- [CLI orchestration](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/cli.py): `cms/cli.py`

### Provider scanning

- [AWS S3 scanner](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/aws_s3.py): `cms/providers/aws_s3.py`
- [Azure Blob scanner](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/azure_blob.py): `cms/providers/azure_blob.py`
- [GCP Storage scanner](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/gcp_storage.py): `cms/providers/gcp_storage.py`
- [Provider base](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/providers/base.py): `cms/providers/base.py`

### Rules and findings

- [Rule registry](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/core/rules.py): `cms/core/rules.py`
- [Provider rule sets](https://github.com/frangelbarrera/cloud-misconfig-scanner/tree/main/cms/checks): `cms/checks`
- [Finding models](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/core/models.py): `cms/core/models.py`

### Reports

- [Text and JSON](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/core/reporter.py): `cms/core/reporter.py`
- [HTML report](https://github.com/frangelbarrera/cloud-misconfig-scanner/blob/main/cms/core/html_reporter.py): `cms/core/html_reporter.py`

### Other components

- **CLI user**
- **AWS APIs**

## Connections

- CLI user → Legacy entry: launches (evidence: `README.md`)
- CLI user → Module entry: launches (evidence: `README.md`)
- Legacy entry → CLI orchestration: delegates (evidence: `cms.py`)
- Module entry → CLI orchestration: invokes (evidence: `cms/__main__.py`)
- CLI orchestration → AWS S3 scanner: runs (evidence: `cms/cli.py`)
- CLI orchestration → Azure Blob scanner: runs (evidence: `cms/cli.py`)
- CLI orchestration → GCP Storage scanner: runs (evidence: `cms/cli.py`)
- AWS S3 scanner → AWS APIs: queries (evidence: `README.md`)
- AWS S3 scanner → Rule registry: loads rules (evidence: `cms/providers/aws_s3.py`)
- Azure Blob scanner → Rule registry: loads rules (evidence: `cms/providers/azure_blob.py`)
- GCP Storage scanner → Rule registry: loads rules (evidence: `cms/providers/gcp_storage.py`)
- Provider rule sets → Rule registry: loaded by (evidence: `cms/core/rules.py`)
- AWS S3 scanner → Provider base: subclasses (evidence: `cms/providers/aws_s3.py`)
- Azure Blob scanner → Provider base: subclasses (evidence: `cms/providers/azure_blob.py`)
- GCP Storage scanner → Provider base: subclasses (evidence: `cms/providers/gcp_storage.py`)
- CLI orchestration → Text and JSON: prints text or JSON (evidence: `cms/cli.py`)
- CLI orchestration → HTML report: generates HTML (evidence: `cms/cli.py`)
- CLI orchestration → Finding models: merges results (evidence: `cms/cli.py`)
- AWS S3 scanner → Finding models: creates findings (evidence: `cms/providers/aws_s3.py`)
- Azure Blob scanner → Finding models: creates findings (evidence: `cms/providers/azure_blob.py`)
- GCP Storage scanner → Finding models: creates findings (evidence: `cms/providers/gcp_storage.py`)
- Text and JSON → Finding models: formats findings (evidence: `cms/core/reporter.py`)
- HTML report → Finding models: renders findings (evidence: `cms/core/html_reporter.py`)
