# system-sudo/devsecops-zero-to-hero architecture

> Architecture diagram of the GitHub repository system-sudo/devsecops-zero-to-hero, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/system-sudo/devsecops-zero-to-hero
- Repository: https://github.com/system-sudo/devsecops-zero-to-hero

## Overview

1. This repository is primarily a **DevSecOps training and lab repo**, not a production application. Its architecture is documentation-led: most of the repo is organized into numbered learning modules (`01-Introduction` through `07-DevSecOps-Pipeline`) that form a staged curriculum.

2. The **core content layer** is the set of Markdown guides. Each top-level numbered folder maps to one DevSecOps domain:
   - Introduction / threat modeling
   - Git security
   - IaC security
   - Container security
   - DAST
   - Runtime security
   - End-to-end pipeline design  
   These modules are the “source of truth” for the training flow and are intended to be consumed sequentially.

3. The **Git security subsystem** is represented by repository-level safeguards:
   - `.pre-commit-config.yaml` for local developer checks
   - `.github/workflows/gitleaks-worflow.yaml` for CI secret scanning
   - `.gitignore` for preventing accidental commits of sensitive or generated files  
   This layer models the “shift left” boundary where secrets are blocked before merge.

4. The **IaC security subsystem** lives in `terraform/` and especially `terraform/main.tf`. It provides an infrastructure example that can be scanned and reviewed as part of the labs. This is the repository’s main provisioning boundary: code defines infrastructure, then security tools evaluate the configuration before deployment.

5. The **container security subsystem** is the only visible executable application sample in the repo: `04-Container-Security/app.js` plus `04-Container-Security/package.json`. This is likely a small Node.js demo app used to illustrate container hardening, image scanning, and secure-by-default packaging rather than serving as a full product backend.

6. The **DAST and API security area** is documentation-only (`05-DAST/*`). It frames the runtime testing phase of the pipeline: once an app is deployed, external scanners such as OWASP ZAP are meant to attack the running target from the outside. This creates a clear boundary between build-time controls and post-deploy validation.

7. The **runtime security area** (`06-Runtime-Security/*`) focuses on monitoring and policy enforcement after deployment. The docs explicitly point to Falco and compliance-as-code, which implies a runtime detection layer observing containers/Kubernetes activity and alerting on suspicious behavior.

8. The **end-to-end pipeline subsystem** (`07-DevSecOps-Pipeline/*`) ties the repo together conceptually. The README describes a “golden pipeline” with ordered gates:
   - secret scanning at commit time
   - SAST/SCA in build
   - IaC scanning during provisioning
   - DAST after deployment
   - AI-assisted remediation  
   This is the main data flow model the repo teaches.

9. The **automation/integration layer** is GitHub-centric. `.github/workflows/infra-create.yml` suggests infrastructure provisioning automation, while the Gitleaks workflow enforces repository scanning in CI. The repository therefore uses GitHub Actions as the orchestration plane for security checks and infrastructure-related tasks.

10. There is an implicit **control flow from developer workstation to CI to runtime**:
    - developer writes code/docs/IaC
    - pre-commit and local git rules catch issues early
    - GitHub Actions scans secrets and manages infra tasks
    - Terraform defines deployable infrastructure
    - container/app artifacts are tested for security
    - DAST and runtime tooling validate the live environment  
    This is the architecture most useful to diagram: a layered DevSecOps lifecycle, not a single application stack.

11. The repo’s **main boundary** is between educational content and executable examples. Markdown drives the curriculum, while Terraform, GitHub workflows, and the Node sample app provide hands-on artifacts that the training materials reference.

12. In short, the repository is a **security training platform built from documentation plus a few concrete lab assets**. Its architecture is best drawn as a sequence of security gates around a minimal sample app and Terraform infrastructure, all coordinated through GitHub-based automation.

Main entry points: [`07-DevSecOps-Pipeline/01-Introduction.md`](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/07-DevSecOps-Pipeline/01-Introduction.md) (Pipeline), [`02-Git/README.md`](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/02-Git/README.md) (Git Security), [`04-Container-Security/README.md`](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/04-Container-Security/README.md) (Container Security), [`03-IaC/01-Checkov.md`](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/03-IaC/01-Checkov.md) (IaC Security)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Curriculum"]
  node_readme["README<br/>entry guide<br/>[README.md]"]
  node_intro["Introduction<br/>[01-DevSecOps.md]"]
  node_gitsec["Git Security<br/>[README.md]"]
  node_iacsec["IaC Security<br/>[01-Checkov.md]"]
  node_containersec["Container Security<br/>[README.md]"]
  node_dast["DAST<br/>[README.md]"]
  node_runtime["Runtime Security"]
  node_pipeline["Pipeline<br/>[01-Introduction.md]"]
end

subgraph group_controls["Security Controls"]
  node_precommit["Pre-commit<br/>git guard"]
  node_gitleaks["Secret Scan<br/>ci workflow"]
  node_gitignore["Ignore Rules<br/>repo guard<br/>[.gitignore]"]
end

subgraph group_labs["Lab Artifacts"]
  node_terraform["Terraform<br/>infra spec<br/>[main.tf]"]
  node_sampleapp["Sample App<br/>node app<br/>[app.js]"]
  node_package["Package<br/>node manifest<br/>[package.json]"]
end

subgraph group_automation["Automation"]
  node_infrawf["Infra Create<br/>ci workflow<br/>[infra-create.yml]"]
  node_githubactions["GitHub Actions<br/>orchestration"]
end

node_readme -->|"starts"| node_intro
node_intro -->|"next"| node_gitsec
node_gitsec -->|"next"| node_iacsec
node_iacsec -->|"next"| node_containersec
node_containersec -->|"next"| node_dast
node_dast -->|"next"| node_runtime
node_runtime -->|"next"| node_pipeline
node_gitsec -->|"enforces"| node_precommit
node_gitsec -->|"enforces"| node_gitleaks
node_gitsec -->|"supports"| node_gitignore
node_iacsec -->|"reviews"| node_terraform
node_containersec -->|"uses"| node_sampleapp
node_containersec -->|"packages"| node_package
node_githubactions -->|"runs"| node_gitleaks
node_githubactions -->|"runs"| node_infrawf
node_infrawf -->|"applies"| node_terraform
node_pipeline -->|"gates"| node_precommit
node_pipeline -->|"gates"| node_gitleaks
node_pipeline -->|"gates"| node_terraform
node_pipeline -->|"gates"| node_dast
node_pipeline -->|"gates"| node_runtime
node_sampleapp -->|"feeds"| node_githubactions

click node_readme "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/README.md"
click node_intro "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/01-Introduction/01-DevSecOps.md"
click node_gitsec "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/02-Git/README.md"
click node_iacsec "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/03-IaC/01-Checkov.md"
click node_containersec "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/04-Container-Security/README.md"
click node_dast "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/05-DAST/README.md"
click node_runtime "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/06-Runtime-Security/01-what-is-runtime-security.md"
click node_pipeline "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/07-DevSecOps-Pipeline/01-Introduction.md"
click node_precommit "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/.pre-commit-config.yaml"
click node_gitleaks "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/.github/workflows/gitleaks-worflow.yaml"
click node_gitignore "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/.gitignore"
click node_infrawf "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/.github/workflows/infra-create.yml"
click node_terraform "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/terraform/main.tf"
click node_sampleapp "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/04-Container-Security/app.js"
click node_package "https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/04-Container-Security/package.json"

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_readme,node_intro,node_gitsec,node_iacsec,node_containersec,node_dast,node_runtime,node_pipeline toneBlue
class node_precommit,node_gitleaks,node_gitignore toneAmber
class node_terraform,node_sampleapp,node_package toneMint
class node_infrawf,node_githubactions toneRose
```

## Components

### Curriculum

Numbered learning modules and repository entrypoints.

- [README](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/README.md): entry guide · Top-level orientation for the training repo. · `README.md`
- [Introduction](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/01-Introduction/01-DevSecOps.md): module · DevSecOps, shift-left, and threat modeling foundations. · `01-Introduction/01-DevSecOps.md`
- [Git Security](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/02-Git/README.md): module · Repository hygiene and secret-prevention practices. · `02-Git/README.md`
- [IaC Security](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/03-IaC/01-Checkov.md): module · Infrastructure scanning and secure provisioning concepts. · `03-IaC/01-Checkov.md`
- [Container Security](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/04-Container-Security/README.md): module · Hardening and scanning for containerized workloads. · `04-Container-Security/README.md`
- [DAST](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/05-DAST/README.md): module · External security testing against a running target. · `05-DAST/README.md`
- [Runtime Security](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/06-Runtime-Security/01-what-is-runtime-security.md): module · Post-deploy detection, monitoring, and policy enforcement. · `06-Runtime-Security/01-what-is-runtime-security.md`
- [Pipeline](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/07-DevSecOps-Pipeline/01-Introduction.md): module · End-to-end DevSecOps flow and gate sequencing. · `07-DevSecOps-Pipeline/01-Introduction.md`

### Security Controls

Shift-left, CI, and policy layers that enforce the labs.

- [Pre-commit](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/.pre-commit-config.yaml): git guard · Local checks that block risky changes before commit. · `.pre-commit-config.yaml`
- [Secret Scan](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/.github/workflows/gitleaks-worflow.yaml): ci workflow · GitHub Actions secret scanning for repository content. · `.github/workflows/gitleaks-worflow.yaml`
- [Ignore Rules](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/.gitignore): repo guard · Prevents generated or sensitive files from being tracked. · `.gitignore`

### Lab Artifacts

Concrete sample code and infrastructure used by the training material.

- [Terraform](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/terraform/main.tf): infra spec · Provisioning boundary for deployable infrastructure. · `terraform/main.tf`
- [Sample App](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/04-Container-Security/app.js): node app · Minimal Node.js application used in container labs. · `04-Container-Security/app.js`
- [Package](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/04-Container-Security/package.json): node manifest · Dependency and runtime metadata for the sample app. · `04-Container-Security/package.json`

### Automation

GitHub-centric orchestration for scans and provisioning.

- [Infra Create](https://github.com/system-sudo/devsecops-zero-to-hero/blob/main/.github/workflows/infra-create.yml): ci workflow · GitHub automation for infrastructure-related tasks. · `.github/workflows/infra-create.yml`
- **GitHub Actions**: orchestration · CI plane coordinating scans and infra automation.

## Connections

- README → Introduction: starts · Repository orientation begins with the DevSecOps foundation.
- Introduction → Git Security: next · Moves from concepts to source-control safeguards.
- Git Security → IaC Security: next · Progresses into infrastructure-as-code security.
- IaC Security → Container Security: next · Shifts from provisioning to container hardening.
- Container Security → DAST: next · Transitions from build-time controls to external testing.
- DAST → Runtime Security: next · Moves from pre-release attack simulation to live monitoring.
- Runtime Security → Pipeline: next · Converges the learned controls into an end-to-end pipeline.
- Git Security → Pre-commit: enforces · Local developer checks implement shift-left guardrails.
- Git Security → Secret Scan: enforces · CI secret scanning backs up local repository hygiene.
- Git Security → Ignore Rules: supports · Ignore rules reduce accidental leakage into version control.
- IaC Security → Terraform: reviews · Terraform is the concrete provisioning artifact for scanning.
- Container Security → Sample App: uses · The sample app is the lab target for container security exercises.
- Container Security → Package: packages · Node metadata defines how the sample app is built and run.
- GitHub Actions → Secret Scan: runs · Actions executes secret scanning in CI.
- GitHub Actions → Infra Create: runs · Actions orchestrates infrastructure automation.
- Infra Create → Terraform: applies · Provisioning workflow consumes the Terraform boundary.
- Pipeline → Pre-commit: gates · The golden pipeline starts with commit-time controls.
- Pipeline → Secret Scan: gates · Repository scanning is a central pipeline stage.
- Pipeline → Terraform: gates · IaC scanning sits in the provisioning phase.
- Pipeline → DAST: gates · DAST is positioned after deployment.
- Pipeline → Runtime Security: gates · Runtime security validates the live environment.
- Sample App → GitHub Actions: feeds · The application is built and checked through the CI plane.
