@aegis-scan/skills 0.2.0 → 0.4.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.
- package/ATTRIBUTION.md +60 -4
- package/CHANGELOG.md +78 -0
- package/README.md +27 -0
- package/dist/bin.js +1 -1
- package/dist/commands/list.d.ts.map +1 -1
- package/dist/commands/list.js +9 -2
- package/dist/commands/list.js.map +1 -1
- package/dist/skills-loader.d.ts +43 -0
- package/dist/skills-loader.d.ts.map +1 -1
- package/dist/skills-loader.js +102 -0
- package/dist/skills-loader.js.map +1 -1
- package/package.json +1 -1
- package/sbom.cdx.json +1 -1
- package/skills/compliance/_INDEX.md +49 -0
- package/skills/compliance/aegis-native/brutaler-anwalt/SKILL.md +100 -3
- package/skills/defensive/aegis-native/rls-defense/SKILL.md +25 -0
- package/skills/defensive/aegis-native/tenant-isolation-defense/SKILL.md +26 -0
- package/skills/foundation/_INDEX.md +73 -0
- package/skills/foundation/aegis-native/aegis-audit/SKILL.md +194 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-1-headers.md +138 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-2-html.md +153 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-3-impressum.md +159 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-4-dse.md +178 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-5-cookie.md +180 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-6-branche.md +204 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-7-code-cross-check.md +212 -0
- package/skills/foundation/aegis-native/aegis-audit/references/layer-8-schadens-diagnose.md +232 -0
- package/skills/foundation/aegis-native/aegis-customer-build/SKILL.md +232 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-1-recon.md +147 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-2-architecture.md +164 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-3-component-build.md +231 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-4-content.md +196 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-5-integration.md +273 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-6-mid-audit.md +200 -0
- package/skills/foundation/aegis-native/aegis-customer-build/references/phase-7-final-verify.md +258 -0
- package/skills/foundation/aegis-native/aegis-handover-writer/SKILL.md +128 -0
- package/skills/foundation/aegis-native/aegis-module-builder/SKILL.md +251 -0
- package/skills/foundation/aegis-native/aegis-orchestrator/SKILL.md +146 -0
- package/skills/foundation/aegis-native/aegis-quality-gates/SKILL.md +122 -0
- package/skills/foundation/aegis-native/aegis-skill-creator/SKILL.md +223 -0
- package/skills/foundation/aegis-native/aegis-skill-creator/references/hard-constraint-template.md +213 -0
- package/skills/foundation/aegis-native/aegis-skill-creator/references/skillforge-methodology.md +220 -0
- package/skills/foundation/aegis-native/dsgvo-compliance/SKILL.md +185 -0
- package/skills/foundation/aegis-native/dsgvo-compliance/references/art-13-15-templates.md +309 -0
- package/skills/foundation/aegis-native/dsgvo-compliance/references/datenpanne-runbook.md +291 -0
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
---
|
|
3
3
|
name: brutaler-anwalt
|
|
4
4
|
description: Adversarial DE/EU Compliance-Auditor mit Multi-Persona-Self-Verification fuer DSGVO/UWG/AGB/Impressum/Cookies/AVV/NIS2/AI-Act/Branchen-/Straf-/Steuerrecht. Drei interne Anwaelte (Hunter/Challenger/Synthesizer) pruefen Findings adversarial auf False-Positives + Cross-Bereich-Risiken. Output sachlich-praezise mit %-Wahrscheinlichkeit + €-Schadensschaetzung + Abmahn-Simulation. Aktiviert bei /anwalt, /audit, /compliance-check oder Keywords: dsgvo, datenschutz, impressum, cookie, abmahnung, compliance, agb, avv, drittland, einwilligung, ttdsg, ddg, tmg, uwg, nis2, ai-act, gobd, dsa, urheber, marke, ePrivacy, drittlandtransfer, schrems, eugh, bgh, abmahnanwalt, datenpanne, betroffenenrechte, art-13, art-15, art-83, scc, tia, dsfa, vvt, dpo, dsb, lg-muenchen-google-fonts, fashion-id. KEINE Rechtsberatung i.S.d. RDG.
|
|
5
|
+
model: opus
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
required_tools: "shell-ops,file-ops,curl,playwright,aegis-scan"
|
|
9
|
+
required_audit_passes: "2"
|
|
10
|
+
enforced_quality_gates: "9"
|
|
11
|
+
pre_done_audit: "true"
|
|
5
12
|
---
|
|
6
13
|
|
|
7
14
|
# Brutaler Anwalt — Adversarial DE/EU Compliance Auditor
|
|
@@ -10,6 +17,31 @@ description: Adversarial DE/EU Compliance-Auditor mit Multi-Persona-Self-Verific
|
|
|
10
17
|
|
|
11
18
|
---
|
|
12
19
|
|
|
20
|
+
## HARD-CONSTRAINT — Reference-Loading
|
|
21
|
+
|
|
22
|
+
Dieser Skill agiert NIE ohne Reference-Backup. Vor jedem Output-Schritt:
|
|
23
|
+
|
|
24
|
+
1. **Self-Test Reference-State** — habe ich aus `references/` geladen?
|
|
25
|
+
- Wenn nein → STOP, References laden, dann erneut starten.
|
|
26
|
+
- Wenn ja → welche? (mind. `audit-patterns.md` + topic-spezifische muessen geladen sein)
|
|
27
|
+
|
|
28
|
+
2. **Pro Finding mind. 1 Reference-Quelle**:
|
|
29
|
+
- § / Art. / Az. zitiert
|
|
30
|
+
- Reference-File-Pfad genannt (z.B. `references/dsgvo.md` Zeile X)
|
|
31
|
+
- Wenn keine Reference → Finding NICHT ausgeben, stattdessen: „Reference-Luecke — Pattern X nicht in References abgedeckt, manuelle Pruefung empfohlen"
|
|
32
|
+
|
|
33
|
+
3. **Improvisations-Verbot**:
|
|
34
|
+
- KEINE %-Schaetzung ohne Begruendungs-Kette aus `audit-patterns.md` Schadens-Diagnose-Formel
|
|
35
|
+
- KEINE Fix-Empfehlung ohne Risiko-Klassifikation (LOW/MEDIUM/HIGH per `audit-patterns.md`)
|
|
36
|
+
- KEINE Az.-Nummer ohne Cross-Check in `references/bgh-urteile.md`
|
|
37
|
+
|
|
38
|
+
4. **Reference-Luecke = Skill-Verbesserungs-Trigger**:
|
|
39
|
+
- Im Output transparent kennzeichnen
|
|
40
|
+
- User-Action vorschlagen: Reference erweitern + erneut auditieren
|
|
41
|
+
- Skill darf KEINE Improvisationen liefern fuer Pattern ohne Reference-Backup
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
13
45
|
## Mission
|
|
14
46
|
|
|
15
47
|
Maximaler Rechts-Stress-Test fuer Web-Projekte (Sites, SaaS, Shops, Apps). Findet aktiv Compliance-Luecken, die ein **gegnerischer Abmahn-Anwalt oder eine Aufsichtsbehoerde** finden wuerde. Kein Optimismus, keine Beruhigung — paranoid-praezise Schadens-Diagnose mit %-Wahrscheinlichkeit, €-Bandbreite, Az.+§-Belegen, Abmahn-Simulation.
|
|
@@ -41,7 +73,32 @@ Bei jedem Audit fuehrt der Skill drei Personas hintereinander aus. Sie sind kein
|
|
|
41
73
|
|
|
42
74
|
---
|
|
43
75
|
|
|
44
|
-
##
|
|
76
|
+
## Process
|
|
77
|
+
|
|
78
|
+
Der Skill folgt einem festen Drei-Persona-Workflow + Vier-Modi-Routing. Pro Audit:
|
|
79
|
+
|
|
80
|
+
1. **Modus-Erkennung** — siehe Modi-Liste unten (SCAN / HUNT / SIMULATE / CONSULT)
|
|
81
|
+
2. **Reference-Loading** — passende References aus `references/` laden (siehe `Reference-Loading-Map`); HARD-CONSTRAINT-Block oben erzwingt das
|
|
82
|
+
3. **Persona-Pipeline (intern, sequenziell)**:
|
|
83
|
+
- Phase 1: HUNTER scannt → Findings-Liste mit %, €-Range, §
|
|
84
|
+
- Phase 2: CHALLENGER falsifiziert jedes Finding → verified | disputed | false-positive
|
|
85
|
+
- Phase 3: SYNTHESIZER konsolidiert + Cross-Risiken → finales Output
|
|
86
|
+
4. **Output** im 4-Sektionen-Format (siehe `## Output-Format` unten)
|
|
87
|
+
5. **Verification** — Self-Test-Checkliste durchgehen vor Done-Claim (siehe `## Verification / Success Criteria` unten)
|
|
88
|
+
|
|
89
|
+
### HUNTER-8-Phasen-Workflow (intern, jeder SCAN-Pass)
|
|
90
|
+
|
|
91
|
+
Per `references/audit-patterns.md`:
|
|
92
|
+
1. HEADER-AUDIT (curl -sSI auf Live-URL)
|
|
93
|
+
2. HTML-LIVE-PROBE (SSR-Inhalt + DOM-Struktur)
|
|
94
|
+
3. IMPRESSUM-AUDIT (DDG §5 + Footer-Link-Resolver)
|
|
95
|
+
4. DSE-AUDIT (DSGVO Art. 13 + Drittland + AVV)
|
|
96
|
+
5. COOKIE-/CONSENT-AUDIT (TTDSG §25 + Pre-consent-Tracking)
|
|
97
|
+
6. BRANCHEN-LAYER (BORA/HWG/LMIV/etc., wenn identifizierbar)
|
|
98
|
+
7. CSP-CODE-CROSS-CHECK (wenn Repo-Zugriff)
|
|
99
|
+
8. SCHADENS-DIAGNOSE-FORMEL (SYNTHESIZER-Konsolidierung)
|
|
100
|
+
|
|
101
|
+
### Modi
|
|
45
102
|
|
|
46
103
|
Erkenne den Modus aus dem Kontext oder frage einmal (kurz, nicht romanhaft) nach. Mehrere Modi pro Session moeglich.
|
|
47
104
|
|
|
@@ -194,7 +251,24 @@ Lade nur die passenden References — nicht alle auf einmal. Token-Disziplin.
|
|
|
194
251
|
|
|
195
252
|
---
|
|
196
253
|
|
|
197
|
-
##
|
|
254
|
+
## Verification / Success Criteria
|
|
255
|
+
|
|
256
|
+
Vor jedem `done`-Claim oder Output-Abgabe MUSS der Skill diese Checkliste positiv beantworten:
|
|
257
|
+
|
|
258
|
+
- [ ] References geladen? Mindestens `audit-patterns.md` + topic-spezifische References (z.B. `dsgvo.md` fuer DSGVO-Sachverhalte)
|
|
259
|
+
- [ ] Jedes Finding hat § / Art. + Az. + Reference-File-Pfad?
|
|
260
|
+
- [ ] HUNTER-Phase fuer alle Inputs durchlaufen (Headers, HTML, Impressum, DSE, Cookie, Branche, Code, Schadens-Diagnose)?
|
|
261
|
+
- [ ] CHALLENGER-Phase fuer JEDES Finding (verified | disputed | false-positive markiert)?
|
|
262
|
+
- [ ] SYNTHESIZER-Konsolidierung gemacht (Cross-Bereich-Risiken geprueft, %-Bewertung berechnet)?
|
|
263
|
+
- [ ] Risk-Klassifikation pro Fix-Vorschlag (LOW / MEDIUM / HIGH per audit-patterns.md)?
|
|
264
|
+
- [ ] Disclaimer i.S.d. RDG am Ende des Outputs?
|
|
265
|
+
- [ ] Bei Wahrscheinlichkeit > 60% oder Modus = SIMULATE: Abmahn-Brief generiert?
|
|
266
|
+
|
|
267
|
+
Wenn auch nur **eine** Checkbox nicht erfuellt: NICHT als `done` deklarieren. Stattdessen melden welche Checkbox offen ist + warum + Empfehlung.
|
|
268
|
+
|
|
269
|
+
---
|
|
270
|
+
|
|
271
|
+
## Triggers
|
|
198
272
|
|
|
199
273
|
### Slash-Commands
|
|
200
274
|
- `/anwalt` — Default SCAN-Modus auf aktuelles Repo/Branch
|
|
@@ -262,7 +336,7 @@ Wenn der User unspezifisch fragt („pruefe meine Site"), stelle **maximal 3 pri
|
|
|
262
336
|
|
|
263
337
|
---
|
|
264
338
|
|
|
265
|
-
## Anti-
|
|
339
|
+
## Anti-Patterns (was der Skill NICHT tut)
|
|
266
340
|
|
|
267
341
|
- ❌ **Keine Beruhigung**. „Das ist wahrscheinlich OK" gibt es nicht. Entweder verified-low-risk oder verified-risk.
|
|
268
342
|
- ❌ **Keine Theatraliik / Sarkasmus / Beleidigungen**. User-Direktive: Sicherheit, kein Entertainment.
|
|
@@ -302,4 +376,27 @@ Wenn Reference-Files aktualisiert werden (neue Urteile, neue Gesetze):
|
|
|
302
376
|
|
|
303
377
|
---
|
|
304
378
|
|
|
379
|
+
## Extension Points
|
|
380
|
+
|
|
381
|
+
So erweitert man `brutaler-anwalt` ohne den Kern zu brechen:
|
|
382
|
+
|
|
383
|
+
- **Neue References** hinzufuegen unter `references/`:
|
|
384
|
+
- Datei mit Markdown-Sektionen + Az.-Nummern + §-Verweisen
|
|
385
|
+
- Eintrag in `Reference-Loading-Map` oben anlegen (Sachverhalt → File)
|
|
386
|
+
- `audit-patterns.md` referenzieren wenn neue Pattern-Klasse hinzukommt
|
|
387
|
+
- `references/bgh-urteile.md` zentrale Urteils-DB — neue Urteile dort einpflegen, andere References zitieren von dort
|
|
388
|
+
- **Neue Branchen** in `references/branchenrecht.md` ergaenzen:
|
|
389
|
+
- Neuer Branchen-Block mit Pflicht-Checkliste, branchen-spezifischen §§, typischen Abmahnpunkten
|
|
390
|
+
- Trigger-Keywords in `Auto-Trigger via Keywords` ergaenzen
|
|
391
|
+
- **Neue Modi** durch `### Modus N` Section unter `### Modi`:
|
|
392
|
+
- Klar abgrenzen vom bestehenden 4-Modi-Set
|
|
393
|
+
- `Vorgehen`-Liste konkret + reproduzierbar
|
|
394
|
+
- **Plugin-Hooks** (consumer-side, optional):
|
|
395
|
+
- SessionStart-Hook in `.claude/settings.json` der `/anwalt scan` automatisch fuer neue Sessions auf Compliance-relevanten Repos triggert
|
|
396
|
+
- PreToolUse-Hook der vor `git push` einen Quick-Anwalt-Scan laeuft
|
|
397
|
+
- **AEGIS-Integration**: erweitern via `references/aegis-integration.md` wenn neue AEGIS-Module erscheinen (Tier-X Module-Mapping)
|
|
398
|
+
- **AGENTS.md-Routing**: Skill ist via `compliance/_INDEX.md` geroutet — bei neuen Triggern dort eintragen, nicht im SKILL.md duplizieren
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
305
402
|
**Skill aktiviert. Startbereit fuer Audit.**
|
|
@@ -167,6 +167,31 @@ Order of operations:
|
|
|
167
167
|
|
|
168
168
|
Run `aegis scan .` on your repo; fix everything `rls-bypass-checker` and `tenant-isolation-checker` flag before going to production.
|
|
169
169
|
|
|
170
|
+
## Complementary external skill (mandatory)
|
|
171
|
+
|
|
172
|
+
This AEGIS skill covers the **security-remediation layer** —
|
|
173
|
+
scanner-finding mapping, incident-response, multi-tenant
|
|
174
|
+
isolation invariants. It does **not** cover RLS performance
|
|
175
|
+
optimization in depth, because that is the upstream Supabase
|
|
176
|
+
team's domain and is maintained as a separate skill.
|
|
177
|
+
|
|
178
|
+
When working on RLS at any depth, install the upstream Supabase
|
|
179
|
+
skill package once, globally:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
npx skills add supabase/agent-skills -g -y
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
That ships
|
|
186
|
+
[`supabase-postgres-best-practices`](https://github.com/supabase/agent-skills/tree/main/skills/supabase-postgres-best-practices),
|
|
187
|
+
whose three `security-*` reference files complement this skill:
|
|
188
|
+
|
|
189
|
+
- `references/security-rls-basics.md` — the canonical RLS-enable + policy pattern as Supabase recommends it.
|
|
190
|
+
- `references/security-rls-performance.md` — the `(select auth.uid())` wrap that turns a per-row function call into a single-evaluation cached call (5–10x faster on large tables), security-definer helper functions for complex membership checks, and the discipline of indexing every column referenced inside an RLS policy.
|
|
191
|
+
- `references/security-privileges.md` — least-privilege role design and GRANT minimization, the layer beneath RLS.
|
|
192
|
+
|
|
193
|
+
When the AEGIS `rls-bypass-checker` flags a finding and you have a working policy fix, consult the upstream `security-rls-performance.md` next to ensure the fixed policy is also performant on production-sized tables. RLS that is correct but slow gets disabled by stressed engineers, which re-opens the security hole.
|
|
194
|
+
|
|
170
195
|
## See also
|
|
171
196
|
|
|
172
197
|
- AEGIS scaffold's RLS bootstrap migration — `aegis new <project>` ships a `tenants` + `profiles` table + auto-profile-on-signup trigger pre-wired.
|
|
@@ -218,6 +218,32 @@ Run this on every CI run. Tenant-isolation regressions silently leak data; you n
|
|
|
218
218
|
- `mass-assignment-checker` (CWE-915) — flags unvalidated body → `.insert()`.
|
|
219
219
|
- `aegis-wizard/cli` scaffold — ships `secureApiRouteWithTenant`, the `tenants` + `profiles` schema with the auto-profile-on-signup trigger, and an exemplary API route demonstrating the composition pattern.
|
|
220
220
|
|
|
221
|
+
## Complementary external skill (mandatory)
|
|
222
|
+
|
|
223
|
+
This skill covers **API-route-level tenant isolation**: the
|
|
224
|
+
`secureApiRouteWithTenant` primitive, JWT-sourced tenant
|
|
225
|
+
injection, request-input rejection, and AEGIS scanner-finding
|
|
226
|
+
remediation. It does not cover the broader Supabase development
|
|
227
|
+
surface (Auth setup, Edge Functions, Realtime, Storage,
|
|
228
|
+
migration workflow, MCP server integration) or Postgres
|
|
229
|
+
performance.
|
|
230
|
+
|
|
231
|
+
When designing a multi-tenant Supabase project, install the
|
|
232
|
+
upstream Supabase skill package once, globally:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
npx skills add supabase/agent-skills -g -y
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
The two skills it ships are complementary to this one:
|
|
239
|
+
|
|
240
|
+
- [`supabase`](https://github.com/supabase/agent-skills/tree/main/skills/supabase) — the comprehensive Supabase development skill: the JWT vs `app_metadata` vs `user_metadata` security trap (critical for tenant-isolation policies), `WITH (security_invoker = true)` for views (RLS bypass otherwise), Storage upsert needing INSERT+SELECT+UPDATE (silent failures otherwise), CLI / migration / MCP workflow.
|
|
241
|
+
- [`supabase-postgres-best-practices`](https://github.com/supabase/agent-skills/tree/main/skills/supabase-postgres-best-practices) — Postgres performance reference: the `security-rls-performance.md` and `security-privileges.md` files complement this skill's tenant-filtering invariant with performance and least-privilege discipline.
|
|
242
|
+
|
|
243
|
+
The mandate is documented at the top of the AEGIS repository in
|
|
244
|
+
[`AGENTS.md`](../../../../../../AGENTS.md) and in the skills package
|
|
245
|
+
[`ATTRIBUTION.md`](../../../../ATTRIBUTION.md#required-external-skills-mandatory-complement-not-forked).
|
|
246
|
+
|
|
221
247
|
## See also
|
|
222
248
|
|
|
223
249
|
- `defensive-rls-defense` skill — the RLS counterpart that complements API-route-level isolation.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# foundation/_INDEX.md — Foundation Skill Trigger-Table
|
|
2
|
+
|
|
3
|
+
Routes the Foundation's own skills (orchestrator, customer-build, audit, etc.) based on user intent + keyword triggers. Loaded on-demand by the master `AGENTS.md` router when a Foundation-related request arrives.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Skills in this category
|
|
8
|
+
|
|
9
|
+
| Trigger keywords | → Skill | Frontmatter `model` | Loaded path |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| start, session, bootstrap, phase, handover, weiter, weitermachen, übergabe, recap | `aegis-orchestrator` | opus | `foundation/aegis-native/aegis-orchestrator/SKILL.md` |
|
|
12
|
+
| handover, übergabe, session-ende, fertig, recap, abschluss | `aegis-handover-writer` | sonnet | `foundation/aegis-native/aegis-handover-writer/SKILL.md` |
|
|
13
|
+
| verify, check all gates, quality-gates, audit-gate, pre-commit-check | `aegis-quality-gates` | sonnet | `foundation/aegis-native/aegis-quality-gates/SKILL.md` |
|
|
14
|
+
| build customer, kundenseite, neue site, konfigurator-briefing, autonomous-build, 3h-build | `aegis-customer-build` | opus | `foundation/aegis-native/aegis-customer-build/SKILL.md` |
|
|
15
|
+
| module, feature, db-migration, api-route, refactor, neue funktion, neue api, neues modul | `aegis-module-builder` | sonnet | `foundation/aegis-native/aegis-module-builder/SKILL.md` |
|
|
16
|
+
| audit, paranoid-audit, AAA+++ check, 8-layer, security-audit, full-audit | `aegis-audit` | opus | `foundation/aegis-native/aegis-audit/SKILL.md` |
|
|
17
|
+
| neuer skill, skill erstellen, skill verbessern, skill audit, meta-skill, skillforge | `aegis-skill-creator` | opus | `foundation/aegis-native/aegis-skill-creator/SKILL.md` |
|
|
18
|
+
| consent, retention, art-13, art-15, art-33, datenpanne, drittland, dsgvo-baseline, schrems | `dsgvo-compliance` | opus | `foundation/aegis-native/dsgvo-compliance/SKILL.md` |
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Slash-Commands
|
|
23
|
+
|
|
24
|
+
- `/start` / `/session` / `/bootstrap` — invoke aegis-orchestrator
|
|
25
|
+
- `/verify` / `/check all gates` — invoke aegis-quality-gates
|
|
26
|
+
- `/handover` / `/übergabe` / `/session-ende` — invoke aegis-handover-writer
|
|
27
|
+
- `/build` / `/customer-build` / `/agentur-build` — invoke aegis-customer-build
|
|
28
|
+
- `/module` / `/feature` / `/refactor` — invoke aegis-module-builder
|
|
29
|
+
- `/audit` / `/paranoid-audit` / `/8-layer` — invoke aegis-audit
|
|
30
|
+
- `/skill-creator` / `/new-skill` / `/skill-audit` — invoke aegis-skill-creator
|
|
31
|
+
- `/dsgvo` / `/art-13` / `/art-15` / `/datenpanne` / `/schrems` — invoke dsgvo-compliance
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Rules for foundation skills
|
|
36
|
+
|
|
37
|
+
- Each skill MUST have `metadata.required_tools`, `metadata.pre_done_audit`, `model`, `license` populated per the v0.3.0+ HARD-CONSTRAINT-frontmatter format.
|
|
38
|
+
- Each skill MUST validate `python3 /tmp/SkillForge/scripts/validate-skill.py <skill>` at 16/17 or higher (the 1-warning ceiling allows for "5 phases recommend 1-3" advisories on intentionally-multi-phase skills).
|
|
39
|
+
- Multi-file skills (SKILL.md + sibling `references/`) are auto-installed; references kept under `<skill>/references/`.
|
|
40
|
+
- The master `AGENTS.md` tool-mapping table is canonical — skills reference tool-categories (`shell-ops`, `file-ops`, etc.), the AGENTS.md tells the agent which actual harness-tool to use.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Bootstrap-checklist (called by master AGENTS.md)
|
|
45
|
+
|
|
46
|
+
When this category is loaded:
|
|
47
|
+
|
|
48
|
+
1. Verify the matched skill's SKILL.md is in context (read it, don't just assume).
|
|
49
|
+
2. Check the skill's `metadata.required_tools` — confirm those tool-categories are available in the harness (per AGENTS.md tool-mapping table).
|
|
50
|
+
3. If `metadata.pre_done_audit: "true"` — note it; the skill will not be allowed to declare DONE without explicit pre-done-audit completion.
|
|
51
|
+
4. Print: `Loaded foundation skill: <name>, model: <opus|sonnet|haiku>, audit-passes: <N>, gates: <N>`.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Cluster Composition Patterns
|
|
56
|
+
|
|
57
|
+
The 8 foundation skills compose into use-case clusters per master `AGENTS.md` Use-Case Routing:
|
|
58
|
+
|
|
59
|
+
| Use-case | Cluster |
|
|
60
|
+
|---|---|
|
|
61
|
+
| customer-build | aegis-orchestrator → aegis-customer-build (multi-agent) → aegis-quality-gates → aegis-handover-writer |
|
|
62
|
+
| compliance-audit | aegis-orchestrator → aegis-audit + brutaler-anwalt (cross-validate) → dsgvo-compliance (fix-templates) → aegis-handover-writer |
|
|
63
|
+
| dev-feature | aegis-orchestrator → aegis-module-builder (TDD) → aegis-quality-gates → aegis-handover-writer |
|
|
64
|
+
| aegis-self-test | aegis-orchestrator → aegis-quality-gates → aegis-audit → aegis-handover-writer |
|
|
65
|
+
| skill-authoring | aegis-orchestrator → aegis-skill-creator → aegis-quality-gates → aegis-handover-writer |
|
|
66
|
+
|
|
67
|
+
Each cluster ends with `aegis-handover-writer` to ensure the next session starts with full context.
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Forward-compat note
|
|
72
|
+
|
|
73
|
+
`foundation/_INDEX.md` at v0.4.0+ routes the full 8-skill foundation cluster. Future foundation-additions (e.g., `aegis-deploy` for Hetzner-Dokploy automation, `aegis-monitoring` for post-deploy observability) get rows added here + corresponding SKILL.md folders under `foundation/aegis-native/`.
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
<!-- aegis-local: AEGIS-native skill, MIT-licensed; 8-Layer paranoid-audit skill. Headers / HTML / Impressum / DSE / Cookie / Branche / Code-Cross-Check / Schadens-Diagnose. Runs against built customer-site, gegen Live-URL, oder gegen lokales Repo. Output 4-section format (Schadens-Diagnose / Findings-Tabelle / Anwalts-Anhang / Abmahn-Simulation). Pattern ported from a private operational reference; this is the public OSS variant. -->
|
|
2
|
+
---
|
|
3
|
+
name: aegis-audit
|
|
4
|
+
description: 8-Layer paranoid-audit skill. Headers / HTML / Impressum / DSE / Cookie / Branche / Code-Cross-Check / Schadens-Diagnose. Runs against built site, live URL, or local repo. Output 4-section - Schadens-Diagnose / Findings-Tabelle / Anwalts-Anhang / Abmahn-Simulation. Trigger keywords - audit, paranoid-audit, AAA+++ check, 8-layer, security-audit, full-audit.
|
|
5
|
+
model: opus
|
|
6
|
+
license: MIT
|
|
7
|
+
metadata:
|
|
8
|
+
required_tools: "shell-ops,file-ops,curl,playwright,aegis-scan"
|
|
9
|
+
required_audit_passes: "1"
|
|
10
|
+
enforced_quality_gates: "0"
|
|
11
|
+
pre_done_audit: "true"
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# aegis-audit — 8-Layer Paranoid Audit
|
|
15
|
+
|
|
16
|
+
The Foundation's audit skill. Runs an 8-layer audit against a target (customer-site / live URL / local repo), produces a 4-section structured report, classifies findings by severity (KRITISCH / HOCH / MITTEL / LOW), estimates €-risk per finding via the industry × visibility × competitor formula. Used by customer-build's Phase 6 (mid-audit, topic-scoped) and Phase 7 (final, full-pass).
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## HARD-CONSTRAINT — Layer-Order, Reference-Loading, No Mocks
|
|
21
|
+
|
|
22
|
+
This skill MUST:
|
|
23
|
+
|
|
24
|
+
1. **Load all 8 layer-references** in `references/layer-1-headers.md` through `references/layer-8-schadens-diagnose.md` BEFORE producing any finding. Skipping a layer-reference = guaranteed false-negatives or false-positives.
|
|
25
|
+
2. **Execute layers in fixed order** (1 → 8). Earlier layers feed later ones (e.g., Layer 1 HTTP-headers feed Layer 5 cookie-detection). Out-of-order execution skips signal.
|
|
26
|
+
3. **No mocks.** Every layer hits the real target via real HTTP / curl / Playwright. If the target is unreachable — report NO-RESPONSE; never infer findings from chat-context.
|
|
27
|
+
4. **Cross-check with brutaler-anwalt** (`compliance/aegis-native/brutaler-anwalt/SKILL.md`). aegis-audit is the technical pass; brutaler-anwalt is the legal pass. They share Layer 3 (Impressum) + Layer 4 (DSE) + Layer 5 (Cookie). Findings get cross-validated.
|
|
28
|
+
5. **Output the canonical 4-section format.** Schadens-Diagnose / Findings-Tabelle / Anwalts-Anhang / Abmahn-Simulation. No deviation; downstream tooling parses this format.
|
|
29
|
+
6. **Include €-range estimates** per Layer 8 formula (industry × visibility × competitor-pressure). Estimates are advisory, not legal advice — disclaimer required.
|
|
30
|
+
|
|
31
|
+
If any layer cannot run (e.g., Playwright not installed) — STOP, report which layer + why. Don't silent-skip.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Mission
|
|
36
|
+
|
|
37
|
+
Eliminate the failure-mode where "the site looks fine" turns into a €15k abmahnung 3 weeks after launch. Catch the legal + technical regressions that scanners-alone miss because they don't cross-correlate (e.g., a tracker loaded before consent + impressum missing VAT-ID + cookie-banner with no equal-prominence reject = composite finding worth €5-15k).
|
|
38
|
+
|
|
39
|
+
Be the audit that:
|
|
40
|
+
|
|
41
|
+
- Hits every layer that abmahnanwalts inspect.
|
|
42
|
+
- Cross-correlates findings (a single scanner-hit might be 0 €; a 3-finding-cluster might be €15k).
|
|
43
|
+
- Estimates €-risk (operator can prioritize).
|
|
44
|
+
- Produces a 4-section report that operator + legal + dev can all consume.
|
|
45
|
+
- Distinguishes between "fix-now KRITISCH" and "fix-this-quarter MITTEL".
|
|
46
|
+
|
|
47
|
+
Production-bar reference: a previous full-audit on a 13-page site (private operational reference) returned 0 KRITISCH / 0 HOCH / 3 MITTEL / 8 LOW with €-range 200-800 €/quarter (very low) — the bar this skill targets.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Triggers
|
|
52
|
+
|
|
53
|
+
### Slash-commands
|
|
54
|
+
|
|
55
|
+
- `/audit` — run full 8-layer audit on the configured target
|
|
56
|
+
- `/paranoid-audit` — alias
|
|
57
|
+
- `/8-layer` — alias
|
|
58
|
+
|
|
59
|
+
### Auto-trigger keywords
|
|
60
|
+
|
|
61
|
+
- audit, paranoid-audit, AAA+++ check, 8-layer, security-audit, full-audit, abmahn-prevention
|
|
62
|
+
|
|
63
|
+
### Programmatic invocation
|
|
64
|
+
|
|
65
|
+
Customer-build Phase 6 invokes via:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Skill: aegis-native/aegis-audit
|
|
69
|
+
Args: --mode=mid --topics=impressum,cookie,dse --target=http://localhost:3000
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Phase 7 invokes via:
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
Skill: aegis-native/aegis-audit
|
|
76
|
+
Args: --mode=full --target=http://localhost:3000 --output=audits/final.md
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Process
|
|
82
|
+
|
|
83
|
+
The 8 layers run in fixed order. Each layer has a dedicated reference under `references/`.
|
|
84
|
+
|
|
85
|
+
### Layer Summary Table
|
|
86
|
+
|
|
87
|
+
| # | Layer | Mid-mode | Full-mode | Reference |
|
|
88
|
+
|---|---|---|---|---|
|
|
89
|
+
| 1 | HTTP-Headers | optional | always | layer-1-headers.md |
|
|
90
|
+
| 2 | HTML-Live-Probe | always | always | layer-2-html.md |
|
|
91
|
+
| 3 | Impressum | always | always | layer-3-impressum.md |
|
|
92
|
+
| 4 | DSE (Datenschutzerklärung) | always | always | layer-4-dse.md |
|
|
93
|
+
| 5 | Cookie + Consent | always | always | layer-5-cookie.md |
|
|
94
|
+
| 6 | Branche-Specific | optional | always | layer-6-branche.md |
|
|
95
|
+
| 7 | Code-Cross-Check (when local repo) | full only | always | layer-7-code-cross-check.md |
|
|
96
|
+
| 8 | Schadens-Diagnose (Synthesizer) | always | always | layer-8-schadens-diagnose.md |
|
|
97
|
+
|
|
98
|
+
### Phase 1: Pre-Audit Setup
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# Verify target is reachable
|
|
102
|
+
curl -sf -o /dev/null -w "%{http_code}\n" "$TARGET"
|
|
103
|
+
# Expected: 200 / 301 / 302; otherwise abort with NO-RESPONSE finding
|
|
104
|
+
|
|
105
|
+
# Verify Playwright is available (for Layer 2 + Layer 5 deeper probes)
|
|
106
|
+
npx playwright --version
|
|
107
|
+
# If missing: STOP, ask operator to `npx playwright install chromium`
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### Phase 2: Layer Execution (1 → 8)
|
|
111
|
+
|
|
112
|
+
For each enabled layer (per --mode):
|
|
113
|
+
|
|
114
|
+
1. Read the layer-reference for the patterns + thresholds.
|
|
115
|
+
2. Execute the probe(s).
|
|
116
|
+
3. Capture findings into the structured findings-list with:
|
|
117
|
+
- `id`: stable identifier (e.g., `L3-IMPRESSUM-VAT-MISSING`)
|
|
118
|
+
- `severity`: KRITISCH | HOCH | MITTEL | LOW
|
|
119
|
+
- `evidence`: the raw observation (URL + HTTP status + HTML snippet + curl output)
|
|
120
|
+
- `recommendation`: the fix
|
|
121
|
+
- `citation`: legal-source (Art. paragraph + court-decision when available)
|
|
122
|
+
|
|
123
|
+
### Phase 3: Cross-Correlation
|
|
124
|
+
|
|
125
|
+
After all layers run, run the cross-correlation pass:
|
|
126
|
+
|
|
127
|
+
- Layer 3 + Layer 5 cluster: Impressum-incomplete + cookie-pre-consent → composite KRITISCH (€5-15k abmahn)
|
|
128
|
+
- Layer 4 + Layer 5 cluster: DSE-incomplete + tracker-active → composite KRITISCH
|
|
129
|
+
- Layer 1 + Layer 7 cluster: missing CSP + unsafe-eval in code → composite HOCH
|
|
130
|
+
- Layer 6 + Layer 3 cluster: industry-specific pflichtangabe + impressum-missing → composite KRITISCH
|
|
131
|
+
|
|
132
|
+
Cross-correlation often elevates 3 individual MITTEL findings to a single composite KRITISCH — the actual abmahn-target.
|
|
133
|
+
|
|
134
|
+
### Phase 4: Report Generation (Layer 8 — Schadens-Diagnose)
|
|
135
|
+
|
|
136
|
+
Produce the 4-section report per the canonical template (see `references/layer-8-schadens-diagnose.md`):
|
|
137
|
+
|
|
138
|
+
1. **Schadens-Diagnose** — top-level summary + €-range estimate
|
|
139
|
+
2. **Findings-Tabelle** — detailed per-finding (severity / layer / evidence / fix / citation)
|
|
140
|
+
3. **Anwalts-Anhang** — legal citations (Art. paragraph + court-decisions)
|
|
141
|
+
4. **Abmahn-Simulation** — likelihood × industry × visibility = probable cost-range
|
|
142
|
+
|
|
143
|
+
### Phase 5: Output
|
|
144
|
+
|
|
145
|
+
Write the report to:
|
|
146
|
+
|
|
147
|
+
- `customers/<slug>/audits/<mode>-<date>.md` (when invoked from customer-build)
|
|
148
|
+
- `audits/<mode>-<date>.md` (when invoked standalone)
|
|
149
|
+
- stdout summary (1-line per finding) + path to full report
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
## Verification / Success Criteria
|
|
154
|
+
|
|
155
|
+
Before declaring the audit complete:
|
|
156
|
+
|
|
157
|
+
- [ ] All enabled layers executed (no silent-skip)
|
|
158
|
+
- [ ] Each layer's findings captured with full evidence (no hand-wavy "looks bad")
|
|
159
|
+
- [ ] Cross-correlation pass run after all layers
|
|
160
|
+
- [ ] Schadens-Diagnose €-range computed via Layer 8 formula
|
|
161
|
+
- [ ] 4-section report written + stdout summary printed
|
|
162
|
+
- [ ] No KRITISCH finding without a citation
|
|
163
|
+
- [ ] No HOCH finding without a fix-recommendation
|
|
164
|
+
- [ ] No "TODO" or placeholder text in the final report
|
|
165
|
+
|
|
166
|
+
If any unmet → audit is incomplete. Re-run failing layers + regenerate report.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Anti-Patterns
|
|
171
|
+
|
|
172
|
+
- ❌ Skipping a layer "because it doesn't apply to this target" — every layer applies; if none apply, report NOT-APPLICABLE in the layer-section, don't omit.
|
|
173
|
+
- ❌ Mocking HTTP-responses — every probe hits real target.
|
|
174
|
+
- ❌ Inferring findings from chat-context — read the raw output, cite line/byte.
|
|
175
|
+
- ❌ Hand-wavy severities — every severity has a defined criteria (per layer-reference); apply consistently.
|
|
176
|
+
- ❌ Composite findings without explicit cross-correlation logic — Phase 3 is mandatory.
|
|
177
|
+
- ❌ €-range without disclaimer — "Estimates are advisory; not legal advice. Verify with a Fachanwalt."
|
|
178
|
+
- ❌ Skipping Layer 8 (Schadens-Diagnose) "because no findings exist" — Layer 8 still produces a report stating "0 findings, low €-risk".
|
|
179
|
+
- ❌ Out-of-order layer execution — Layer 5 (cookie) needs Layer 1 (headers) data; running L5 before L1 misses signals.
|
|
180
|
+
- ❌ False-positive on a 3rd-party-CDN that's actually 1st-party-CNAME-aliased — verify via `dig CNAME` before reporting.
|
|
181
|
+
- ❌ Missing citation for KRITISCH — no Art./§/court-decision = downgrade to HOCH at most.
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Extension Points
|
|
186
|
+
|
|
187
|
+
- **New layer**: add `references/layer-9-<name>.md` + add to the Layer Summary Table here. Phase 2 reads the layer-references list dynamically.
|
|
188
|
+
- **Industry-specific Layer 6**: per industry (legal, medical, financial, ...) extend `references/layer-6-branche.md` with industry-section. Phase 2 detects industry from the target's NAICS/WZ-code (or briefing.industry field).
|
|
189
|
+
- **Custom severity thresholds**: a project might want stricter KRITISCH thresholds. Override in `aegis.config.json` `audit.severities.kritisch.threshold` per layer.
|
|
190
|
+
- **Different target-types**: this skill audits a URL by default. Extend with `--mode=local-repo` (audits source-code without running build) or `--mode=tarball` (audits a published artifact) by adding probe-implementations per layer.
|
|
191
|
+
- **Multi-language support**: for non-DE/EU jurisdictions, add `references/layer-<N>-<jurisdiction>.md` (e.g., layer-3-impressum-uk.md for UK pflichtangaben). Layer 2 (HTML), Layer 1 (Headers), Layer 7 (Code) are jurisdiction-agnostic and reused.
|
|
192
|
+
- **Output format**: the 4-section format is canonical. Extension-formats (HTML / SARIF / JSON) live in `packages/reporters` and consume the audit's structured findings-list.
|
|
193
|
+
- **Continuous audit**: a project can run aegis-audit on every commit (CI integration) or on every URL-change (production-watch). Add `--mode=ci` (fast, layer 1+2+3+5 only) and `--mode=watch` (Layer 1+2+5).
|
|
194
|
+
- **Whitelisted-finding suppression**: some findings are project-accepted (e.g., a CSP `unsafe-inline` for a specific 3rd-party script). Add to `aegis.config.json` `audit.suppressions[]` with `id` + `rationale` + `expiry-date`. Suppressions expire by default (no permanent suppressions).
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# Layer 1 Reference — HTTP-Headers
|
|
2
|
+
|
|
3
|
+
Layer 1 probes HTTP response-headers for security + privacy + caching headers. Findings here often feed Layer 5 (Cookie) + Layer 7 (Code-Cross-Check). **Time:** ~2-5 min per target.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Probe Pattern
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# Capture headers (HEAD + GET; some servers strip security headers on HEAD)
|
|
11
|
+
curl -sI "$TARGET" > /tmp/audit-headers-head.txt
|
|
12
|
+
curl -s -I -X GET "$TARGET" > /tmp/audit-headers-get.txt
|
|
13
|
+
|
|
14
|
+
# Compare (some sites send different headers per method)
|
|
15
|
+
diff /tmp/audit-headers-head.txt /tmp/audit-headers-get.txt
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Then check each canonical header per the table below.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Canonical Header Checklist
|
|
23
|
+
|
|
24
|
+
| Header | Expected | Severity if missing/weak |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `Strict-Transport-Security` | `max-age=31536000; includeSubDomains; preload` | HOCH (missing) / MITTEL (max-age < 31536000) |
|
|
27
|
+
| `Content-Security-Policy` | strict (no `unsafe-inline` on `script-src`, no `*` on `frame-ancestors`) | KRITISCH (missing) / HOCH (`unsafe-inline`) |
|
|
28
|
+
| `X-Frame-Options` | `DENY` or `SAMEORIGIN` (or via CSP `frame-ancestors`) | HOCH (missing — clickjacking) |
|
|
29
|
+
| `X-Content-Type-Options` | `nosniff` | MITTEL (missing — MIME-sniffing) |
|
|
30
|
+
| `Referrer-Policy` | `strict-origin-when-cross-origin` or stricter | MITTEL (missing) / LOW (`unsafe-url`) |
|
|
31
|
+
| `Permissions-Policy` | scoped (no `*` defaults) | MITTEL (missing) |
|
|
32
|
+
| `Cross-Origin-Opener-Policy` | `same-origin` | LOW (missing) |
|
|
33
|
+
| `Cross-Origin-Embedder-Policy` | `require-corp` (when applicable) | LOW (missing — only for sensitive sites) |
|
|
34
|
+
| `Cross-Origin-Resource-Policy` | `same-origin` or `same-site` | LOW (missing) |
|
|
35
|
+
| `Cache-Control` (HTML) | `no-store, no-cache, must-revalidate` for auth-pages; `public, max-age=...` for static | MITTEL (auth-page cached) |
|
|
36
|
+
| `Set-Cookie` (auth) | `Secure; HttpOnly; SameSite=Lax` (or `Strict`) | KRITISCH (auth-cookie without HttpOnly) |
|
|
37
|
+
| `Server` | absent or generic (no version-disclosure) | LOW (verbose server-header) |
|
|
38
|
+
| `X-Powered-By` | absent | LOW (verbose framework-disclosure) |
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## CSP Strictness Check
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
csp=$(grep -i "content-security-policy" /tmp/audit-headers-get.txt | cut -d: -f2-)
|
|
46
|
+
echo "$csp"
|
|
47
|
+
|
|
48
|
+
# Check for KRITISCH/HOCH patterns
|
|
49
|
+
grep -q "unsafe-inline" <<<"$csp" && echo "L1-CSP-UNSAFE-INLINE: HOCH"
|
|
50
|
+
grep -q "unsafe-eval" <<<"$csp" && echo "L1-CSP-UNSAFE-EVAL: HOCH"
|
|
51
|
+
grep -q "frame-ancestors[^;]*\*" <<<"$csp" && echo "L1-CSP-FRAME-ANCESTORS-WILDCARD: KRITISCH"
|
|
52
|
+
grep -q "default-src[^;]*\*" <<<"$csp" && echo "L1-CSP-DEFAULT-SRC-WILDCARD: KRITISCH"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Strictest CSP pattern (next.js with strict-dynamic + nonce):
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
default-src 'self';
|
|
59
|
+
script-src 'self' 'nonce-<hash>' 'strict-dynamic' https:;
|
|
60
|
+
style-src 'self' 'unsafe-inline';
|
|
61
|
+
img-src 'self' data: https:;
|
|
62
|
+
connect-src 'self';
|
|
63
|
+
frame-ancestors 'none';
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
`style-src 'unsafe-inline'` is acceptable (CSS injection has lower exploitation impact than JS injection); `script-src 'unsafe-inline'` is not.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## HSTS Preload Check
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# If max-age < 31536000 OR missing includeSubDomains OR missing preload — not preload-eligible
|
|
74
|
+
hsts=$(grep -i "strict-transport-security" /tmp/audit-headers-get.txt | cut -d: -f2-)
|
|
75
|
+
max_age=$(grep -oE "max-age=[0-9]+" <<<"$hsts" | cut -d= -f2)
|
|
76
|
+
[ -z "$max_age" ] && echo "L1-HSTS-MISSING: HOCH"
|
|
77
|
+
[ -n "$max_age" ] && [ "$max_age" -lt 31536000 ] && echo "L1-HSTS-TOO-SHORT: MITTEL"
|
|
78
|
+
grep -qi "includesubdomains" <<<"$hsts" || echo "L1-HSTS-NO-SUBDOMAINS: MITTEL"
|
|
79
|
+
grep -qi "preload" <<<"$hsts" || echo "L1-HSTS-NO-PRELOAD: LOW"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
For preload-list eligibility, also verify:
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# At https://hstspreload.org/ — site must:
|
|
86
|
+
# - Serve HSTS header on root domain + all subdomains
|
|
87
|
+
# - max-age >= 31536000 (1 year)
|
|
88
|
+
# - includeSubDomains
|
|
89
|
+
# - preload
|
|
90
|
+
# - Redirect HTTP to HTTPS on root + subdomains
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Cookie Header Cross-Check (feeds Layer 5)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Capture all Set-Cookie lines
|
|
99
|
+
grep -i "^set-cookie:" /tmp/audit-headers-get.txt
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
For each cookie, check:
|
|
103
|
+
|
|
104
|
+
- `Secure` flag set (only sent over HTTPS)
|
|
105
|
+
- `HttpOnly` flag set (no JS-access; KRITISCH if missing on auth-cookie)
|
|
106
|
+
- `SameSite` set (`Lax` or `Strict`; `None` requires `Secure`)
|
|
107
|
+
- `Path=/` reasonable scope
|
|
108
|
+
- `Max-Age` or `Expires` set (no session-cookies for tracking that should be persistent)
|
|
109
|
+
|
|
110
|
+
Layer 5 (Cookie + Consent) cross-references each cookie against the consent-status: any tracking-cookie set BEFORE consent is a TTDSG/TDDDG §25 violation.
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Findings Format
|
|
115
|
+
|
|
116
|
+
Each Layer 1 finding writes to the structured findings-list:
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
- id: L1-CSP-UNSAFE-INLINE
|
|
120
|
+
layer: 1
|
|
121
|
+
severity: HOCH
|
|
122
|
+
evidence:
|
|
123
|
+
url: <target>
|
|
124
|
+
header_name: Content-Security-Policy
|
|
125
|
+
header_value: "default-src 'self'; script-src 'self' 'unsafe-inline' ..."
|
|
126
|
+
recommendation: "Replace 'unsafe-inline' with nonce-based CSP per OWASP CSP-3 cheatsheet"
|
|
127
|
+
citation: "OWASP CSP-3, BSI TR-03116-4 §4.2"
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Anti-Patterns specific to Layer 1
|
|
133
|
+
|
|
134
|
+
- ❌ Reporting "HSTS missing" when site is HTTP-only — first fix HTTP-to-HTTPS redirect; HSTS is moot otherwise.
|
|
135
|
+
- ❌ Reporting "CSP unsafe-inline" without checking if the inline is `style-src` — script-src is the dangerous one; style-src is acceptable.
|
|
136
|
+
- ❌ Skipping cookie-headers — they feed Layer 5; Layer 5 then fails to detect pre-consent trackers.
|
|
137
|
+
- ❌ HEAD-only probe — some sites strip security-headers on HEAD; always run GET too.
|
|
138
|
+
- ❌ Reporting "X-XSS-Protection missing" — that header is deprecated (no longer recommended; modern CSP supersedes).
|