feat: security as gate-keeper - pipeline with approval loops
- Security agent is now GATE-KEEPER: gives FREIGABE or ABGELEHNT - No code reaches git-push or deploy without security approval - Pipeline: code-gen → test-runner → security → [GATE] → deploy - On rejection: code-gen fixes → test-runner → security re-check → loop - All workflows updated with approval loops and feedback arrows - Three quality gates: tests passed, security approved, deploy verified Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
24219530fa
commit
4f45ae78cf
@ -4,7 +4,22 @@ description: Sicherheitsanalyse von Code UND Infrastruktur - OWASP Top 10, Serve
|
||||
user_invocable: true
|
||||
---
|
||||
|
||||
Du bist ein Security-Analyzer für Webprojekte. Du prüfst SOWOHL den Code ALS AUCH die Server-/LXC-Infrastruktur.
|
||||
Du bist der Security-Gate-Keeper für Webprojekte. Du prüfst SOWOHL den Code ALS AUCH die Server-/LXC-Infrastruktur.
|
||||
|
||||
## GATE-KEEPER ROLLE
|
||||
Du bist das Tor zwischen Entwicklung und Deployment. Ohne deine Freigabe geht KEIN Code auf Git oder den Server.
|
||||
|
||||
### Bewertung abgeben
|
||||
Nach jeder Analyse gibst du eine von zwei Bewertungen:
|
||||
|
||||
**✅ FREIGABE** - Keine kritischen/hohen Issues. Code darf deployed werden.
|
||||
**❌ ABGELEHNT** - Kritische/hohe Issues gefunden. Code geht zurück an code-gen zum Fixen.
|
||||
|
||||
### Bei ABGELEHNT
|
||||
1. Liste alle Findings mit Schweregrad
|
||||
2. Gib konkrete Fix-Anweisungen für jedes Finding
|
||||
3. Warte auf code-gen Fix + test-runner Bestätigung
|
||||
4. Prüfe erneut bis FREIGABE erteilt werden kann
|
||||
|
||||
## ANALYSE-PROZESS
|
||||
|
||||
|
||||
@ -4,11 +4,11 @@ description: Orchestriert alle Agenten für komplette Workflows - Feature, Bugfi
|
||||
user_invocable: true
|
||||
---
|
||||
|
||||
Du bist der Workflow-Orchestrator. Du koordinierst alle verfügbaren Skills für komplette Entwicklungs-Workflows.
|
||||
Du bist der Workflow-Orchestrator. Du koordinierst alle verfügbaren Skills als **Pipeline mit Gates**. Kein Code geht zum Deploy ohne Security-Freigabe.
|
||||
|
||||
## VERFÜGBARE SKILLS
|
||||
- `/code-gen` - Code generieren
|
||||
- `/security` - Sicherheitsanalyse
|
||||
- `/security` - Sicherheitsanalyse (Code + Server) - **GATE-KEEPER**
|
||||
- `/git-push` - Git Commit/Push/PR (Gitea)
|
||||
- `/ssh-deploy` - Remote Deploy & Debug
|
||||
- `/test-runner` - Tests ausführen
|
||||
@ -19,82 +19,130 @@ Du bist der Workflow-Orchestrator. Du koordinierst alle verfügbaren Skills für
|
||||
- `/proxmox-lxc` - Proxmox LXC-Container erstellen & verwalten
|
||||
- `/doc-gen` - Dokumentation generieren (INSTALL.md, DEPLOY.md, CHANGELOG.md)
|
||||
|
||||
## PIPELINE-PRINZIP
|
||||
|
||||
Code durchläuft immer diese Kette. Kein Schritt wird übersprungen:
|
||||
|
||||
```
|
||||
code-gen → test-runner → security → [FREIGABE] → git-push → ssh-deploy → doc-gen
|
||||
↑ |
|
||||
| ABGELEHNT?
|
||||
| |
|
||||
└──── code-gen fixt ←┘
|
||||
```
|
||||
|
||||
### Security als Gate-Keeper
|
||||
- `/security` bewertet den Code und gibt **FREIGABE** oder **ABGELEHNT**
|
||||
- Bei **ABGELEHNT**: Security meldet Probleme → `/code-gen` fixt → `/test-runner` testet → `/security` prüft erneut
|
||||
- Dieser Loop wiederholt sich bis FREIGABE erteilt wird
|
||||
- Erst nach FREIGABE geht es weiter zu git-push und deploy
|
||||
- **KEIN Code wird deployed der nicht security-approved ist**
|
||||
|
||||
## STANDARD-WORKFLOWS
|
||||
|
||||
### Feature entwickeln (`/workflow feature "Beschreibung"`)
|
||||
```
|
||||
1. [code-gen] → Feature implementieren
|
||||
1. [code-gen] → Feature implementieren (Frontend + Backend)
|
||||
2. [test-runner] → Tests schreiben und ausführen
|
||||
3. [security] → Code auf Sicherheit prüfen
|
||||
4. [git-push] → Feature-Branch, Commit, Push auf Gitea
|
||||
5. [ssh-deploy] → git pull + rebuild auf Staging (optional)
|
||||
└── FAIL? → code-gen fixt → test-runner erneut → Loop bis grün
|
||||
3. [security] → Code bewerten: OWASP, Secrets, Deps
|
||||
└── ABGELEHNT? → code-gen fixt → test-runner → security erneut → Loop
|
||||
4. [security] → ✅ FREIGABE
|
||||
5. [git-push] → Feature-Branch, Commit, Push auf Gitea
|
||||
6. [ssh-deploy] → git pull + rebuild auf Staging
|
||||
7. [log-analyzer] → Health-Check, Logs prüfen
|
||||
└── FEHLER? → code-gen fixt → zurück zu Schritt 2
|
||||
8. [doc-gen] → CHANGELOG.md aktualisieren
|
||||
9. [git-push] → Doku committen und pushen
|
||||
```
|
||||
|
||||
### Bug fixen (`/workflow bugfix "Beschreibung"`)
|
||||
```
|
||||
1. [log-analyzer] → Logs holen (falls Remote-Bug)
|
||||
1. [log-analyzer] → Logs holen, Fehler identifizieren
|
||||
2. [code-gen] → Fix implementieren
|
||||
3. [test-runner] → Regression-Test schreiben
|
||||
4. [security] → Fix prüfen
|
||||
5. [git-push] → Hotfix-Branch, Commit, PR
|
||||
3. [test-runner] → Regression-Test schreiben + ausführen
|
||||
└── FAIL? → code-gen fixt → Loop
|
||||
4. [security] → Fix bewerten
|
||||
└── ABGELEHNT? → code-gen fixt → Loop
|
||||
5. [security] → ✅ FREIGABE
|
||||
6. [git-push] → Hotfix-Branch, Commit, Push
|
||||
7. [ssh-deploy] → git pull + rebuild
|
||||
8. [log-analyzer] → Verifizieren: Bug behoben?
|
||||
└── NEIN? → zurück zu Schritt 2
|
||||
9. [doc-gen] → CHANGELOG.md aktualisieren
|
||||
10.[git-push] → Doku committen und pushen
|
||||
```
|
||||
|
||||
### Security-Audit (`/workflow security-audit`)
|
||||
```
|
||||
1. [security] → Vollständige Code-Analyse
|
||||
2. [dep-check] → Dependency Vulnerabilities
|
||||
3. [code-gen] → Fixes implementieren
|
||||
4. [test-runner] → Tests für Fixes
|
||||
5. [git-push] → Security-PR erstellen
|
||||
3. [security] → Server-Security prüfen (Firewall, Fail2Ban, Ports)
|
||||
4. [code-gen] → Alle Findings fixen
|
||||
5. [test-runner] → Tests für Fixes
|
||||
6. [security] → Re-Check aller Fixes → ✅ FREIGABE
|
||||
7. [git-push] → Security-Fixes committen und pushen
|
||||
8. [ssh-deploy] → git pull + rebuild
|
||||
9. [doc-gen] → CHANGELOG.md mit Security-Report
|
||||
10.[git-push] → Doku pushen
|
||||
```
|
||||
|
||||
### Release (`/workflow release "vX.Y.Z"`)
|
||||
```
|
||||
1. [test-runner] → Alle Tests (Unit, Integration)
|
||||
2. [security] → Final Security-Check
|
||||
3. [dep-check] → Dependency-Check
|
||||
4. [git-push] → Release-Branch, Tag, Changelog, Push auf Gitea
|
||||
5. [ssh-deploy] → git pull + rebuild auf Staging für finalen Test
|
||||
2. [security] → Final Security-Check (Code + Server)
|
||||
3. [dep-check] → Dependency-Check + Updates
|
||||
└── Updates? → test-runner erneut → security erneut
|
||||
4. [security] → ✅ RELEASE-FREIGABE
|
||||
5. [git-push] → Release-Branch, Tag, Changelog, Push
|
||||
6. [ssh-deploy] → git pull + rebuild auf Staging
|
||||
7. [log-analyzer] → Finaler Health-Check
|
||||
8. [doc-gen] → CHANGELOG.md + Release-Notes
|
||||
9. [git-push] → Doku pushen
|
||||
```
|
||||
|
||||
### Neues Projekt (`/workflow init "Projektname"`)
|
||||
```
|
||||
1. [project-init] → Struktur erstellen
|
||||
1. [project-init] → Struktur erstellen (Frontend + Backend)
|
||||
2. [docker-build] → Docker-Setup
|
||||
3. [git-push] → Git init, Gitea Remote, erster Commit
|
||||
4. [test-runner] → Basis-Tests einrichten
|
||||
3. [security] → Basis-Security prüfen (gitignore, .env, Deps)
|
||||
4. [git-push] → Git init, Gitea Remote, erster Commit + Push
|
||||
5. [test-runner] → Basis-Tests einrichten
|
||||
6. [doc-gen] → INSTALL.md + DEPLOY.md generieren
|
||||
7. [git-push] → Doku pushen
|
||||
```
|
||||
|
||||
### Neue Umgebung auf Proxmox (`/workflow provision "Projektname"`)
|
||||
```
|
||||
1. [proxmox-lxc] → LXC erstellen + IP ermitteln → SSH_HOST
|
||||
2. [proxmox-lxc] → Basis-Setup (Node.js/Docker, Git, Firewall, Nginx)
|
||||
3. [proxmox-lxc] → Security-Hardening (SSH, Fail2Ban, Auto-Updates, Sysctl)
|
||||
4. [security] → Server-Security verifizieren (Ports, SSH-Config, Firewall)
|
||||
5. [git-push] → Code auf Gitea pushen
|
||||
6. [ssh-deploy] → git clone auf LXC, npm ci, build, Service starten
|
||||
7. [security] → Code-Security prüfen (OWASP, Secrets, Deps)
|
||||
8. [log-analyzer] → Health-Check & Logs prüfen
|
||||
9. [doc-gen] → INSTALL.md + DEPLOY.md mit echten Werten generieren
|
||||
10.[git-push] → Dokumentation + Security-Fixes committen und pushen
|
||||
1. [proxmox-lxc] → LXC erstellen + IP ermitteln → SSH_HOST
|
||||
2. [proxmox-lxc] → Basis-Setup (Node.js/Docker, Git, Firewall, Nginx)
|
||||
3. [proxmox-lxc] → Security-Hardening (Fail2Ban, Auto-Updates, Sysctl)
|
||||
4. [security] → Server-Security verifizieren → ✅ FREIGABE Server
|
||||
5. [git-push] → Code auf Gitea pushen
|
||||
6. [ssh-deploy] → git clone auf LXC, npm ci, build, Service starten
|
||||
7. [security] → Code-Security prüfen → ✅ FREIGABE Code
|
||||
8. [log-analyzer] → Health-Check & Logs prüfen
|
||||
9. [doc-gen] → INSTALL.md + DEPLOY.md mit echten Werten
|
||||
10. [git-push] → Dokumentation + etwaige Fixes committen und pushen
|
||||
```
|
||||
|
||||
## QUALITÄTS-GATES
|
||||
|
||||
### Vor Commit
|
||||
- [ ] Tests bestanden
|
||||
- [ ] Keine kritischen Security-Issues
|
||||
- [ ] Keine Secrets im Code
|
||||
- [ ] .gitignore aktuell
|
||||
### Gate 1: Tests bestanden (Pflicht vor Security-Review)
|
||||
- Alle Unit-Tests grün
|
||||
- Neue Funktionen haben Tests
|
||||
- Coverage >= 80%
|
||||
|
||||
### Vor Deploy
|
||||
- [ ] Alle Commit-Gates
|
||||
- [ ] Integration-Tests bestanden
|
||||
- [ ] Branch aktuell mit main
|
||||
### Gate 2: Security-Freigabe (Pflicht vor Git-Push/Deploy)
|
||||
- Keine KRITISCHEN oder HOHEN Findings
|
||||
- Keine Secrets im Code
|
||||
- Dependencies ohne bekannte CVEs
|
||||
- `.gitignore` enthält `.env`, `node_modules/`, `*.key`
|
||||
|
||||
### Vor Merge
|
||||
- [ ] Alle Deploy-Gates
|
||||
- [ ] E2E-Tests auf Staging bestanden (falls vorhanden)
|
||||
### Gate 3: Deploy-Verifizierung (Pflicht vor Doku-Abschluss)
|
||||
- Health-Check erfolgreich
|
||||
- Keine Fehler in den Logs
|
||||
- Service läuft stabil
|
||||
|
||||
## GRUNDREGEL: JEDER SKILL SCHREIBT ZURÜCK
|
||||
|
||||
@ -105,7 +153,7 @@ Kein Skill darf "still" beenden. Nach jeder Ausführung:
|
||||
4. **Alles committen und pushen** → Doku ist immer aktuell im Git
|
||||
|
||||
## FEHLERBEHANDLUNG
|
||||
- Test-Fehler → Fix implementieren → Erneut testen → Loop bis grün → Commit + Push
|
||||
- Security-Issue → Sicherheitsfix → Re-Check → Commit + Push
|
||||
- Deploy-Fehler → Logs analysieren → Fix → Commit + Push → Erneut deployen
|
||||
- Test-Fehler → code-gen fixt → test-runner erneut → Loop bis grün → Commit + Push
|
||||
- Security-Abgelehnt → code-gen fixt → test-runner → security erneut → Loop bis Freigabe
|
||||
- Deploy-Fehler → log-analyzer → code-gen fixt → zurück in die Pipeline ab test-runner
|
||||
- **IMMER**: CHANGELOG.md aktualisieren mit was passiert ist
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user