# pdfm06/ssa-aula10 architecture

> Architecture diagram of the GitHub repository pdfm06/ssa-aula10, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/pdfm06/ssa-aula10
- Repository: https://github.com/pdfm06/ssa-aula10

## Overview

This repository is a local DevSecOps classroom lab: users can explore a synthetic-data FastAPI app, while learners progressively build and run a Jenkins security pipeline. The app serves a home page, health check, and owner-filtered works; the works route delegates to an intentionally unsafe SQL lookup. The README describes the intended pipeline stages, but says the checked-in pipeline initially only checks out code and verifies Docker. Scanner-stage links therefore describe documented additions, not verified current Jenkins wiring.

Main entry points: [`Jenkinsfile`](https://github.com/pdfm06/ssa-aula10/blob/main/Jenkinsfile) (Pipeline definition), [`app/main.py`](https://github.com/pdfm06/ssa-aula10/blob/main/app/main.py) (FastAPI app), [`app/security.py`](https://github.com/pdfm06/ssa-aula10/blob/main/app/security.py) (Works lookup), [`compose.yaml`](https://github.com/pdfm06/ssa-aula10/blob/main/compose.yaml) (Jenkins service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Classroom app"]
  node_webapp["FastAPI app<br/>[main.py]"]
  node_home["Home and health<br/>[main.py]"]
  node_worksroute["Works route<br/>[main.py]"]
end

subgraph group_data["Works lookup"]
  node_lookup["Works lookup<br/>[security.py]"]
  node_sqlite[("In-memory SQLite<br/>[security.py]")]
end

subgraph group_pipeline["Lab pipeline"]
  node_jenkins["Jenkins service<br/>[compose.yaml]"]
  node_pipelinefile["Pipeline definition"]
  node_image["App image build"]
  node_startup["App startup<br/>[main.py]"]
end

subgraph group_security["Security checks"]
  node_sca["Dependency SCA<br/>[requirements.txt]"]
  node_bandit["Bandit SAST<br/>[Dockerfile.bandit]"]
  node_imagecheck["Image scan"]
  node_zap["ZAP Baseline<br/>[zap-rules.tsv]"]
  node_evaluate["Report evaluation<br/>[evaluate.py]"]
end

node_learner(("Learner"))
node_visitor(("App visitor"))
node_github["Forked repository"]

node_visitor -->|"opens app"| node_webapp
node_webapp -->|"serves routes"| node_home
node_webapp -->|"serves routes"| node_worksroute
node_worksroute -->|"calls lookup"| node_lookup
node_lookup -->|"queries"| node_sqlite
node_learner -->|"commits changes"| node_github
node_github -->|"checks out SCM"| node_jenkins
node_jenkins -->|"runs pipeline"| node_pipelinefile
node_pipelinefile -.->|"add SCA stage"| node_sca
node_pipelinefile -.->|"add SAST stage"| node_bandit
node_pipelinefile -.->|"add image build"| node_image
node_pipelinefile -.->|"add image scan"| node_imagecheck
node_pipelinefile -.->|"add app startup"| node_startup
node_pipelinefile -.->|"add baseline scan"| node_zap
node_pipelinefile -.->|"evaluate reports"| node_evaluate

click node_webapp "https://github.com/pdfm06/ssa-aula10/blob/main/app/main.py"
click node_home "https://github.com/pdfm06/ssa-aula10/blob/main/app/main.py"
click node_worksroute "https://github.com/pdfm06/ssa-aula10/blob/main/app/main.py"
click node_lookup "https://github.com/pdfm06/ssa-aula10/blob/main/app/security.py"
click node_sqlite "https://github.com/pdfm06/ssa-aula10/blob/main/app/security.py"
click node_jenkins "https://github.com/pdfm06/ssa-aula10/blob/main/compose.yaml"
click node_pipelinefile "https://github.com/pdfm06/ssa-aula10/blob/main/Jenkinsfile"
click node_image "https://github.com/pdfm06/ssa-aula10/blob/main/Dockerfile"
click node_sca "https://github.com/pdfm06/ssa-aula10/blob/main/requirements.txt"
click node_bandit "https://github.com/pdfm06/ssa-aula10/blob/main/ci/Dockerfile.bandit"
click node_imagecheck "https://github.com/pdfm06/ssa-aula10/blob/main/Jenkinsfile"
click node_startup "https://github.com/pdfm06/ssa-aula10/blob/main/app/main.py"
click node_zap "https://github.com/pdfm06/ssa-aula10/blob/main/ci/zap-rules.tsv"
click node_evaluate "https://github.com/pdfm06/ssa-aula10/blob/main/ci/evaluate.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_webapp,node_home,node_worksroute toneBlue
class node_lookup,node_sqlite toneAmber
class node_jenkins,node_pipelinefile,node_image,node_startup toneMint
class node_sca,node_bandit,node_imagecheck,node_zap,node_evaluate toneRose
class node_learner,node_visitor,node_github toneIndigo
```

## Components

### Classroom app

- [FastAPI app](https://github.com/pdfm06/ssa-aula10/blob/main/app/main.py): `app/main.py`
- [Home and health](https://github.com/pdfm06/ssa-aula10/blob/main/app/main.py): `app/main.py`
- [Works route](https://github.com/pdfm06/ssa-aula10/blob/main/app/main.py): `app/main.py`

### Works lookup

- [Works lookup](https://github.com/pdfm06/ssa-aula10/blob/main/app/security.py): `app/security.py`
- [In-memory SQLite](https://github.com/pdfm06/ssa-aula10/blob/main/app/security.py): `app/security.py`

### Lab pipeline

- [Jenkins service](https://github.com/pdfm06/ssa-aula10/blob/main/compose.yaml): `compose.yaml`
- [Pipeline definition](https://github.com/pdfm06/ssa-aula10/blob/main/Jenkinsfile): `Jenkinsfile`
- [App image build](https://github.com/pdfm06/ssa-aula10/blob/main/Dockerfile): `Dockerfile`
- [App startup](https://github.com/pdfm06/ssa-aula10/blob/main/app/main.py): `app/main.py`

### Security checks

- [Dependency SCA](https://github.com/pdfm06/ssa-aula10/blob/main/requirements.txt): `requirements.txt`
- [Bandit SAST](https://github.com/pdfm06/ssa-aula10/blob/main/ci/Dockerfile.bandit): `ci/Dockerfile.bandit`
- [Image scan](https://github.com/pdfm06/ssa-aula10/blob/main/Jenkinsfile): `Jenkinsfile`
- [ZAP Baseline](https://github.com/pdfm06/ssa-aula10/blob/main/ci/zap-rules.tsv): `ci/zap-rules.tsv`
- [Report evaluation](https://github.com/pdfm06/ssa-aula10/blob/main/ci/evaluate.py): `ci/evaluate.py`

### Other components

- **Learner**
- **App visitor**
- **Forked repository**

## Connections

- App visitor → FastAPI app: opens app (evidence: `README.md`)
- FastAPI app → Home and health: serves routes (evidence: `app/main.py`)
- FastAPI app → Works route: serves routes (evidence: `app/main.py`)
- Works route → Works lookup: calls lookup (evidence: `app/main.py`)
- Works lookup → In-memory SQLite: queries (evidence: `app/security.py`)
- Learner → Forked repository: commits changes (evidence: `README.md`)
- Forked repository → Jenkins service: checks out SCM (evidence: `README.md`)
- Jenkins service → Pipeline definition: runs pipeline (evidence: `README.md`)
- Pipeline definition → Dependency SCA: add SCA stage (evidence: `README.md`)
- Pipeline definition → Bandit SAST: add SAST stage (evidence: `README.md`)
- Pipeline definition → App image build: add image build (evidence: `README.md`)
- Pipeline definition → Image scan: add image scan (evidence: `README.md`)
- Pipeline definition → App startup: add app startup (evidence: `README.md`)
- Pipeline definition → ZAP Baseline: add baseline scan (evidence: `README.md`)
- Pipeline definition → Report evaluation: evaluate reports
