# cloud-village/rsac-2025-lab architecture

> Architecture diagram of the GitHub repository cloud-village/rsac-2025-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cloud-village/rsac-2025-lab
- Repository: https://github.com/cloud-village/rsac-2025-lab

## Overview

##### Project type and purpose
- This repository is a Cloud CTF lab (“rsac-2025-lab”) containing challenge modules and solutions for AWS, GCP, and Azure.
- It is not a traditional full-stack app but an “Infrastructure-as-Code + exploit scripts” collection designed to teach cloud security via hands-on challenges.

##### File structure
- Top-level directories:
- AWS_RSAC25 – three AWS challenges (c1, c2, c3)
- GCP_RSAC2 – two GCP challenges (g1, g2)
- Azure_RSAC25 – Azure CTF PDF (no IaC code provided)
- assets/ – Terraform files (main.tf, variables.tf, outputs.tf, terraform.tfvars) plus keys, Dockerfiles, or Python apps
- solutions/ – shell scripts or Python scripts to automate the exploit and Markdown write-ups
- Ancillary files: global README.md, .gitignore, CTF PDFs

##### README for additional insights
- The README simply states “Files for RSAC 2025 Lab: CTF-T09-Cloud-CTF-201.”

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Developer
    Dev["Developer Workstation\n(Terraform CLI & Exploit Runner)"]:::dev

    %% AWS Challenges
    subgraph "AWS Challenges" 
        direction TB
        subgraph "c1: EC2 Metadata Challenge"
            direction TB
            AWS_c1_TF["Terraform Module\n(c1/assets)"]:::iac
            AWS_c1_Resource["EC2 Instance\n+ IAM Metadata"]:::service
            AWS_c1_Exploit["auto_metadata_creds.sh"]:::exploit
            AWS_c1_Docs["solution.md"]:::docs
        end
        subgraph "c2: Lambda Function Challenge"
            direction TB
            AWS_c2_TF["Terraform Module\n(c2/assets)"]:::iac
            AWS_c2_Resource["Lambda Function\n+ IAM Role"]:::service
            AWS_c2_Exploit1["give_me_creds.sh"]:::exploit
            AWS_c2_Exploit2["lambda/main.py"]:::exploit
            AWS_c2_Docs1["solutions.md"]:::docs
            AWS_c2_Docs2["gitlab_commit.md"]:::docs
        end
        subgraph "c3: Cross-Account IAM Assume-Role"
            direction TB
            AWS_c3_TF["Terraform Module\n(c3/assets)"]:::iac
            AWS_c3_Resource["IAM Roles\nCross-Account"]:::service
            AWS_c3_Exploit1["assume-admin-mode.py"]:::exploit
            AWS_c3_Exploit2["assume-attack-mode.py"]:::exploit
            AWS_c3_Docs["solution.md"]:::docs
        end
    end

    %% GCP Challenges
    subgraph "GCP Challenges"
        direction TB
        subgraph "g1: Cloud Run Backdoor"
            direction TB
            GCP_g1_TF["Terraform Module\n(g1/assets)"]:::iac
            GCP_g1_Resource["Cloud Run Service\n+ Docker Backdoor"]:::service
            GCP_g1_Exploit1["cloudrun-backdoor/Dockerfile"]:::exploit
            GCP_g1_Exploit2["cloudrun-backdoor/app.py"]:::exploit
            GCP_g1_Key["player-key.json"]:::exploit
            GCP_g1_Docs["solution.md"]:::docs
        end
        subgraph "g2: IAM/Function Challenge"
            direction TB
            GCP_g2_TF["Terraform Module\n(g2/assets)"]:::iac
            GCP_g2_Resource["IAM Policy\n/ Cloud Function"]:::service
            GCP_g2_Docs["solution.md"]:::docs
        end
    end

    %% Azure Overview
    subgraph "Azure Challenge Overview"
        direction TB
        Azure_Docs["CTF-T09-Cloud-CTF-201_Azure.pdf"]:::docs
    end

    %% Ancillary Files
    GitIgnore[".gitignore"]:::docs
    License["LICENSE"]:::docs
    Readme["README.md"]:::docs

    %% Provisioning Flows
    Dev -->|"run Terraform"| AWS_c1_TF
    Dev -->|"run Terraform"| AWS_c2_TF
    Dev -->|"run Terraform"| AWS_c3_TF
    Dev -->|"run Terraform"| GCP_g1_TF
    Dev -->|"run Terraform"| GCP_g2_TF

    AWS_c1_TF -->|"provisions"| AWS_c1_Resource
    AWS_c2_TF -->|"provisions"| AWS_c2_Resource
    AWS_c3_TF -->|"provisions"| AWS_c3_Resource
    GCP_g1_TF -->|"provisions"| GCP_g1_Resource
    GCP_g2_TF -->|"provisions"| GCP_g2_Resource

    %% Exploit Flows
    Dev -->|"execute"| AWS_c1_Exploit
    AWS_c1_Exploit -->|"access metadata"| AWS_c1_Resource
    AWS_c1_Exploit -->|"exfiltrate creds"| Dev

    Dev -->|"execute"| AWS_c2_Exploit1
    Dev -->|"invoke"| AWS_c2_Exploit2
    AWS_c2_Exploit1 -->|"exploit Lambda"| AWS_c2_Resource
    AWS_c2_Exploit2 -->|"trigger backdoor"| AWS_c2_Resource

    Dev -->|"execute"| AWS_c3_Exploit1
    Dev -->|"execute"| AWS_c3_Exploit2
    AWS_c3_Exploit1 -->|"assume role"| AWS_c3_Resource
    AWS_c3_Exploit2 -->|"assume role"| AWS_c3_Resource

    Dev -->|"analyze image"| GCP_g1_Exploit1
    Dev -->|"run backdoor"| GCP_g1_Exploit2
    GCP_g1_Exploit1 -->|"build image"| GCP_g1_Resource
    GCP_g1_Exploit2 -->|"deploy backdoor"| GCP_g1_Resource
    Dev -->|"use key"| GCP_g1_Key

    %% Documentation and Ancillary
    Dev --> Readme
    Dev --> GitIgnore
    Dev --> License
    Dev --> Azure_Docs

    %% Click Events
    click Dev "https://github.com/cloud-village/rsac-2025-lab/blob/main/README.md"
    click AWS_c1_TF "https://github.com/cloud-village/rsac-2025-lab/tree/main/AWS_RSAC25/c1/assets"
    click AWS_c1_Exploit "https://github.com/cloud-village/rsac-2025-lab/blob/main/AWS_RSAC25/c1/solutions/auto_metadata_creds.sh"
    click AWS_c1_Docs "https://github.com/cloud-village/rsac-2025-lab/blob/main/AWS_RSAC25/c1/solutions/solution.md"
    click AWS_c2_TF "https://github.com/cloud-village/rsac-2025-lab/tree/main/AWS_RSAC25/c2/assets"
    click AWS_c2_Exploit2 "https://github.com/cloud-village/rsac-2025-lab/blob/main/AWS_RSAC25/c2/assets/lambda/main.py"
    click AWS_c2_Exploit1 "https://github.com/cloud-village/rsac-2025-lab/blob/main/AWS_RSAC25/c2/assets/give_me_creds.sh"
    click AWS_c2_Docs1 "https://github.com/cloud-village/rsac-2025-lab/blob/main/AWS_RSAC25/c2/solutions/solutions.md"
    click AWS_c2_Docs2 "https://github.com/cloud-village/rsac-2025-lab/blob/main/AWS_RSAC25/c2/solutions/gitlab_commit.md"
    click AWS_c3_TF "https://github.com/cloud-village/rsac-2025-lab/tree/main/AWS_RSAC25/c3/assets"
    click AWS_c3_Exploit1 "https://github.com/cloud-village/rsac-2025-lab/blob/main/AWS_RSAC25/c3/solutions/assume-admin-mode.py"
    click AWS_c3_Exploit2 "https://github.com/cloud-village/rsac-2025-lab/blob/main/AWS_RSAC25/c3/solutions/assume-attack-mode.py"
    click AWS_c3_Docs "https://github.com/cloud-village/rsac-2025-lab/blob/main/AWS_RSAC25/c3/solutions/solution.md"
    click GCP_g1_TF "https://github.com/cloud-village/rsac-2025-lab/tree/main/GCP_RSAC2/g1/assets"
    click GCP_g1_Exploit1 "https://github.com/cloud-village/rsac-2025-lab/tree/main/GCP_RSAC2/g1/assets/cloudrun-backdoor/Dockerfile"
    click GCP_g1_Exploit2 "https://github.com/cloud-village/rsac-2025-lab/blob/main/GCP_RSAC2/g1/assets/cloudrun-backdoor/app.py"
    click GCP_g1_Key "https://github.com/cloud-village/rsac-2025-lab/blob/main/GCP_RSAC2/g1/assets/player-key.json"
    click GCP_g1_Docs "https://github.com/cloud-village/rsac-2025-lab/blob/main/GCP_RSAC2/g1/solution/solution.md"
    click GCP_g2_TF "https://github.com/cloud-village/rsac-2025-lab/tree/main/GCP_RSAC2/g2/assets"
    click GCP_g2_Docs "https://github.com/cloud-village/rsac-2025-lab/blob/main/GCP_RSAC2/g2/solution/solution.md"
    click Azure_Docs "https://github.com/cloud-village/rsac-2025-lab/blob/main/Azure_RSAC25/CTF-T09-Cloud-CTF-201_Azure.pdf"
    click GitIgnore "https://github.com/cloud-village/rsac-2025-lab/blob/main/.gitignore"
    click License "https://github.com/cloud-village/rsac-2025-lab/tree/main/LICENSE"

    %% Styles
    classDef dev fill:#f9f,stroke:#333,stroke-width:2px
    classDef iac fill:#bbf,stroke:#333,stroke-width:1px
    classDef exploit fill:#fbb,stroke:#333,stroke-width:1px
    classDef service fill:#bfb,stroke:#333,stroke-width:1px
    classDef docs fill:#eee,stroke:#333,stroke-width:1px
```
