# chanduusc/prismacloud-demo architecture

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

- Interactive diagram: https://gitdiagram.com/chanduusc/prismacloud-demo
- Repository: https://github.com/chanduusc/prismacloud-demo

## Overview

##### Main Components
- CI/CD Pipeline:
- Github repository hosting the code.
- .github folder containing GitHub Actions workflows (aks.yml, eks.yml, gke.yml, lambda.yml, gcp-cloudrun.yml, etc.) that trigger build, deploy, and scan jobs.
- Integration with Prisma Cloud for security scanning (image scans, vulnerability detection during build and PR processes).
- Infrastructure-as-Code (IaC):
- Separate directories under IaC for AKS, EKS, and GKE show how Terraform templates are used to deploy infrastructure. Each folder (IaC/AKS, IaC/EKS, IaC/GKE) contains configuration files like main.tf, variables.tf, and specific resources (ACR, ECR, S3, etc.).
- Application Deployment Components:
- Container Orchestrators:
- Kubernetes configurations (YAML files for deployment, service accounts, ingress, load balancing) placed in the project root (aks-deployment.yml, eks-deployment.yml, gke-deployment.yml, etc.)
- “host” folder: Contains the Python application (app.py, run.py) supporting a host-based deployment.
- Serverless and other form factors:
- “lambda” folder for AWS Lambda based deployments (AWS-Vulnerable-Lambda), integrating with serverless security scanning.
- “gcp-cloudrun” folder with its own Dockerfile and README indicating a Cloud Run deployment.
- Security Stages and Processes:
- Code Security in the IDE: Developers use tools like Checkov (and see copy_to_req file guidance) for early misconfiguration alerts.
- Review/CI Phase: Integration of security tooling that comments on GitHub PRs and blocks code-checkins based on vulnerability scanning.
- Post-build/CD and Deployment:
- Prisma Cloud’s scan of container images (positions in the pipeline where vulnerabilities cause build/deploy failures).
- Dedicated scripts like wild.py in both the project root and within the lambda module hint at deliberate insecure practices to test alerts.
- Runtime Monitoring:
- Several images in the README show monitoring views (k8s audit logs, runtime alerts, and data security alerts).

##### Relationships and Data Flow
- “CI/CD Pipeline” block:
- Branch out to show various GitHub Actions workflows that trigger different jobs (build, deploy, vulnerability scan).
- Jobs to the “Prisma Cloud” security modules (e.g., code security, image scan on container registry).
- IaC deployment side:
- Use separate blocks for AKS, EKS, and GKE clusters (each coming from their respective Terraform modules).
- “Host” containerized application, “Lambda” serverless module, and “Cloud Run” service.
- Finally, illustrate the monitoring and feedback loop:
- Blocks for “Runtime Monitoring” (displaying audit logs, event alerts, compliance dashboards).
- Flow from deployed environments (K8s clusters, Serverless endpoints) feeding data back into Prisma Cloud and then to the SecOps/Production Engineering teams.

##### Architectural Patterns & Design Principles
- Separation of Concerns: Clearly separate source code (host, lambda), infrastructure code (IaC directories), and deployment (YAML files, GitHub workflows).
- Multi-cloud/Multi-form Factor Architecture: Emphasize that the system deploys on multiple clouds and supports varied application paradigms (container-based, host, serverless).
- Secure CI/CD Pipeline: Note the integration of security scanning at every phase from code commit to deployment and runtime monitoring.
- Feedback Loop: Stress how vulnerability detection and audit logs provide continuous feedback for developers, security teams, and production engineers.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Developer & DevOps Layer
    subgraph "Developer & DevOps"
        DE["Developer Environment"]:::developer
    end

    %% Source Code & CI/CD Pipeline Layer
    subgraph "Source Code & CI/CD Pipeline"
        GR["GitHub Repository"]:::cicd
        GHW[".github/workflows"]:::cicd
    end

    %% Infrastructure IaC Layer
    subgraph "Infrastructure IaC"
        AKS["IaC - AKS"]:::infrastructure
        EKS["IaC - EKS"]:::infrastructure
        GKE["IaC - GKE"]:::infrastructure
    end

    %% Application Deployment Layer
    subgraph "Application Deployments"
        K8s["Kubernetes Deployments"]:::deployment
        Host["Host-based Application"]:::deployment
        Lambda["AWS Lambda Deployment"]:::deployment
        CloudRun["GCP Cloud Run Deployment"]:::deployment
    end

    %% Security & Monitoring Layer
    subgraph "Security & Monitoring"
        Prisma["Prisma Cloud Security Scanning"]:::security
        RTMon["Runtime Monitoring"]:::monitoring
        subgraph "Vulnerability Simulation"
            Fake["fake_commits Folder"]:::security
            Wild["wild.py Script"]:::security
        end
    end

    %% Relationships
    DE -->|"commits"| GR
    GR -->|"triggers"| GHW
    GHW -->|"scan"| Prisma

    GHW -->|"deploys"| AKS
    GHW -->|"deploys"| EKS
    GHW -->|"deploys"| GKE

    GHW -->|"deploys"| K8s
    GHW -->|"deploys"| Host
    GHW -->|"deploys"| Lambda
    GHW -->|"deploys"| CloudRun

    Fake -->|"introduces_vulnerabilities"| GHW
    Wild -->|"introduces_vulnerabilities"| GHW

    K8s -->|"monitored"| RTMon
    Host -->|"monitored"| RTMon
    Lambda -->|"monitored"| RTMon
    CloudRun -->|"monitored"| RTMon

    RTMon -->|"feeds_alerts"| Prisma
    Prisma -->|"feedback"| DE

    %% Click Events
    click GHW "https://github.com/chanduusc/prismacloud-demo/tree/main/.github/workflows"
    click AKS "https://github.com/chanduusc/prismacloud-demo/tree/main/IaC/AKS"
    click EKS "https://github.com/chanduusc/prismacloud-demo/tree/main/IaC/EKS"
    click GKE "https://github.com/chanduusc/prismacloud-demo/tree/main/IaC/GKE"
    click K8s "https://github.com/chanduusc/prismacloud-demo/tree/main/Root-level YAML files"
    click Host "https://github.com/chanduusc/prismacloud-demo/tree/main/host"
    click Lambda "https://github.com/chanduusc/prismacloud-demo/tree/main/lambda/AWS-Vulnerable-Lambda"
    click CloudRun "https://github.com/chanduusc/prismacloud-demo/tree/main/gcp-cloudrun"
    click Fake "https://github.com/chanduusc/prismacloud-demo/tree/main/fake_commits"
    click Wild "https://github.com/chanduusc/prismacloud-demo/blob/main/wild.py"

    %% Styles
    classDef developer fill:#d1c4e9,stroke:#673ab7,stroke-width:2px;
    classDef cicd fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef infrastructure fill:#c8e6c9,stroke:#2e7d32,stroke-width:2px;
    classDef deployment fill:#fff9c4,stroke:#f9a825,stroke-width:2px;
    classDef security fill:#ffcdd2,stroke:#c62828,stroke-width:2px;
    classDef monitoring fill:#ffe0b2,stroke:#ef6c00,stroke-width:2px;
```
