@aegis-scan/skills 0.2.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/ATTRIBUTION.md +171 -4
  2. package/CHANGELOG.md +112 -1
  3. package/README.md +27 -0
  4. package/dist/skills-loader.d.ts +43 -0
  5. package/dist/skills-loader.d.ts.map +1 -1
  6. package/dist/skills-loader.js +102 -0
  7. package/dist/skills-loader.js.map +1 -1
  8. package/package.json +1 -1
  9. package/skills/compliance/_INDEX.md +49 -0
  10. package/skills/compliance/aegis-native/brutaler-anwalt/CHANGELOG.md +202 -0
  11. package/skills/compliance/aegis-native/brutaler-anwalt/LICENSE +43 -0
  12. package/skills/compliance/aegis-native/brutaler-anwalt/README.md +236 -0
  13. package/skills/compliance/aegis-native/brutaler-anwalt/SKILL.md +437 -6
  14. package/skills/compliance/aegis-native/brutaler-anwalt/references/aegis-integration.md +3 -4
  15. package/skills/compliance/aegis-native/brutaler-anwalt/references/audit-patterns.md +842 -5
  16. package/skills/compliance/aegis-native/brutaler-anwalt/references/bgh-urteile.md +226 -10
  17. package/skills/compliance/aegis-native/brutaler-anwalt/references/branchenrecht.md +365 -1
  18. package/skills/compliance/aegis-native/brutaler-anwalt/references/checklisten.md +33 -0
  19. package/skills/compliance/aegis-native/brutaler-anwalt/references/dsgvo.md +26 -0
  20. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/BDSG/paragraphs.md +62 -0
  21. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/BFSG/paragraphs.md +85 -0
  22. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/BGB/paragraphs.md +112 -0
  23. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/DDG/paragraphs.md +71 -0
  24. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/DSGVO/articles.md +182 -0
  25. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/EU-Verordnungen/AI-Act-2024-1689/articles.md +108 -0
  26. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/EU-Verordnungen/DSA-2022-2065/articles.md +131 -0
  27. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/HGB-AO/paragraphs.md +61 -0
  28. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/INDEX.md +93 -0
  29. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/TDDDG/paragraphs.md +67 -0
  30. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/UWG/paragraphs.md +117 -0
  31. package/skills/compliance/aegis-native/brutaler-anwalt/references/gesetze/VSBG/paragraphs.md +57 -0
  32. package/skills/compliance/aegis-native/brutaler-anwalt/references/it-recht.md +22 -0
  33. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/INDEX.md +122 -0
  34. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/ai/mistral-eu.md +123 -0
  35. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/ai/openai-dpa.md +120 -0
  36. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/auth/nextauth-tom.md +120 -0
  37. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/auth/supabase-auth-tom.md +104 -0
  38. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/nextjs/proxy-csp-pattern.md +93 -0
  39. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/payment/stripe-pci-tom.md +121 -0
  40. package/skills/compliance/aegis-native/brutaler-anwalt/references/stack-patterns/tracking/plausible-pattern.md +107 -0
  41. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/AffiliateDisclaimer.tsx.example +54 -0
  42. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/COMPLIANCE-AUDIT-TRAIL-template.md +95 -0
  43. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/DSE-Section-UGC.md.example +77 -0
  44. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/DSFA-template.md +76 -0
  45. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/LostFoundReportForm-consent.tsx.example +126 -0
  46. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/README.md +33 -0
  47. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/UmamiScript.tsx.example +64 -0
  48. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/VVT-template.md +60 -0
  49. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/data-retention-cron.ts.example +52 -0
  50. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/data-retention-workflow.yml.example +47 -0
  51. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/proxy-strict-dynamic.ts.example +80 -0
  52. package/skills/compliance/aegis-native/brutaler-anwalt/references/templates/security.txt.example +26 -0
  53. package/skills/compliance/aegis-native/brutaler-anwalt/scripts/health-check.sh +120 -0
  54. package/skills/defensive/aegis-native/rls-defense/SKILL.md +110 -0
  55. package/skills/defensive/aegis-native/tenant-isolation-defense/SKILL.md +26 -0
  56. package/skills/foundation/_INDEX.md +73 -0
  57. package/skills/foundation/aegis-native/aegis-audit/SKILL.md +194 -0
  58. package/skills/foundation/aegis-native/aegis-audit/references/layer-1-headers.md +138 -0
  59. package/skills/foundation/aegis-native/aegis-audit/references/layer-2-html.md +153 -0
  60. package/skills/foundation/aegis-native/aegis-audit/references/layer-3-impressum.md +159 -0
  61. package/skills/foundation/aegis-native/aegis-audit/references/layer-4-dse.md +178 -0
  62. package/skills/foundation/aegis-native/aegis-audit/references/layer-5-cookie.md +180 -0
  63. package/skills/foundation/aegis-native/aegis-audit/references/layer-6-branche.md +204 -0
  64. package/skills/foundation/aegis-native/aegis-audit/references/layer-7-code-cross-check.md +212 -0
  65. package/skills/foundation/aegis-native/aegis-audit/references/layer-8-schadens-diagnose.md +232 -0
  66. package/skills/foundation/aegis-native/aegis-customer-build/SKILL.md +232 -0
  67. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-1-recon.md +147 -0
  68. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-2-architecture.md +164 -0
  69. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-3-component-build.md +231 -0
  70. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-4-content.md +196 -0
  71. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-5-integration.md +273 -0
  72. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-6-mid-audit.md +200 -0
  73. package/skills/foundation/aegis-native/aegis-customer-build/references/phase-7-final-verify.md +258 -0
  74. package/skills/foundation/aegis-native/aegis-handover-writer/SKILL.md +128 -0
  75. package/skills/foundation/aegis-native/aegis-module-builder/SKILL.md +255 -0
  76. package/skills/foundation/aegis-native/aegis-orchestrator/SKILL.md +229 -0
  77. package/skills/foundation/aegis-native/aegis-quality-gates/SKILL.md +182 -0
  78. package/skills/foundation/aegis-native/aegis-skill-creator/SKILL.md +223 -0
  79. package/skills/foundation/aegis-native/aegis-skill-creator/references/hard-constraint-template.md +213 -0
  80. package/skills/foundation/aegis-native/aegis-skill-creator/references/skillforge-methodology.md +220 -0
  81. package/skills/foundation/aegis-native/dsgvo-compliance/SKILL.md +185 -0
  82. package/skills/foundation/aegis-native/dsgvo-compliance/references/art-13-15-templates.md +309 -0
  83. package/skills/foundation/aegis-native/dsgvo-compliance/references/datenpanne-runbook.md +291 -0
  84. package/skills/offensive/matty-fork/cicd-redteam/SKILL.md +531 -0
  85. package/skills/offensive/matty-fork/cloud-security/SKILL.md +106 -0
  86. package/skills/offensive/matty-fork/container-escape/SKILL.md +174 -0
  87. package/skills/offensive/matty-fork/mobile-pentester/SKILL.md +357 -0
  88. package/skills/offensive/matty-fork/subdomain-takeover/SKILL.md +154 -0
  89. package/skills/osint/elementalsouls-fork/offensive-osint/README.md +92 -0
  90. package/skills/osint/elementalsouls-fork/offensive-osint/SKILL.md +4177 -0
  91. package/skills/osint/elementalsouls-fork/osint-methodology/README.md +66 -0
  92. package/skills/osint/elementalsouls-fork/osint-methodology/SKILL.md +1695 -0
  93. package/sbom.cdx.json +0 -1
@@ -0,0 +1,122 @@
1
+ ---
2
+ status: skeleton
3
+ purpose: Pro Tech-Stack ein Pattern-File mit Code-Snippet (sanitized) + AVV-/DPA-Quelle + DSE-Wording-Vorlage + bekannte Risiken.
4
+ maintainer-note: Auto-Loading-Architektur in SKILL.md ruft diese Files via grep package.json. Befuell-Plan unten.
5
+ ---
6
+
7
+ # `references/stack-patterns/` — Skeleton + Befuell-Plan
8
+
9
+ > Status: **skeleton**. Ziel: pro Stack-Komponente (Framework, Auth-Provider,
10
+ > Payment-Provider, Tracking-Provider, AI-Provider) ein Pattern-File mit:
11
+ > - Code-Snippet (sanitized — keine Brand-Refs)
12
+ > - AVV-/DPA-Quelle des Vendors
13
+ > - DSE-Wording-Vorlage (Block-Vorschlag fuer Datenschutzerklaerung)
14
+ > - Bekannte Risiken (Drittland, Cookies, Default-Cloud-Settings)
15
+ > - Verify-Commands
16
+
17
+ ## Befuell-Reihenfolge
18
+
19
+ ### Frameworks (Foundation)
20
+ - [ ] `nextjs/proxy-csp-pattern.md` — Strict-Dynamic-CSP via middleware (siehe templates/proxy-strict-dynamic.ts.example)
21
+ - [ ] `nextjs/env-driven-tracking.md` — UmamiScript-Pattern (siehe templates/UmamiScript.tsx.example)
22
+ - [ ] `nextjs/dynamic-rendering-headers.md` — `force-dynamic`, `revalidate`, no-cache
23
+ - [ ] `nextjs/api-route-bearer-auth.md` — Cron-Routes (siehe templates/data-retention-cron.ts.example)
24
+ - [ ] `react/cookie-banner-pattern.md` — Pre-consent-Tracker-Gate
25
+ - [ ] `react/consent-gate-pattern.md` — useConsent-Hook
26
+ - [ ] `vue/cookie-banner-pattern.md`
27
+ - [ ] `astro/cookie-banner-pattern.md`
28
+ - [ ] `svelte/cookie-banner-pattern.md`
29
+ - [ ] `laravel/cookie-banner-pattern.md`
30
+ - [ ] `rails/cookie-banner-pattern.md`
31
+ - [ ] `django/cookie-banner-pattern.md`
32
+ - [ ] `flask/cookie-banner-pattern.md`
33
+ - [ ] `fastapi/cookie-banner-pattern.md`
34
+ - [ ] `express/cookie-banner-pattern.md`
35
+ - [ ] `nest/cookie-banner-pattern.md`
36
+ - [ ] `strapi/cms-pii-pattern.md`
37
+
38
+ ### Auth-Provider
39
+ - [ ] `auth/supabase-auth-tom.md` — bcrypt, RLS, MFA-Optional, Audit-Log
40
+ - [ ] `auth/nextauth-tom.md` — JWT vs Session, CSRF-Token-Rotate
41
+ - [ ] `auth/auth0-tom.md` — Drittland (US) + DPA-Link
42
+ - [ ] `auth/clerk-tom.md` — Drittland (US) + DPA-Link + EU-Region-Setting
43
+ - [ ] `auth/custom-jwt-tom.md` — KMS, Key-Rotation, RS256-Pflicht
44
+
45
+ ### Payment-Provider
46
+ - [ ] `payment/stripe-pci-tom.md` — PCI-DSS via Stripe-hosted, Webhook-Sig-Verify
47
+ - [ ] `payment/lemonsqueezy-tom.md` — EU-VAT-Handling
48
+ - [ ] `payment/paddle-tom.md` — Merchant-of-Record-Modell
49
+ - [ ] `payment/mollie-tom.md` — EU-Anbieter, SEPA
50
+ - [ ] `payment/paypal-tom.md` — Drittland (US) + DPA
51
+
52
+ ### Tracking-Provider
53
+ - [ ] `tracking/plausible-pattern.md` — cookieless, EU-gehostet
54
+ - [ ] `tracking/umami-pattern.md` — selbst-gehostet, cookieless
55
+ - [ ] `tracking/google-analytics-consent.md` — GA4, IP-Anonym, Consent-Mode v2, Drittland
56
+ - [ ] `tracking/mixpanel-consent.md` — Drittland (US), opt-in only
57
+ - [ ] `tracking/posthog-consent.md` — EU-Region verfuegbar
58
+ - [ ] `tracking/fathom-pattern.md` — cookieless, EU-Mode
59
+
60
+ ### AI-Provider
61
+ - [ ] `ai/openai-dpa.md` — DPA-Link, EU-Data-Boundary-Settings, Trainings-Opt-Out
62
+ - [ ] `ai/anthropic-dpa.md` — DPA-Link, Drittland-Mechanismus
63
+ - [ ] `ai/mistral-eu.md` — EU-Anbieter (FR), AI-Act-Hochrisiko-Mapping
64
+ - [ ] `ai/replicate-dpa.md` — Drittland (US)
65
+ - [ ] `ai/self-hosted-llm.md` — On-Prem (Ollama, vLLM, LocalAI) — KEIN Drittland-Trigger
66
+
67
+ ## Format pro File (Vorlage)
68
+
69
+ ```markdown
70
+ ---
71
+ license: MIT (snippet) / vendor-doc-Quellen separat lizenziert
72
+ provider: <Vendor-Name>
73
+ provider-AVV-status: <Standardvertrag verfuegbar / on-request / nicht verfuegbar>
74
+ last-checked: <YYYY-MM-DD>
75
+ ---
76
+
77
+ # <Stack-Komponente> — Pattern fuer brutaler-anwalt-Audit
78
+
79
+ ## 1. Default-Verhalten (was passiert ohne Konfiguration)
80
+
81
+ <z.B.: Default-Region = US, Default-Cookies = on, Default-IP-Anonymisierung = off>
82
+
83
+ ## 2. Compliance-Risiken
84
+
85
+ | Risiko | Auswirkung | Fix |
86
+ |--------|-----------|-----|
87
+ | Drittland | Schrems-II | Region setzen + SCC + TIA |
88
+ | Cookies | § 25 TTDSG | Consent-Mode oder cookieless |
89
+ | Default-Logs | Art. 5 DSGVO | Anonymisierung, Loeschfristen |
90
+
91
+ ## 3. Code-Pattern (sanitized)
92
+
93
+ ```ts
94
+ // Brand-agnostisch, mit <placeholder> fuer Operator-Werte
95
+ ```
96
+
97
+ ## 4. AVV / DPA
98
+
99
+ - DPA-Link: <URL beim Vendor>
100
+ - AVV-Stand: <Datum>
101
+ - Sub-Auftragsverarbeiter: <Liste oder Verweis>
102
+
103
+ ## 5. DSE-Wording-Vorlage
104
+
105
+ > Block fuer eigene Datenschutzerklaerung mit Pflicht-Inhalt.
106
+
107
+ ## 6. Verify-Commands
108
+
109
+ ```bash
110
+ # Live-Probe gegen die Domain mit dem Stack-Element
111
+ ```
112
+
113
+ ## 7. Az.-Anker (wenn vorhanden)
114
+
115
+ - BGH/OLG/EuGH-Urteil mit Az. + Source-URL
116
+ ```
117
+
118
+ ## NICHT-Inhalt dieser Files
119
+
120
+ - KEINE Vendor-Disclosure (nur faktische Compliance-Sicht)
121
+ - KEIN Marketing oder Kaufempfehlung
122
+ - KEINE alternativen Provider-Vergleiche (das macht der Skill-Output, nicht die Reference)
@@ -0,0 +1,123 @@
1
+ ---
2
+ license: MIT (snippet)
3
+ provider: Mistral AI SAS (Frankreich) — EU-Anbieter
4
+ provider-AVV-status: Enterprise-DPA verfügbar; La Plateforme DPA standardmäßig
5
+ last-checked: 2026-05-01
6
+ ---
7
+
8
+ # Mistral AI — EU-AI-Provider Compliance + DSE-Wording
9
+
10
+ ## 1. Default-Verhalten
11
+
12
+ - **Hosting**: EU (Frankreich, AWS eu-west-1 / GCP europe-west1)
13
+ - **Daten-Routing**: bei `mistral-large-latest` und `mistral-medium` standardmäßig EU
14
+ - **Keine Trainingsnutzung** auf API-Daten (Default seit 2024-Q4)
15
+ - **Logging**: Server-seitig nur 30 Tage, danach gelöscht (laut DPA)
16
+ - **Token-Rate-Limit**: pro API-Key, kein Userdaten-Tracking ohne explizite Konfiguration
17
+
18
+ ## 2. Compliance-Vorteile gegenüber US-Anbietern
19
+
20
+ | Aspekt | Mistral (FR/EU) | OpenAI (US) | Anthropic (US) |
21
+ |--------|-----------------|-------------|----------------|
22
+ | Hosting-Region | EU-Default | US-Default | US-Default |
23
+ | DPF-Zertifizierung | nicht relevant (EU) | ja | ja |
24
+ | Drittland-Hinweis nötig | NEIN | JA | JA |
25
+ | SCC nötig | NEIN | JA (Modul 2) | JA (Modul 2) |
26
+ | Trainingsnutzung Default | nein | nein (Enterprise) / ja (Free) | nein |
27
+
28
+ ## 3. Compliance-Risiken (Mistral-spezifisch)
29
+
30
+ | Risiko | Wirkung | Fix |
31
+ |--------|---------|-----|
32
+ | User-Prompts mit PII an API senden | DSGVO Art. 6 (auch innerhalb EU braucht Rechtsgrundlage) | DSFA + Einwilligung wenn Sondersensibles |
33
+ | Modell-Antworten mit erfundenem Inhalt | UWG § 5 wenn beworben als „korrekt" | Disclaimer „kein Ersatz für fachliche Beratung" |
34
+ | AI-Act Art. 50 ab 02.08.2026 | Pflicht-Hinweis im Chat-UI | KI-Kennzeichnung sichtbar |
35
+
36
+ ## 4. Code-Pattern (sanitized)
37
+
38
+ ```ts
39
+ // File: src/lib/ai/mistral-client.ts
40
+ import { Mistral } from '@mistralai/mistralai';
41
+
42
+ const client = new Mistral({
43
+ apiKey: process.env.MISTRAL_API_KEY!,
44
+ // serverEndpoint: optional, default = api.mistral.ai (EU)
45
+ });
46
+
47
+ export async function chatWithDisclaimer(userMessage: string) {
48
+ const response = await client.chat.complete({
49
+ model: 'mistral-medium-latest', // EU-hosted by default
50
+ messages: [
51
+ {
52
+ role: 'system',
53
+ content:
54
+ 'Du bist ein hilfreicher Assistent. ' +
55
+ 'Bei medizinischen / juristischen / finanziellen Fragen: ' +
56
+ 'verweise auf Fachkraft. Erfinde keine Fakten — sage „weiß ich nicht" wenn unsicher.',
57
+ },
58
+ { role: 'user', content: userMessage },
59
+ ],
60
+ temperature: 0.7,
61
+ maxTokens: 1000,
62
+ });
63
+
64
+ return response.choices?.[0]?.message?.content;
65
+ }
66
+ ```
67
+
68
+ ```tsx
69
+ // File: src/components/chat/ChatUI.tsx
70
+ // Pflicht-Hinweis nach AI-Act Art. 50 (ab 02.08.2026)
71
+ 'use client';
72
+
73
+ export function AIChatHeader() {
74
+ return (
75
+ <div className="ai-disclaimer" role="note">
76
+ <span aria-hidden="true">🤖</span>
77
+ <p>
78
+ <strong>KI-Assistent.</strong> Antworten werden von einer KI erzeugt
79
+ (Mistral AI, EU-gehostet). Sie ersetzen keine fachliche Beratung
80
+ (Tierarzt / Arzt / Anwalt / Steuerberater).
81
+ </p>
82
+ </div>
83
+ );
84
+ }
85
+ ```
86
+
87
+ ## 5. AVV / DPA
88
+
89
+ - **DPA-Link**: https://mistral.ai/terms#data-processing-addendum
90
+ - **Standard La Plateforme Terms**: https://mistral.ai/terms/#terms-of-service-la-plateforme
91
+ - **Enterprise DPA**: auf Anfrage
92
+ - **AI-Act-Compliance-Doku**: Mistral publiziert technical-doc nach Art. 53 AI-Act (GPAI-Pflicht)
93
+
94
+ ## 6. DSE-Wording-Vorlage
95
+
96
+ > **KI-gestützte Funktionen (Mistral AI).** Für KI-basierte Funktionen
97
+ > (z.B. Chat-Assistent, Empfehlungen) nutzen wir die API von Mistral AI
98
+ > SAS (15 rue des Halles, 75001 Paris, Frankreich) als Auftragsverarbeiter
99
+ > im Sinne von Art. 28 DSGVO. Daten werden in der EU verarbeitet (kein
100
+ > Drittland-Transfer). Eingaben (Prompts) und KI-Antworten werden bei
101
+ > Mistral maximal 30 Tage zur Missbrauchs-Erkennung gespeichert und nicht
102
+ > für Training genutzt (siehe Mistral Privacy Policy). Rechtsgrundlage:
103
+ > Art. 6 Abs. 1 lit. b DSGVO (Vertragserfüllung) bzw. lit. f
104
+ > (berechtigtes Interesse). Bei sensiblen Datenkategorien holen wir
105
+ > separate Einwilligung ein (Art. 6 Abs. 1 lit. a + Art. 9 lit. a DSGVO).
106
+ > Datenschutz Mistral: https://mistral.ai/terms/#privacy-policy.
107
+
108
+ ## 7. Verify-Commands
109
+
110
+ ```bash
111
+ # API-Endpoint-Region prüfen (sollte EU sein)
112
+ curl -s -X POST https://api.mistral.ai/v1/chat/completions \
113
+ -H "Authorization: Bearer $MISTRAL_API_KEY" \
114
+ -H "Content-Type: application/json" \
115
+ -d '{"model":"mistral-small-latest","messages":[{"role":"user","content":"hi"}]}' \
116
+ -I | grep -iE 'cf-ray|x-amz|server'
117
+ # erwarte: EU-region-headers (eu-west / fra / paris)
118
+ ```
119
+
120
+ ## 8. Az.-Anker
121
+
122
+ - AI-Act VO 2024/1689 Art. 53 (GPAI-Pflichten Mistral)
123
+ - AI-Act Art. 50 (Transparenz für End-User, ab 02.08.2026)
@@ -0,0 +1,120 @@
1
+ ---
2
+ license: MIT (snippet)
3
+ provider: OpenAI Ireland Ltd (Dublin) + OpenAI L.L.C. (USA)
4
+ provider-AVV-status: DPA verfügbar (Standard + Zero Data Retention auf Anfrage)
5
+ last-checked: 2026-05-01
6
+ ---
7
+
8
+ # OpenAI — Compliance + DSE-Wording (Drittland US!)
9
+
10
+ ## 1. Default-Verhalten
11
+
12
+ - **Routing**: Standard via OpenAI Ireland (für EU-Kunden), aber Sub-Processors in den USA
13
+ - **EU-Data-Boundary** seit 2024-Q1 als Option (Beta) — muss explizit aktiviert werden
14
+ - **Trainings-Nutzung**: bei API-Daten OPT-OUT (Default kein Training seit 03/2023)
15
+ - **Logging**: 30 Tage Default, „Zero Data Retention" für Enterprise auf Anfrage
16
+ - **Drittland-Status**: USA — DPF-zertifiziert seit 11.10.2023
17
+
18
+ ## 2. Compliance-Risiken
19
+
20
+ | Risiko | Wirkung | Fix |
21
+ |--------|---------|-----|
22
+ | Default-Routing über USA | Drittland-Transfer | EU Data Boundary aktivieren ODER DSE-Erwähnung |
23
+ | Sub-Processor in USA (Azure / GCP) | weiterer Transfer | DPA-Sub-Processor-Liste annehmen |
24
+ | User-Prompts mit Sondersensibles | Art. 9 DSGVO + DPF | Pseudonymisierung vor Senden ODER Einwilligung |
25
+ | Hallucinations bei Health/Legal/Finance-Antworten | UWG § 5 wenn als „verlässlich" beworben | Disclaimer Pflicht |
26
+
27
+ ## 3. Code-Pattern (sanitized)
28
+
29
+ ```ts
30
+ // File: src/lib/ai/openai-client.ts
31
+ import OpenAI from 'openai';
32
+
33
+ const openai = new OpenAI({
34
+ apiKey: process.env.OPENAI_API_KEY!,
35
+ // EU-Data-Boundary aktivieren via Header (wenn Account-Setting aktiv):
36
+ baseURL: process.env.OPENAI_BASE_URL || 'https://api.openai.com/v1',
37
+ });
38
+
39
+ export async function chatWithSafeguards(userMessage: string) {
40
+ const response = await openai.chat.completions.create({
41
+ model: 'gpt-4o-mini', // oder gpt-4-turbo / gpt-5
42
+ messages: [
43
+ {
44
+ role: 'system',
45
+ content:
46
+ 'Antworte auf Deutsch. Bei medizinischen/juristischen/finanziellen Fragen ' +
47
+ 'verweise auf Fachkraft. Erfinde keine Fakten — bei Unsicherheit sage es.',
48
+ },
49
+ { role: 'user', content: userMessage },
50
+ ],
51
+ temperature: 0.7,
52
+ max_tokens: 1000,
53
+ });
54
+
55
+ return response.choices[0]?.message?.content ?? '';
56
+ }
57
+ ```
58
+
59
+ ```tsx
60
+ // File: src/components/chat/AIDisclaimerHeader.tsx
61
+ 'use client';
62
+
63
+ export function OpenAIDisclaimer() {
64
+ return (
65
+ <div className="ai-disclaimer" role="note">
66
+ <p>
67
+ 🤖 <strong>KI-Assistent.</strong> Antworten werden mit OpenAI (USA)
68
+ erzeugt. Sie können fehlerhaft sein und ersetzen keine
69
+ fachliche Beratung. Mit Nutzung stimmst du der DSGVO-konformen
70
+ Verarbeitung deiner Eingaben in den USA zu (siehe Datenschutz).
71
+ </p>
72
+ </div>
73
+ );
74
+ }
75
+ ```
76
+
77
+ ## 4. AVV / DPA
78
+
79
+ - **DPA-Link**: https://openai.com/policies/data-processing-addendum
80
+ - **Trust-Portal**: https://trust.openai.com
81
+ - **Sub-Processors**: https://openai.com/policies/sub-processor-list
82
+ - **DPF-Zertifikat**: https://www.dataprivacyframework.gov/list (suche „OpenAI")
83
+ - **Zero Data Retention**: auf Anfrage für Enterprise via support@openai.com
84
+
85
+ ## 5. DSE-Wording-Vorlage
86
+
87
+ > **KI-gestützte Funktionen (OpenAI, USA).** Für KI-basierte Funktionen
88
+ > nutzen wir die API von OpenAI Ireland Ltd (1st Floor, The Liffey Trust
89
+ > Centre, 117–126 Sheriff Street Upper, Dublin 1, Irland) und OpenAI
90
+ > L.L.C. (3180 18th Street, San Francisco, CA 94110, USA) als
91
+ > Auftragsverarbeiter im Sinne von Art. 28 DSGVO. Eingaben werden zur
92
+ > Beantwortung der Anfrage an OpenAI in den USA übermittelt
93
+ > (Drittlandtransfer Art. 44 ff. DSGVO). Rechtsgrundlage für den
94
+ > Drittlandtransfer ist Art. 45 i.V.m. dem EU-US Data Privacy Framework
95
+ > (OpenAI Inc. ist DPF-zertifiziert) sowie ergänzend EU-Standardvertrags-
96
+ > klauseln (Modul 2). Eingaben werden bei OpenAI maximal 30 Tage zur
97
+ > Missbrauchs-Erkennung gespeichert und nicht für Training verwendet
98
+ > (API-Daten-Opt-Out by default). Rechtsgrundlage: Art. 6 Abs. 1 lit. b
99
+ > DSGVO. Datenschutz OpenAI: https://openai.com/policies/privacy-policy.
100
+ >
101
+ > Hinweis: Für Anfragen mit besonders sensiblen Inhalten (Gesundheit,
102
+ > juristische / finanzielle Themen) holen wir gesonderte Einwilligung ein
103
+ > (Art. 6 Abs. 1 lit. a + Art. 9 lit. a DSGVO).
104
+
105
+ ## 6. Verify-Commands
106
+
107
+ ```bash
108
+ # Account-Setting EU-Data-Boundary prüfen (UI in OpenAI Dashboard)
109
+ # Verify Sub-Processor-Liste aktuell
110
+ curl -s https://openai.com/policies/sub-processor-list | grep -oE '<title>.*</title>'
111
+
112
+ # DPF-Zertifikat-Status
113
+ curl -s "https://www.dataprivacyframework.gov/api/PartList" | jq '.[] | select(.OrganizationName | contains("OpenAI"))'
114
+ ```
115
+
116
+ ## 7. Az.-Anker
117
+
118
+ - AI-Act VO 2024/1689 Art. 53–55 (GPAI-Pflichten OpenAI)
119
+ - AI-Act Art. 50 Transparenz (ab 02.08.2026)
120
+ - noyb-Klagen gegen ChatGPT (Stand: anhängig 2026, läuft seit 04/2024)
@@ -0,0 +1,120 @@
1
+ ---
2
+ license: MIT (snippet)
3
+ provider: NextAuth.js / Auth.js (selbstgehostet)
4
+ provider-AVV-status: nicht relevant (Self-hosted Library)
5
+ last-checked: 2026-05-01
6
+ ---
7
+
8
+ # NextAuth.js / Auth.js — Self-hosted Auth + DSE-Wording
9
+
10
+ ## 1. Default-Verhalten
11
+
12
+ - Self-hosted Library (npm: `next-auth` v4 / `@auth/nextjs` v5)
13
+ - Sessions: **JWT (default)** ODER Database-Sessions
14
+ - Cookie: `next-auth.session-token`, HttpOnly, Secure, SameSite=Lax
15
+ - Provider-Drittland-Risiken nur durch externe Auth-Provider (Google/GitHub/Apple)
16
+
17
+ ## 2. Compliance-Risiken (typische Konfigurationsfehler)
18
+
19
+ | Risiko | Wirkung | Fix |
20
+ |--------|---------|-----|
21
+ | `JWT_SECRET` in Repo | Vollständiger Auth-Bruch | env-only + Secret-Rotation |
22
+ | OAuth-Callback ohne CSRF-Token-Validierung | CSRF-Bug | Default-Verhalten von next-auth nutzen, NICHT custom |
23
+ | Session-Cookie ohne `Secure` | Session-Hijack über HTTP | `cookies.sessionToken.options.secure: true` |
24
+ | OAuth-Provider USA (Google, Apple, GitHub) | Drittland | DSE-Erwähnung pro Provider |
25
+ | Magic-Link via E-Mail (Email Provider) | Phishing | DKIM + SPF + DMARC + Rate-Limit |
26
+
27
+ ## 3. Code-Pattern (Auth.js v5, sanitized)
28
+
29
+ ```ts
30
+ // File: src/auth.ts (Auth.js v5)
31
+ import NextAuth from 'next-auth';
32
+ import Google from 'next-auth/providers/google';
33
+ import GitHub from 'next-auth/providers/github';
34
+ import Resend from 'next-auth/providers/resend';
35
+ import { PrismaAdapter } from '@auth/prisma-adapter';
36
+ import { prisma } from './lib/prisma';
37
+
38
+ export const { handlers, auth, signIn, signOut } = NextAuth({
39
+ adapter: PrismaAdapter(prisma),
40
+ providers: [
41
+ Google({
42
+ clientId: process.env.GOOGLE_CLIENT_ID!,
43
+ clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
44
+ }),
45
+ GitHub({
46
+ clientId: process.env.GITHUB_CLIENT_ID!,
47
+ clientSecret: process.env.GITHUB_CLIENT_SECRET!,
48
+ }),
49
+ Resend({ from: 'no-reply@<your-domain>' }),
50
+ ],
51
+ session: { strategy: 'database', maxAge: 30 * 24 * 60 * 60 }, // 30 Tage
52
+ cookies: {
53
+ sessionToken: {
54
+ name: '__Secure-next-auth.session-token',
55
+ options: {
56
+ httpOnly: true,
57
+ sameSite: 'lax',
58
+ path: '/',
59
+ secure: process.env.NODE_ENV === 'production',
60
+ },
61
+ },
62
+ },
63
+ callbacks: {
64
+ async session({ session, user }) {
65
+ session.user.id = user.id;
66
+ return session;
67
+ },
68
+ },
69
+ pages: {
70
+ signIn: '/login',
71
+ error: '/login?error',
72
+ },
73
+ events: {
74
+ async signIn({ user }) {
75
+ // Audit-Log
76
+ await prisma.authLog.create({
77
+ data: { userId: user.id, event: 'sign_in', timestamp: new Date() },
78
+ });
79
+ },
80
+ },
81
+ });
82
+ ```
83
+
84
+ ## 4. DSE-Wording-Vorlage
85
+
86
+ > **Authentifizierung (NextAuth / Auth.js).** Für die Anmeldung an
87
+ > unserem Dienst nutzen wir die Open-Source-Library NextAuth.js (selbst
88
+ > auf unseren EU-Servern gehostet). Wir bieten folgende Anmeldemethoden:
89
+ >
90
+ > - **E-Mail-Magic-Link** (E-Mail-Versand via Resend / All-Inkl-SMTP, je nach Konfiguration).
91
+ > - **Google-Login** (Google Ireland Limited / Google LLC, USA — Drittland-Transfer mit DPF + SCC).
92
+ > - **GitHub-Login** (GitHub Inc., USA — Drittland-Transfer mit DPF + SCC).
93
+ > - **Apple Sign-In** (Apple Distribution International, Irland).
94
+ >
95
+ > Bei Nutzung eines OAuth-Providers (Google / GitHub / Apple) werden
96
+ > Daten an den jeweiligen Anbieter übermittelt. Rechtsgrundlage: Art. 6
97
+ > Abs. 1 lit. b DSGVO (Vertragserfüllung) sowie für Drittlandtransfer
98
+ > Art. 45/46 DSGVO. Wir speichern lokal: Provider-User-ID, E-Mail,
99
+ > Profilbild-URL (sofern vom Provider freigegeben), Login-Zeitpunkt.
100
+
101
+ ## 5. Verify-Commands
102
+
103
+ ```bash
104
+ # Cookie-Inspektion nach Login
105
+ curl -sI -b /tmp/auth-cookies.txt -c /tmp/auth-cookies.txt \
106
+ https://<your-domain>/api/auth/session
107
+ # erwarte: __Secure-next-auth.session-token mit HttpOnly, Secure, SameSite=Lax
108
+
109
+ # CSRF-Token-Endpoint (next-auth's automatic CSRF-Schutz)
110
+ curl -s https://<your-domain>/api/auth/csrf | jq .csrfToken
111
+ # erwarte: 64-char Token
112
+
113
+ # Brute-Force-Test (manuell — sollte nach 5 Versuchen drosseln)
114
+ # Implementiere selbst Rate-Limit auf /api/auth/callback/credentials
115
+ ```
116
+
117
+ ## 6. Az.-Anker
118
+
119
+ - LG Berlin II 97 O 81/23 (Passwort-Identifikation, 27.11.2024)
120
+ - DSGVO Art. 32 (TOMs für Auth-Cookies — HttpOnly + Secure + SameSite)
@@ -0,0 +1,104 @@
1
+ ---
2
+ license: MIT (snippet) / Vendor-Doc separat
3
+ provider: Supabase Inc. (Delaware, USA)
4
+ provider-AVV-status: Standardvertrag verfügbar (DPA + EU-SCC)
5
+ last-checked: 2026-05-01
6
+ ---
7
+
8
+ # Supabase Auth — TOMs + DPA + DSE-Wording
9
+
10
+ ## 1. Default-Verhalten ohne Konfiguration
11
+
12
+ - Datenstandort konfigurierbar (eu-central-1 / eu-west-2 / ap-southeast-1 / us-east-1 / etc.)
13
+ - **Default-Cookie**: `sb-<project>-auth-token`, HttpOnly, Secure, SameSite=Lax (in @supabase/ssr v0.5+)
14
+ - Authentifizierungs-Daten in PostgreSQL-Schema `auth` mit RLS
15
+ - Sub-Auftragsverarbeiter: AWS (Hosting), CloudFlare (CDN), Stripe (Billing für Pro-Tier)
16
+
17
+ ## 2. Compliance-Risiken
18
+
19
+ | Risiko | Wirkung | Fix |
20
+ |--------|---------|-----|
21
+ | Default-Region us-east-1 | Drittland-Transfer USA | EU-Region setzen (eu-central-1 = Frankfurt) |
22
+ | Sub-Processor AWS | weiterer Transfer | DPA-Sub-Liste anhängen |
23
+ | `auth.users.email` ohne Verschlüsselung | DSGVO Art. 32 — minimal-akzeptabel | Plus: PII-pseudonymized columns |
24
+ | Magic-Link via E-Mail | Phishing-Risiko | DMARC + SPF + DKIM auf custom-Sending-Domain |
25
+
26
+ ## 3. Code-Pattern (sanitized)
27
+
28
+ ```ts
29
+ // File: src/lib/supabase/client.ts
30
+ // SSR-safe pattern with @supabase/ssr v0.5+
31
+ import { createBrowserClient } from '@supabase/ssr';
32
+
33
+ export const createClient = () =>
34
+ createBrowserClient(
35
+ process.env.NEXT_PUBLIC_SUPABASE_URL!,
36
+ process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY!,
37
+ {
38
+ auth: {
39
+ flowType: 'pkce', // PKCE statt implicit — Pflicht für Sicherheit
40
+ autoRefreshToken: true,
41
+ persistSession: true,
42
+ detectSessionInUrl: true,
43
+ },
44
+ cookies: {
45
+ // Cookie-Hardening
46
+ sameSite: 'lax',
47
+ secure: true,
48
+ },
49
+ },
50
+ );
51
+ ```
52
+
53
+ ```sql
54
+ -- Pflicht: RLS auf jeder Tabelle die User-Daten enthält
55
+ ALTER TABLE public.<your_table> ENABLE ROW LEVEL SECURITY;
56
+
57
+ CREATE POLICY "users_select_own"
58
+ ON public.<your_table>
59
+ FOR SELECT
60
+ USING (user_id = auth.uid());
61
+
62
+ -- Anti-Pattern (KEINE!) für public-schema RPCs:
63
+ -- CREATE FUNCTION public.foo(p_user_id uuid) ... SECURITY DEFINER
64
+ -- → CWE-863 Anti-Pattern (siehe AEGIS rls-defense skill)
65
+ ```
66
+
67
+ ## 4. AVV / DPA
68
+
69
+ - **DPA-Link**: https://supabase.com/legal/dpa
70
+ - **SCC-Modul**: Module 2 (Controller-Processor) + Module 3 für Sub-Processors
71
+ - **AVV-Stand**: 2024-Q1 (mit DPF-Erweiterung)
72
+ - **Sub-Processors**: https://supabase.com/legal/sub-processors
73
+
74
+ ## 5. DSE-Wording-Vorlage
75
+
76
+ > Wir nutzen den Auth- und Datenbank-Service von Supabase Inc. (970 Toa
77
+ > Payoh North #07-04, Singapur 318992, mit Headquarters in Delaware/USA)
78
+ > als Auftragsverarbeiter im Sinne von Art. 28 DSGVO. Daten werden in
79
+ > der EU-Region (Frankfurt, eu-central-1) gespeichert. Für unvermeidbare
80
+ > Datenübermittlungen in die USA (Stripe-Billing, US-Sub-Processors)
81
+ > haben wir EU-Standardvertragsklauseln (Modul 2/3) abgeschlossen.
82
+ > Datenschutzhinweise von Supabase: https://supabase.com/privacy.
83
+
84
+ ## 6. Verify-Commands
85
+
86
+ ```bash
87
+ # Region-Check
88
+ curl -s "https://<project>.supabase.co/rest/v1/" \
89
+ -H "apikey: $ANON_KEY" -I | grep -i "region\|x-region"
90
+
91
+ # Cookie-Inspection
92
+ curl -sI https://<your-domain>/api/auth/callback | grep -i set-cookie
93
+ # erwarte: HttpOnly, Secure, SameSite=Lax
94
+
95
+ # RLS-Probe (anon-Token darf NICHT alle rows sehen)
96
+ curl -s "https://<project>.supabase.co/rest/v1/<table>?select=*" \
97
+ -H "apikey: $ANON_KEY" | jq 'length'
98
+ # erwarte: 0 (anon hat keine Rows ohne Login)
99
+ ```
100
+
101
+ ## 7. Az.-Anker
102
+
103
+ - AEGIS-Lessons: 21 CWE-863 IDOR-Vulns aus public-schema-SECURITY-DEFINER-RPCs (operativer Audit 2026-04-29 einer Pet-Care-Plattform)
104
+ - Pattern: SECURITY-DEFINER-Functions in `public` brauchen `auth.uid()`-Guard + REVOKE FROM PUBLIC
@@ -0,0 +1,93 @@
1
+ ---
2
+ license: MIT (snippet)
3
+ purpose: Next.js (App Router 14+) Strict-Dynamic-CSP via middleware/proxy.ts
4
+ references: audit-patterns.md HIGH-RISK-CSP-Migration, references/templates/proxy-strict-dynamic.ts.example
5
+ last-checked: 2026-05-01
6
+ ---
7
+
8
+ # Next.js — Strict-Dynamic-CSP via middleware/proxy
9
+
10
+ ## Anlass
11
+
12
+ `script-src 'unsafe-inline'` ist die häufigste CSP-Schwäche in Next.js-Sites. Strict-Dynamic + nonce ersetzt das ohne legitime inline-Scripts zu brechen.
13
+
14
+ ## Pflicht-Migration-Strategy (HIGH-RISK)
15
+
16
+ Diese Migration darf NIE direct-push sein:
17
+ 1. Feature-Branch erstellen
18
+ 2. middleware.ts mit nonce-Generation + CSP-Header
19
+ 3. layout.tsx liest `headers().get('x-nonce')` und gibt es an inline-Scripts
20
+ 4. Stripe-Elements + Supabase-OAuth + Google-Maps + GA-Snippets jeweils mit `nonce={nonce}`-Prop
21
+ 5. Intensive Tests aller Interaktiv-Features
22
+ 6. Stakeholder-Review
23
+ 7. Merge nur nach Approval
24
+
25
+ ## Code-Pattern
26
+
27
+ Siehe vollständiges Snippet: `references/templates/proxy-strict-dynamic.ts.example`
28
+
29
+ Kern-Idee:
30
+ ```ts
31
+ // middleware.ts (Next.js 14+)
32
+ const nonce = btoa(crypto.getRandomValues(new Uint8Array(16)).join(''));
33
+ response.headers.set('Content-Security-Policy',
34
+ `script-src 'self' 'nonce-${nonce}' 'strict-dynamic' https:`);
35
+ response.headers.set('x-nonce', nonce);
36
+ ```
37
+
38
+ ```tsx
39
+ // layout.tsx
40
+ import { headers } from 'next/headers';
41
+ const nonce = headers().get('x-nonce') ?? '';
42
+ return <Script id="bootstrap" nonce={nonce}>...</Script>;
43
+ ```
44
+
45
+ ## CSP-Direktiven-Checkliste
46
+
47
+ | Direktive | Empfehlung | Warum |
48
+ |-----------|------------|-------|
49
+ | `default-src 'self'` | Pflicht | Restriktiver Default |
50
+ | `script-src 'self' 'nonce-XXX' 'strict-dynamic' https:` | Pflicht | XSS-Schutz |
51
+ | `style-src 'self' 'nonce-XXX'` | Empfohlen | inline-Style nur mit Nonce |
52
+ | `img-src 'self' data: https://<your-cdn>` | Pflicht | Bild-Quellen begrenzt |
53
+ | `connect-src 'self' https://<api> https://<analytics>` | Pflicht | API-Whitelist |
54
+ | `frame-src 'self' https://<embed>` | Pflicht | iFrame-Whitelist |
55
+ | `frame-ancestors 'none'` | Pflicht | Clickjacking-Schutz |
56
+ | `object-src 'none'` | Pflicht | Flash-Disable |
57
+ | `base-uri 'self'` | Pflicht | Base-Tag-Hijack-Schutz |
58
+ | `form-action 'self'` | Pflicht | Form-Action-Beschränkung |
59
+ | `upgrade-insecure-requests` | Empfohlen | HTTPS-Auto-Upgrade |
60
+
61
+ ## Defense-in-Depth Headers (zusätzlich zur CSP)
62
+
63
+ ```ts
64
+ response.headers.set('X-Frame-Options', 'DENY');
65
+ response.headers.set('X-Content-Type-Options', 'nosniff');
66
+ response.headers.set('Referrer-Policy', 'strict-origin-when-cross-origin');
67
+ response.headers.set('Strict-Transport-Security',
68
+ 'max-age=63072000; includeSubDomains; preload');
69
+ response.headers.set('Permissions-Policy',
70
+ 'camera=(), microphone=(), geolocation=(self), interest-cohort=()');
71
+ ```
72
+
73
+ ## Verify-Commands
74
+
75
+ ```bash
76
+ # CSP-Header prüfen
77
+ curl -sIS https://<your-domain> | grep -i 'content-security-policy'
78
+ # erwarte: 'nonce-...' + 'strict-dynamic'; KEIN 'unsafe-inline'
79
+
80
+ # Mozilla Observatory-Score
81
+ curl -s "https://http-observatory.security.mozilla.org/api/v1/analyze?host=<your-domain>" \
82
+ -X POST | jq .grade
83
+ # erwarte: A oder A+
84
+
85
+ # CSP-Reporting (optional, für Drift-Detection)
86
+ # response.headers.set('Content-Security-Policy-Report-Only', '...; report-uri /api/csp-report');
87
+ ```
88
+
89
+ ## Az.-Anker (CSP allgemein)
90
+
91
+ - DSGVO Art. 32 — TOMs (CSP ist anerkannte TOM)
92
+ - ENISA + BSI-Empfehlungen für moderne Web-Sicherheit
93
+ - OWASP Top 10 2023 — A03:2021 Injection