All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 37s
CI / test-python-backend-compliance (push) Successful in 33s
CI / test-python-document-crawler (push) Successful in 23s
CI / test-python-dsms-gateway (push) Successful in 18s
- reporting_handlers.go: uuid.Nil-Check vor Store-Aufruf (→ 400) - reporting_handlers_test.go: 4 MissingTenantID-Tests (PASS) + 4 WithTenant-Tests (SKIP) - docs-src: requirements.md, controls.md, evidence.md, risks.md (je mit API, Schema, Tests) - mkdocs.yml: 4 neue Nav-Einträge + \n-Bug auf Zeile 91 behoben - compliance-kern.md: Link-Hinweise zu Detailseiten ergänzt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
127 lines
3.4 KiB
Markdown
127 lines
3.4 KiB
Markdown
# Anforderungen (CP-ANF)
|
|
|
|
Verwaltet regulatorische Anforderungen aus DSGVO, AI Act, CRA, NIS2 und weiteren Regulierungen.
|
|
|
|
**Prefix:** `CP-ANF` · **Frontend:** `https://macmini:3007/sdk/anforderungen`
|
|
**Proxy:** `/api/sdk/v1/compliance/[[...path]]` → `backend-compliance:8002/compliance/...`
|
|
|
|
---
|
|
|
|
## Features
|
|
|
|
- Paginierte Anforderungsliste mit Freitextsuche
|
|
- Filtert nach Regulierung, Anwendbarkeit und Implementierungsstatus
|
|
- Verknüpfung mit Controls und Audit-Tracking
|
|
- RAG-Rechtskontext: Holt passende Gesetzestexte aus dem Vector-Store
|
|
|
|
---
|
|
|
|
## Rechtsgrundlage
|
|
|
|
| Regulierung | Beispielartikel |
|
|
|-------------|-----------------|
|
|
| DSGVO | Art. 5, Art. 24, Art. 32 |
|
|
| AI Act | Art. 9, Art. 13 |
|
|
| NIS2 | Art. 21 |
|
|
| CRA | Art. 13 |
|
|
|
|
---
|
|
|
|
## API Endpoints
|
|
|
|
| Methode | Pfad | Beschreibung |
|
|
|---------|------|--------------|
|
|
| `GET` | `/compliance/requirements` | Paginierte Liste (`page`, `page_size`, `search`, `is_applicable`) |
|
|
| `GET` | `/compliance/requirements/{id}` | Einzelne Anforderung + optionaler RAG-Rechtskontext |
|
|
| `GET` | `/compliance/regulations/{code}/requirements` | Alle Anforderungen einer Regulierung |
|
|
| `POST` | `/compliance/requirements` | Neue Anforderung anlegen |
|
|
| `PUT` | `/compliance/requirements/{id}` | Implementierungsstatus, Audit-Notizen aktualisieren |
|
|
| `DELETE` | `/compliance/requirements/{id}` | Anforderung löschen |
|
|
|
|
### RAG-Rechtskontext
|
|
|
|
```http
|
|
GET /compliance/requirements/{id}?include_legal_context=true
|
|
```
|
|
|
|
Gibt zusätzlich `legal_context[]` mit RAG-Ergebnissen zurück:
|
|
|
|
```json
|
|
{
|
|
"legal_context": [
|
|
{
|
|
"text": "...",
|
|
"regulation_code": "GDPR",
|
|
"article": "Art. 32",
|
|
"score": 0.92,
|
|
"source_url": "https://eur-lex.europa.eu/..."
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
### Request-Beispiel (POST)
|
|
|
|
```json
|
|
{
|
|
"regulation_id": "uuid-der-regulierung",
|
|
"article": "Art. 32",
|
|
"title": "Sicherheit der Verarbeitung",
|
|
"is_applicable": true,
|
|
"priority": 1
|
|
}
|
|
```
|
|
|
|
### Response-Felder (RequirementResponse)
|
|
|
|
| Feld | Typ | Beschreibung |
|
|
|------|-----|--------------|
|
|
| `id` | string | UUID |
|
|
| `regulation_code` | string | z.B. "GDPR", "AI_ACT" |
|
|
| `article` | string | Artikel-Referenz |
|
|
| `implementation_status` | string | `not_started` / `implemented` / `partial` |
|
|
| `audit_status` | string | `pending` / `passed` / `failed` |
|
|
| `last_audit_date` | datetime? | Letztes Audit-Datum |
|
|
|
|
---
|
|
|
|
## Frontend
|
|
|
|
**URL:** `https://macmini:3007/sdk/anforderungen`
|
|
|
|
Zeigt eine filterbare Tabelle aller Anforderungen. Detailansicht öffnet sich per Klick und zeigt neben Metadaten optional den RAG-Rechtskontext mit Quellenangabe.
|
|
|
|
---
|
|
|
|
## Datenbankschema
|
|
|
|
```sql
|
|
compliance_requirements (
|
|
id UUID PRIMARY KEY,
|
|
regulation_id UUID REFERENCES compliance_regulations(id),
|
|
article VARCHAR,
|
|
title TEXT,
|
|
description TEXT,
|
|
is_applicable BOOLEAN DEFAULT true,
|
|
priority INTEGER,
|
|
implementation_status VARCHAR DEFAULT 'not_started',
|
|
audit_status VARCHAR DEFAULT 'pending',
|
|
last_audit_date TIMESTAMP,
|
|
audit_notes TEXT,
|
|
created_at TIMESTAMP,
|
|
updated_at TIMESTAMP
|
|
)
|
|
```
|
|
|
|
---
|
|
|
|
## Tests
|
|
|
|
**Testdatei:** `backend-compliance/tests/test_requirement_routes.py`
|
|
**Anzahl Tests:** 18 · **Status:** ✅ alle bestanden (Stand 2026-03-05)
|
|
|
|
```bash
|
|
cd backend-compliance
|
|
python3 -m pytest tests/test_requirement_routes.py -v
|
|
```
|