# thatvirdiguy/aws-security-check architecture

> Architecture diagram of the GitHub repository thatvirdiguy/aws-security-check, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thatvirdiguy/aws-security-check
- Repository: https://github.com/thatvirdiguy/aws-security-check

## Overview

Step 1: Identify the Main Components
- Security Check Driver: At the core is the main script (security_check.sh) that orchestrates the execution of the individual modules.
- Modules: Separate scripts for each AWS service:
– ec2.sh (which includes VPC checks as well)
– iam.sh
– s3.sh
- Logs Output: Although the file tree doesn’t show a “logs” directory, the README indicates that all reports (CSV files) are stored in a dedicated logs folder.
- External AWS Environment: Represent the target AWS environment (including regions and accounts) that these scripts interface with, and external dependencies such as the AWS CLI.

Step 2: Define the Relationships and Interactions Between Components
- Optionally, indicate that the modules are designed to report detailed findings including account, region, service, resource, rule violation, vulnerability level, and recommended remediation.

Step 3: Highlight Architectural Patterns and Design Principles
- Modularity: Stress that each AWS service check is encapsulated in its own Bash script, promoting separation of concerns.
- Extensibility: Identify that the design is open to expansion by adding more modules for additional AWS services or checks.

Step 4: Include Relevant Technologies and External Factors
- Underlying Shell Environment: Note that this is a Bash script running in a Unix-like shell.
- AWS CLI: Underpinning these checks likely is the AWS CLI or similar commands interacting with AWS services.
- CSV Logging: The output format for security findings is CSV, which can be highlighted in the logs component.

– “Main Script: security_check.sh”
– “Module: EC2/VPC Checks (ec2.sh)”
– “Module: S3 Checks (s3.sh)”
– “Module: IAM Checks (iam.sh)”
– “Output: Logs (CSV Files)”
– “External: AWS Environment”
- Modular breakdown and integration points by clearly annotating that the main script orchestrates calls and that each module reports its findings independently.

Since this is a focused security audit tool rather than a full-stack web application or compiler:
- Separation of functionality into discrete modules for each AWS service.
- How findings are generated and stored in a logs directory, making it easier to track report generation.
- Calls to external AWS services (if visually relevant), showing that the modules interact with AWS’s public endpoints using the CLI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Main Script: security_check.sh"]:::control
    subgraph "Modules"
        B["Module: EC2/VPC Checks (ec2.sh)"]:::module
        C["Module: IAM Checks (iam.sh)"]:::module
        D["Module: S3 Checks (s3.sh)"]:::module
    end
    E(("Logs (CSV Files)")):::logs
    F["AWS Environment"]:::external

    A -->|"executes"| B
    A -->|"executes"| C
    A -->|"executes"| D

    B -->|"gathers-data"| F
    C -->|"gathers-data"| F
    D -->|"gathers-data"| F

    B -->|"outputs"| E
    C -->|"outputs"| E
    D -->|"outputs"| E

    click A "https://github.com/thatvirdiguy/aws-security-check/blob/master/security_check.sh"
    click B "https://github.com/thatvirdiguy/aws-security-check/blob/master/ec2.sh"
    click C "https://github.com/thatvirdiguy/aws-security-check/blob/master/iam.sh"
    click D "https://github.com/thatvirdiguy/aws-security-check/blob/master/s3.sh"
    click E "https://github.com/thatvirdiguy/aws-security-check/tree/master/logs/"
    click F "https://github.com/thatvirdiguy/aws-security-check/tree/master/aws_cli"

    classDef control fill:#f9c,stroke:#333,stroke-width:2px;
    classDef module fill:#cff,stroke:#333,stroke-width:2px;
    classDef logs fill:#fc9,stroke:#333,stroke-width:2px;
    classDef external fill:#9cf,stroke:#333,stroke-width:2px;
```
