# emateo5/tfmciber architecture

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

- Interactive diagram: https://gitdiagram.com/emateo5/tfmciber
- Repository: https://github.com/emateo5/tfmciber

## Overview

El repositorio automatiza análisis SAST y DAST de aplicaciones web mediante GitHub Actions: valida el objetivo, ejecuta Bandit y pip-audit, y usa ZAP con escenarios baseline, stock o afinados. En los afinados, Playwright descubre rutas y prueba flujos como autenticación, XSS, SQLi y CSRF antes del escaneo activo; el escenario tuned-ai añade triaje de alertas con OpenAI y publica informes. Las relaciones de orquestación y varios escenarios se basan en el README; el workflow y la implementación completa de ZAP no se muestrearon.

Main entry points: [`.github/workflows/pipeline.yaml`](https://github.com/emateo5/tfmciber/blob/main/.github/workflows/pipeline.yaml) (Workflow de análisis), [`triage_vulner.py`](https://github.com/emateo5/tfmciber/blob/main/triage_vulner.py) (Triaje de alertas), [`zap/Dockerfile`](https://github.com/emateo5/tfmciber/blob/main/zap/Dockerfile) (OWASP ZAP), [`zap/seed-spa.mjs`](https://github.com/emateo5/tfmciber/blob/main/zap/seed-spa.mjs) (Descubrimiento SPA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Ejecución"]
  node_workflow["Workflow de análisis<br/>[pipeline.yaml]"]
  node_sast["Bandit y pip-audit<br/>[pipeline.yaml]"]
end

subgraph group_scanning["Descubrimiento y escaneo"]
  node_zap_image["Imagen ZAP"]
  node_scan_policy["Política de escaneo<br/>[active-scan.conf]"]
  node_spa_discovery["Descubrimiento SPA<br/>[seed-spa.mjs]"]
  node_browser_tests["Pruebas dinámicas<br/>[seed-spa.mjs]"]
  node_zap["OWASP ZAP"]
end

subgraph group_triage["Triaje y resultados"]
  node_zap_report["Informe ZAP"]
  node_triage["Triaje de alertas<br/>[triage_vulner.py]"]
  node_html_report["Informe de triaje<br/>[triage_vulner.py]"]
  node_artifacts["Artefactos publicados"]
end

node_user(("Operador"))
node_target["Aplicación objetivo"]
node_openai["OpenAI API"]

node_user -->|"inicia ejecución"| node_workflow
node_workflow -->|"selecciona objetivo"| node_target
node_workflow -->|"ejecuta análisis"| node_sast
node_workflow -->|"orquesta escenarios"| node_zap
node_workflow -->|"ejecuta en tuned"| node_spa_discovery
node_spa_discovery -->|"navega y descubre"| node_target
node_spa_discovery -->|"usa proxy"| node_zap
node_workflow -->|"construye tuned"| node_zap_image
node_workflow -->|"configura tuned"| node_scan_policy
node_zap -->|"escanea activamente"| node_target
node_zap -->|"produce informes"| node_zap_report
node_workflow -->|"ejecuta pruebas tuned"| node_browser_tests
node_browser_tests -->|"prueba flujos web"| node_target
node_workflow -->|"invoca tuned-ai"| node_triage
node_triage -->|"lee JSON ZAP"| node_zap_report
node_triage -->|"solicita evaluación"| node_openai
node_triage -->|"genera reporte"| node_html_report
node_workflow -->|"publica resultados"| node_artifacts
node_zap_report -->|"incluye informe bruto"| node_artifacts
node_html_report -->|"incluye tuned-ai"| node_artifacts

click node_workflow "https://github.com/emateo5/tfmciber/blob/main/.github/workflows/pipeline.yaml"
click node_sast "https://github.com/emateo5/tfmciber/blob/main/.github/workflows/pipeline.yaml"
click node_zap_image "https://github.com/emateo5/tfmciber/blob/main/zap/Dockerfile"
click node_scan_policy "https://github.com/emateo5/tfmciber/blob/main/zap/active-scan.conf"
click node_spa_discovery "https://github.com/emateo5/tfmciber/blob/main/zap/seed-spa.mjs"
click node_browser_tests "https://github.com/emateo5/tfmciber/blob/main/zap/seed-spa.mjs"
click node_zap "https://github.com/emateo5/tfmciber/blob/main/zap/Dockerfile"
click node_triage "https://github.com/emateo5/tfmciber/blob/main/triage_vulner.py"
click node_html_report "https://github.com/emateo5/tfmciber/blob/main/triage_vulner.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_workflow,node_sast toneBlue
class node_zap_image,node_scan_policy,node_spa_discovery,node_browser_tests,node_zap toneAmber
class node_zap_report,node_triage,node_html_report,node_artifacts,node_openai toneMint
class node_user,node_target toneIndigo
```

## Components

### Ejecución

- [Workflow de análisis](https://github.com/emateo5/tfmciber/blob/main/.github/workflows/pipeline.yaml): `.github/workflows/pipeline.yaml`
- [Bandit y pip-audit](https://github.com/emateo5/tfmciber/blob/main/.github/workflows/pipeline.yaml): `.github/workflows/pipeline.yaml`

### Descubrimiento y escaneo

- [Imagen ZAP](https://github.com/emateo5/tfmciber/blob/main/zap/Dockerfile): `zap/Dockerfile`
- [Política de escaneo](https://github.com/emateo5/tfmciber/blob/main/zap/active-scan.conf): `zap/active-scan.conf`
- [Descubrimiento SPA](https://github.com/emateo5/tfmciber/blob/main/zap/seed-spa.mjs): `zap/seed-spa.mjs`
- [Pruebas dinámicas](https://github.com/emateo5/tfmciber/blob/main/zap/seed-spa.mjs): `zap/seed-spa.mjs`
- [OWASP ZAP](https://github.com/emateo5/tfmciber/blob/main/zap/Dockerfile): `zap/Dockerfile`

### Triaje y resultados

- **Informe ZAP**
- [Triaje de alertas](https://github.com/emateo5/tfmciber/blob/main/triage_vulner.py): `triage_vulner.py`
- [Informe de triaje](https://github.com/emateo5/tfmciber/blob/main/triage_vulner.py): `triage_vulner.py`
- **Artefactos publicados**

### Other components

- **Operador**
- **Aplicación objetivo**
- **OpenAI API**

## Connections

- Operador → Workflow de análisis: inicia ejecución (evidence: `README.md`)
- Workflow de análisis → Aplicación objetivo: selecciona objetivo (evidence: `README.md`)
- Workflow de análisis → Bandit y pip-audit: ejecuta análisis (evidence: `README.md`)
- Workflow de análisis → OWASP ZAP: orquesta escenarios (evidence: `README.md`)
- Workflow de análisis → Descubrimiento SPA: ejecuta en tuned (evidence: `README.md`)
- Descubrimiento SPA → Aplicación objetivo: navega y descubre (evidence: `zap/seed-spa.mjs`)
- Descubrimiento SPA → OWASP ZAP: usa proxy (evidence: `README.md`)
- Workflow de análisis → Imagen ZAP: construye tuned (evidence: `README.md`)
- Workflow de análisis → Política de escaneo: configura tuned (evidence: `README.md`)
- OWASP ZAP → Aplicación objetivo: escanea activamente (evidence: `README.md`)
- OWASP ZAP → Informe ZAP: produce informes (evidence: `README.md`)
- Workflow de análisis → Pruebas dinámicas: ejecuta pruebas tuned (evidence: `README.md`)
- Pruebas dinámicas → Aplicación objetivo: prueba flujos web (evidence: `zap/seed-spa.mjs`)
- Workflow de análisis → Triaje de alertas: invoca tuned-ai (evidence: `README.md`)
- Triaje de alertas → Informe ZAP: lee JSON ZAP (evidence: `triage_vulner.py`)
- Triaje de alertas → OpenAI API: solicita evaluación (evidence: `triage_vulner.py`)
- Triaje de alertas → Informe de triaje: genera reporte (evidence: `triage_vulner.py`)
- Workflow de análisis → Artefactos publicados: publica resultados (evidence: `README.md`)
- Informe ZAP → Artefactos publicados: incluye informe bruto (evidence: `README.md`)
- Informe de triaje → Artefactos publicados: incluye tuned-ai (evidence: `README.md`)
