test+docs: add policy library tests (67 tests) and MKDocs documentation
All checks were successful
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Successful in 34s
CI/CD / test-python-backend-compliance (push) Successful in 35s
CI/CD / test-python-document-crawler (push) Successful in 23s
CI/CD / test-python-dsms-gateway (push) Successful in 19s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Successful in 2s
All checks were successful
CI/CD / go-lint (push) Has been skipped
CI/CD / python-lint (push) Has been skipped
CI/CD / nodejs-lint (push) Has been skipped
CI/CD / test-go-ai-compliance (push) Successful in 34s
CI/CD / test-python-backend-compliance (push) Successful in 35s
CI/CD / test-python-document-crawler (push) Successful in 23s
CI/CD / test-python-dsms-gateway (push) Successful in 19s
CI/CD / validate-canonical-controls (push) Successful in 12s
CI/CD / Deploy (push) Successful in 2s
- New test_policy_templates.py: 67 tests covering all 29 policy types, API creation, filtering, placeholders, seed script validation - Updated test_legal_template_routes.py: fix type count 16→52 - New MKDocs page policy-bibliothek.md with full template reference - Updated dokumentengenerierung.md and rechtliche-texte.md with cross-refs - Added policy-bibliothek to mkdocs.yml navigation Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -80,3 +80,13 @@ Im Company-Profile-Wizard erscheint nach Abschluss (`is_complete = true`) ein CT
|
||||
- Alle 5 Template-Generatoren mit verschiedenen Kontext-Variationen
|
||||
- Regulierungs-Flag-Kombinationen
|
||||
- Route-Registrierung
|
||||
|
||||
---
|
||||
|
||||
## Policy-Bibliothek
|
||||
|
||||
Neben der automatischen Dokumentengenerierung aus Stammdaten stehen **29 deutsche Richtlinien-Templates**
|
||||
im Dokumentengenerator als Vorlagen bereit (IT-Sicherheit, Datenschutz, Personal, Lieferanten, BCM).
|
||||
|
||||
Siehe [Policy-Bibliothek](policy-bibliothek.md) fuer die vollstaendige Liste aller Templates,
|
||||
Platzhalter und Kategorien.
|
||||
|
||||
224
docs-src/services/sdk-modules/policy-bibliothek.md
Normal file
224
docs-src/services/sdk-modules/policy-bibliothek.md
Normal file
@@ -0,0 +1,224 @@
|
||||
# Policy-Bibliothek (Migration 054)
|
||||
|
||||
Die Policy-Bibliothek stellt **29 deutsche Richtlinien-Templates** bereit, die ueber den Dokumentengenerator
|
||||
als Vorlagen genutzt werden koennen. Alle Templates sind nach deutschen Compliance-Standards strukturiert
|
||||
und enthalten Platzhalter fuer unternehmensspezifische Anpassung.
|
||||
|
||||
---
|
||||
|
||||
## Uebersicht
|
||||
|
||||
| Kategorie | Anzahl | UI-Pill | Beschreibung |
|
||||
|-----------|--------|---------|--------------|
|
||||
| [IT-Sicherheit](#it-sicherheit-policies) | 14 | `IT-Sicherheit Policies` | Informationssicherheit, Zugriffskontrollen, Verschluesselung, Patch-Mgmt. |
|
||||
| [Daten-Policies](#daten-policies) | 5 | `Daten-Policies` | Datenschutz, Klassifizierung, Aufbewahrung, Transfer |
|
||||
| [Personal-Policies](#personal-policies) | 4 | `Personal-Policies` | Mitarbeitersicherheit, Awareness, Remote Work, Offboarding |
|
||||
| [Lieferanten-Policies](#lieferanten-policies) | 3 | `Lieferanten-Policies` | Vendor Risk, Drittanbieter, Lieferanten-Sicherheit |
|
||||
| [BCM/Notfall](#bcmnotfall) | 3 | `BCM/Notfall` | Business Continuity, Disaster Recovery, Krisenmanagement |
|
||||
|
||||
**Gesamt:** 29 Policy-Templates + 7 Sicherheitskonzepte (Migration 051) + 16 Basis-Dokumenttypen = **52 Dokumenttypen**
|
||||
|
||||
---
|
||||
|
||||
## Template-Struktur
|
||||
|
||||
Alle 29 Policy-Templates folgen einer einheitlichen **9-Abschnitte-Struktur:**
|
||||
|
||||
1. **Zweck** — Zielsetzung der Richtlinie
|
||||
2. **Geltungsbereich** — Fuer wen gilt die Richtlinie
|
||||
3. **Begriffe** — Definitionen
|
||||
4. **Verantwortlichkeiten** — Rollen und Zustaendigkeiten
|
||||
5. **Richtlinie** (Kern) — Die eigentlichen Regelungen
|
||||
6. **Massnahmen** — Konkrete Umsetzungsschritte
|
||||
7. **Ueberwachung & Audit** — Pruef- und Kontrollmechanismen
|
||||
8. **Schulung** — Anforderungen an Mitarbeiterschulung
|
||||
9. **Inkrafttreten** — Gueltigkeitsdatum und Freigabe
|
||||
|
||||
### Gemeinsame Platzhalter
|
||||
|
||||
| Platzhalter | Beschreibung |
|
||||
|-------------|--------------|
|
||||
| `{{COMPANY_NAME}}` | Firmenname |
|
||||
| `{{SECURITY_OFFICER}}` / `{{ISB_NAME}}` | Informationssicherheitsbeauftragter |
|
||||
| `{{GF_NAME}}` | Geschaeftsfuehrung (Freigabe) |
|
||||
| `{{VERSION}}` | Dokumentversion |
|
||||
| `{{DATE}}` | Erstellungsdatum |
|
||||
| `{{SCOPE_DESCRIPTION}}` | Geltungsbereich |
|
||||
| `{{NEXT_REVIEW_DATE}}` | Naechster Prueftermin |
|
||||
|
||||
---
|
||||
|
||||
## IT-Sicherheit Policies
|
||||
|
||||
14 Templates fuer die IT-Sicherheitsorganisation:
|
||||
|
||||
| Typ | Titel | Spezifische Platzhalter |
|
||||
|-----|-------|------------------------|
|
||||
| `information_security_policy` | Informationssicherheits-Richtlinie | `SCOPE_DESCRIPTION` |
|
||||
| `access_control_policy` | Zugriffskontrollen-Richtlinie | `REVIEW_INTERVAL_DAYS` |
|
||||
| `password_policy` | Passwort-Richtlinie | `MIN_PASSWORD_LENGTH`, `MAX_AGE_DAYS`, `HISTORY_COUNT` |
|
||||
| `encryption_policy` | Verschluesselungs-Richtlinie | `MIN_KEY_LENGTH` |
|
||||
| `logging_policy` | Logging-Richtlinie | `LOG_RETENTION_DAYS` |
|
||||
| `backup_policy` | Backup-Richtlinie | `RPO_HOURS`, `RTO_HOURS`, `BACKUP_RETENTION_DAYS` |
|
||||
| `incident_response_policy` | Incident-Response-Richtlinie | `INCIDENT_HOTLINE`, `NOTIFICATION_HOURS` |
|
||||
| `change_management_policy` | Change-Management-Richtlinie | `CAB_SCHEDULE` |
|
||||
| `patch_management_policy` | Patch-Management-Richtlinie | `CRITICAL_PATCH_HOURS`, `PATCH_WINDOW` |
|
||||
| `asset_management_policy` | Asset-Management-Richtlinie | `INVENTORY_TOOL` |
|
||||
| `cloud_security_policy` | Cloud-Sicherheits-Richtlinie | `APPROVED_PROVIDERS` |
|
||||
| `devsecops_policy` | DevSecOps-Richtlinie | `CI_TOOL`, `SAST_TOOL` |
|
||||
| `secrets_management_policy` | Secrets-Management-Richtlinie | `VAULT_URL`, `ROTATION_DAYS` |
|
||||
| `vulnerability_management_policy` | Schwachstellenmanagement-Richtlinie | `SCAN_FREQUENCY`, `SCANNER_TOOL` |
|
||||
|
||||
---
|
||||
|
||||
## Daten-Policies
|
||||
|
||||
5 Templates fuer Datenschutz und Datenmanagement:
|
||||
|
||||
| Typ | Titel | Spezifische Platzhalter |
|
||||
|-----|-------|------------------------|
|
||||
| `data_protection_policy` | Datenschutz-Richtlinie | `DSB_NAME`, `DSB_EMAIL`, `SUPERVISORY_AUTHORITY` |
|
||||
| `data_classification_policy` | Datenklassifizierungs-Richtlinie | `CLASSIFICATION_TOOL` |
|
||||
| `data_retention_policy` | Datenaufbewahrungs-Richtlinie | `DEFAULT_RETENTION_YEARS`, `DELETION_TOOL` |
|
||||
| `data_transfer_policy` | Datentransfer-Richtlinie | `DPO_EMAIL` |
|
||||
| `privacy_incident_policy` | Datenschutzvorfall-Richtlinie | `DPO_EMAIL`, `NOTIFICATION_HOURS` |
|
||||
|
||||
---
|
||||
|
||||
## Personal-Policies
|
||||
|
||||
4 Templates fuer Mitarbeitersicherheit:
|
||||
|
||||
| Typ | Titel | Spezifische Platzhalter |
|
||||
|-----|-------|------------------------|
|
||||
| `employee_security_policy` | Mitarbeiter-Sicherheitsrichtlinie | `HR_CONTACT` |
|
||||
| `security_awareness_policy` | Security-Awareness-Richtlinie | `TRAINING_FREQUENCY`, `LMS_URL` |
|
||||
| `remote_work_policy` | Remote-Work-Richtlinie | `VPN_TOOL`, `MDM_TOOL` |
|
||||
| `offboarding_policy` | Offboarding-Richtlinie | `HR_CONTACT`, `IT_CONTACT` |
|
||||
|
||||
---
|
||||
|
||||
## Lieferanten-Policies
|
||||
|
||||
3 Templates fuer die Lieferkette:
|
||||
|
||||
| Typ | Titel | Spezifische Platzhalter |
|
||||
|-----|-------|------------------------|
|
||||
| `vendor_risk_management_policy` | Lieferanten-Risikomanagement-Richtlinie | `PROCUREMENT_CONTACT`, `REVIEW_FREQUENCY` |
|
||||
| `third_party_security_policy` | Drittanbieter-Sicherheitsrichtlinie | `SECURITY_CONTACT` |
|
||||
| `supplier_security_policy` | Lieferanten-Sicherheitsrichtlinie | `PROCUREMENT_CONTACT` |
|
||||
|
||||
---
|
||||
|
||||
## BCM/Notfall
|
||||
|
||||
3 Templates fuer Business Continuity:
|
||||
|
||||
| Typ | Titel | Spezifische Platzhalter |
|
||||
|-----|-------|------------------------|
|
||||
| `business_continuity_policy` | Business-Continuity-Richtlinie | `RTO_HOURS`, `RPO_HOURS`, `BC_COORDINATOR` |
|
||||
| `disaster_recovery_policy` | Disaster-Recovery-Richtlinie | `DR_SITE`, `RTO_HOURS`, `RPO_HOURS` |
|
||||
| `crisis_management_policy` | Krisenmanagement-Richtlinie | `CRISIS_HOTLINE`, `CRISIS_TEAM_LEAD` |
|
||||
|
||||
---
|
||||
|
||||
## API
|
||||
|
||||
Die Policy-Templates werden ueber die bestehende Legal-Templates-API verwaltet:
|
||||
|
||||
| Methode | Pfad | Beschreibung |
|
||||
|---------|------|--------------|
|
||||
| `GET` | `/api/compliance/legal-templates` | Templates listen (Filter: `document_type`, `status`, `language`) |
|
||||
| `GET` | `/api/compliance/legal-templates/status` | Anzahl nach Typ und Status |
|
||||
| `GET` | `/api/compliance/legal-templates/{id}` | Einzelnes Template laden |
|
||||
| `POST` | `/api/compliance/legal-templates` | Neues Template erstellen |
|
||||
| `PUT` | `/api/compliance/legal-templates/{id}` | Template aktualisieren |
|
||||
| `DELETE` | `/api/compliance/legal-templates/{id}` | Template loeschen |
|
||||
|
||||
### Beispiel: Policy-Templates nach Kategorie filtern
|
||||
|
||||
```bash
|
||||
# Alle IT-Sicherheit Policies
|
||||
curl "https://api-dev.breakpilot.ai/api/compliance/legal-templates?document_type=information_security_policy"
|
||||
|
||||
# Alle Policy-Templates (mehrere Typen)
|
||||
curl "https://api-dev.breakpilot.ai/api/compliance/legal-templates/status"
|
||||
```
|
||||
|
||||
### Beispiel: Template erstellen
|
||||
|
||||
```bash
|
||||
curl -X POST "https://api-dev.breakpilot.ai/api/compliance/legal-templates" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-Tenant-Id: <tenant-id>" \
|
||||
-d '{
|
||||
"document_type": "password_policy",
|
||||
"title": "Passwort-Richtlinie",
|
||||
"content": "# Passwort-Richtlinie\n\n...",
|
||||
"placeholders": ["{{COMPANY_NAME}}", "{{MIN_PASSWORD_LENGTH}}"],
|
||||
"language": "de",
|
||||
"jurisdiction": "DE"
|
||||
}'
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Frontend
|
||||
|
||||
Die Policy-Templates sind im **Dokumentengenerator** (`/sdk/document-generator`) unter 5 neuen Kategorie-Pills erreichbar:
|
||||
|
||||
| UI-Pill | Enthaltene Typen |
|
||||
|---------|-----------------|
|
||||
| IT-Sicherheit Policies | 14 Typen (information_security_policy bis vulnerability_management_policy) |
|
||||
| Daten-Policies | 5 Typen (data_protection_policy bis privacy_incident_policy) |
|
||||
| Personal-Policies | 5 Typen (employee_security_policy, security_awareness_policy, acceptable_use, remote_work_policy, offboarding_policy) |
|
||||
| Lieferanten-Policies | 3 Typen (vendor_risk_management_policy bis supplier_security_policy) |
|
||||
| BCM/Notfall | 3 Typen (business_continuity_policy bis crisis_management_policy) |
|
||||
|
||||
---
|
||||
|
||||
## Seeding
|
||||
|
||||
Das Seed-Script `backend-compliance/scripts/seed_policy_templates.py` fuegt alle 29 Templates ueber die API ein:
|
||||
|
||||
```bash
|
||||
python3 backend-compliance/scripts/seed_policy_templates.py
|
||||
```
|
||||
|
||||
Das Script nutzt die Production-API (`https://api-dev.breakpilot.ai`) und benoetigt einen gueltigen
|
||||
`X-Tenant-Id` Header. Bereits existierende Templates werden nicht dupliziert (Upsert ueber `document_type`).
|
||||
|
||||
---
|
||||
|
||||
## Tests
|
||||
|
||||
- **48 Tests** in `test_policy_templates.py`
|
||||
- Alle 29 Dokumenttypen gegen `VALID_DOCUMENT_TYPES` validiert
|
||||
- API-Akzeptanz (POST 201) fuer jeden Typ (parametrized)
|
||||
- Filterung nach Kategorie (GET 200)
|
||||
- Platzhalter-Validierung
|
||||
- Seed-Script-Struktur (29 Templates, Pflichtfelder, deutsche Inhalte)
|
||||
- Ablehnung ungeltiger Typen (400)
|
||||
|
||||
---
|
||||
|
||||
## Zusammenspiel mit anderen Modulen
|
||||
|
||||
```mermaid
|
||||
graph LR
|
||||
A[Company Profile] --> B[Compliance Engine]
|
||||
B --> C[Policy-Bibliothek]
|
||||
C --> D[Dokumentengenerator]
|
||||
D --> E[Change-Requests]
|
||||
E --> F[Document Workflow]
|
||||
C --> G[Controls / Mapping-Matrix]
|
||||
G --> H[Process Manager Tasks]
|
||||
G --> I[Evidence Checks]
|
||||
```
|
||||
|
||||
Die Policy-Bibliothek bildet die **Vorlage-Ebene** der geplanten Compliance Engine:
|
||||
|
||||
1. **CompanyProfile + Scope** → bestimmt welche Regulations/Controls relevant sind
|
||||
2. **Controls** → verweisen auf relevante **Policies** aus der Bibliothek
|
||||
3. **Policies** → werden ueber den Dokumentengenerator als Entwuerfe erstellt
|
||||
4. **Entwuerfe** → durchlaufen den Document Workflow (Review → Freigabe → Veroeffentlichung)
|
||||
@@ -412,3 +412,8 @@ Die **Einwilligungen** legen fest, welche Datenpunkte einer Einwilligung beduerf
|
||||
Die **Rechtlichen Vorlagen** erstellen die zugehoerigen Dokumente (DSE, AGB, etc.).
|
||||
Der **Cookie Banner** konfiguriert das Frontend-Consent-Widget.
|
||||
Der **Document Workflow** fuhrt alle Dokumente durch den Freigabeprozess vor der Veroeffentlichung.
|
||||
|
||||
!!! info "Policy-Bibliothek (Migration 054)"
|
||||
Zusaetzlich zu den rechtlichen Texten stehen **29 deutsche Richtlinien-Templates** zur Verfuegung
|
||||
(IT-Sicherheit, Datenschutz, Personal, Lieferanten, BCM). Siehe
|
||||
[Policy-Bibliothek](policy-bibliothek.md) fuer Details.
|
||||
|
||||
Reference in New Issue
Block a user