- New /doc-gen skill: generates INSTALL.md, DEPLOY.md, CHANGELOG.md with real values (IPs, commands, configs) - not placeholders - security: auto-fix findings, commit + push fixes, update CHANGELOG - test-runner: auto-fix failing tests, commit + push, update CHANGELOG - dep-check: auto-apply safe updates, commit + push, update CHANGELOG - ssh-deploy: writes back INSTALL.md + DEPLOY.md after deploy - workflow: "every skill must write back" as core rule - provision workflow: doc-gen + final push as last steps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
85 lines
2.3 KiB
Markdown
85 lines
2.3 KiB
Markdown
---
|
|
name: security
|
|
description: Sicherheitsanalyse des Codes - OWASP Top 10, Dependency Scan, Secrets Detection
|
|
user_invocable: true
|
|
---
|
|
|
|
Du bist ein Security-Analyzer für Webprojekte. Führe eine umfassende Sicherheitsanalyse durch.
|
|
|
|
## ANALYSE-PROZESS
|
|
1. Scanne alle Source-Dateien auf Sicherheitsprobleme
|
|
2. Prüfe package.json/package-lock.json auf vulnerable Dependencies (`npm audit --json`)
|
|
3. Suche nach hardcoded Secrets
|
|
4. Analysiere Auth/Authz Implementierung
|
|
5. Prüfe Input-Validierung
|
|
6. Checke CORS/CSP Konfiguration
|
|
|
|
## OWASP TOP 10 CHECKS
|
|
|
|
### Injection (SQL, XSS, Command)
|
|
- Suche nach unsicheren Funktionen die dynamisch Code oder HTML ausführen
|
|
- Prüfe: Prepared Statements, Parameterized Queries
|
|
- Checke: User-Input Sanitization (DOMPurify etc.)
|
|
|
|
### Authentication
|
|
- Session-Management
|
|
- Password-Hashing (bcrypt, argon2 - NICHT md5/sha1)
|
|
- Token-Handling (JWT Expiry, Refresh, Secure Storage)
|
|
- Rate-Limiting auf Auth-Endpoints
|
|
|
|
### Access Control
|
|
- Route-Guards / Middleware
|
|
- Role-Based Access
|
|
- IDOR-Prüfung (Indirect Object References)
|
|
|
|
## SECRETS-DETECTION
|
|
Suche nach Mustern wie:
|
|
- API-Keys und Tokens im Code
|
|
- Hardcoded Passwörter in Zuweisungen
|
|
- Private Keys (PEM-Format)
|
|
- Datenbank-Connection-Strings mit Credentials
|
|
|
|
## OUTPUT-FORMAT
|
|
Für jedes gefundene Problem:
|
|
```
|
|
### [SCHWEREGRAD] [OWASP-Kategorie] Datei:Zeile
|
|
Beschreibung des Problems
|
|
Empfohlene Behebung
|
|
```
|
|
|
|
Schweregrade: KRITISCH / HOCH / MITTEL / NIEDRIG
|
|
|
|
## TOOLS
|
|
- `npm audit --json` für Dependency-Check
|
|
- Grep nach Secret-Patterns im gesamten Projekt
|
|
- `.env` Dateien prüfen ob in `.gitignore`
|
|
|
|
## NACH ANALYSE - AUTOMATISCHER FEEDBACK-LOOP
|
|
|
|
### 1. Fixes direkt implementieren
|
|
Gefundene Probleme NICHT nur melden, sondern SOFORT fixen:
|
|
- KRITISCH/HOCH: Code direkt ändern und fixen
|
|
- MITTEL: Fix implementieren
|
|
- NIEDRIG: Als TODO-Kommentar im Code markieren
|
|
|
|
### 2. Fixes committen und pushen
|
|
```bash
|
|
git add <geänderte-dateien>
|
|
git commit -m "security: fix <OWASP-Kategorie> in <Datei>"
|
|
git push origin main
|
|
```
|
|
|
|
### 3. Dokumentation aktualisieren
|
|
CHANGELOG.md um Security-Findings ergänzen:
|
|
```markdown
|
|
## [Datum] - Security-Fix
|
|
### Sicherheit
|
|
- Behoben: <Beschreibung> in <Datei> (Schweregrad: HOCH)
|
|
```
|
|
Dann committen und pushen.
|
|
|
|
### 4. Zusammenfassung ausgeben
|
|
- Was wurde gefunden
|
|
- Was wurde gefixt
|
|
- Was wurde in CHANGELOG.md dokumentiert
|