feat(compliance-check): P10 — Cookie-Policy-Architecture-Detection
CI / detect-changes (push) Successful in 10s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / validate-canonical-controls (push) Successful in 16s
CI / loc-budget (push) Failing after 17s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Has been skipped
CI / test-go (push) Has been skipped
CI / iace-gt-coverage (push) Has been skipped
CI / test-python-backend (push) Successful in 41s
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
CI / detect-changes (push) Successful in 10s
CI / branch-name (push) Has been skipped
CI / guardrail-integrity (push) Has been skipped
CI / secret-scan (push) Has been skipped
CI / dep-audit (push) Has been skipped
CI / sbom-scan (push) Has been skipped
CI / validate-canonical-controls (push) Successful in 16s
CI / loc-budget (push) Failing after 17s
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / nodejs-build (push) Has been skipped
CI / test-go (push) Has been skipped
CI / iace-gt-coverage (push) Has been skipped
CI / test-python-backend (push) Successful in 41s
CI / test-python-document-crawler (push) Has been skipped
CI / test-python-dsms-gateway (push) Has been skipped
Neuer Service cookie_policy_architecture.detect_architecture(...) prueft
vier Diagnose-Punkte der Cookie-Policy einer Website:
1. Layer-Trennung: single (BMW-Pattern: Banner + Info in EINER URL)
| separate (Best Practice: getrennte Layer)
2. Versionierung: "Stand vom DD.MM.JJJJ" / "Version X.Y" / ...
3. Dynamic content: CMP-Capture auf Doc-URL oder Marker-Texte
4. Vendor-Count im Text: Indikator ob Liste statisch drinsteht
Risiko-Ampel:
- gruen: separate + versioned + statisch
- gelb : single+unversioned (BMW) ODER separate+unversioned
- rot : weder noch (Pflicht-Info fehlt)
Wire-in im Compliance-Check-Worker: nach Exec-Summary-Block wird der
Architecture-Block gerendert (build_architecture_html) mit konkreter
Empfehlung. Bei BMW-Pattern: "Snapshot der dynamischen Vendor-Tabelle
als versioniertes PDF im Archiv."
Hintergrund: BMW hat eine HTML-Seite die GLEICHZEITIG Banner-Re-Trigger
und Cookie-Richtlinie ist. Mindestanforderung nach §25 TDDDG + Art. 13
DSGVO erfuellt, aber bei einer Aufsichtsbehoerden-Pruefung kann nicht
belegt werden welche Vendor-Liste an einem bestimmten Stichtag aktiv
war. Das ist kein Verstoss aber best-practice-Luecke.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -572,6 +572,33 @@ async def _run_compliance_check(check_id: str, req: ComplianceCheckRequest):
|
||||
site_name=site_name_for_exec,
|
||||
)
|
||||
|
||||
# P10: Cookie-Policy-Architecture-Detection (BMW-Pattern erkennen)
|
||||
cookie_arch_html = ""
|
||||
try:
|
||||
from compliance.services.cookie_policy_architecture import (
|
||||
detect_architecture, build_architecture_html,
|
||||
)
|
||||
cookie_doc_url = ""
|
||||
cookie_doc_text = doc_texts.get("cookie", "")
|
||||
cookie_cmp_payloads: list[dict] = []
|
||||
for e in doc_entries:
|
||||
if (e.get("doc_type") or "").lower() in ("cookie", "cookie_policy"):
|
||||
cookie_doc_url = e.get("url", "")
|
||||
cookie_cmp_payloads = e.get("cmp_payloads") or []
|
||||
break
|
||||
if cookie_doc_text:
|
||||
arch = detect_architecture(
|
||||
doc_url=cookie_doc_url,
|
||||
doc_text=cookie_doc_text,
|
||||
cmp_payloads=cookie_cmp_payloads,
|
||||
homepage_cmp_payloads=cmp_payloads or [],
|
||||
)
|
||||
cookie_arch_html = build_architecture_html(arch)
|
||||
logger.info("cookie-arch: layer=%s versioned=%s risk=%s",
|
||||
arch["layer_separation"], arch["versioned"], arch["risk_label"])
|
||||
except Exception as e:
|
||||
logger.warning("cookie-architecture detection failed: %s", e)
|
||||
|
||||
# Reihenfolge — Sales-optimiert:
|
||||
# 1) Exec-Summary (KPIs + Saving + CTAs)
|
||||
# 2) summary_html (Konkrete Aufgaben fuer die Geschaeftsfuehrung)
|
||||
@@ -582,7 +609,8 @@ async def _run_compliance_check(check_id: str, req: ComplianceCheckRequest):
|
||||
# 7) providers_html + vvt_html (Vendor-Liste)
|
||||
# 8) report_html (Doc-Pruefung Details)
|
||||
full_html = (
|
||||
exec_summary_html + summary_html + scanned_html + profile_html
|
||||
exec_summary_html + cookie_arch_html + summary_html
|
||||
+ scanned_html + profile_html
|
||||
+ scorecard_html + redundancy_html
|
||||
+ providers_html + vvt_html + report_html
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user