Skip to content

Add UK Compliance Reports section to RetailShield dashboard#84

Open
TFT444 wants to merge 1 commit into
devfrom
feature/uk-compliance-reports
Open

Add UK Compliance Reports section to RetailShield dashboard#84
TFT444 wants to merge 1 commit into
devfrom
feature/uk-compliance-reports

Conversation

@TFT444
Copy link
Copy Markdown
Owner

@TFT444 TFT444 commented Jun 6, 2026

Summary

Closes #83

Adds a UK Compliance Reports section to frontend/src/RetailShield.jsx. When SIMULATE ATTACK fires a CRITICAL incident, compliance report cards are automatically generated with live countdown timers and a pre-filled 7-section UK draft notification.

What's new

  • getComplianceContext(mitre) — maps MITRE technique (T1566, T1110, T1486, T1048) to incident-specific nature/affected-data/consequences text for the draft report
  • ComplianceReportCard component — collapsible card with countdown timers, action buttons, 7-section draft, and disclaimer
  • complianceReports state — array populated by runAttackSimulation for each CRITICAL event
  • Modified runAttackSimulation — resets reports on each new simulation, then appends a report entry for every severity === 'critical' event as it fires (staggered 800 ms)
  • New section in dashboard JSX (between AI Briefing and Emergency Contacts):
    • Green "No reportable incidents" card on load / when no reports
    • Red "UK Regulatory Notification Required" urgent header when reports are active
    • One ComplianceReportCard per critical incident

Per card features

Feature Detail
Countdown timers 24h NCSC (red when < 6h), 72h ICO (amber when < 24h), "OVERDUE" when expired
Incident summary table Title, detection time, MITRE, affected system, severity
7-section draft report §1–§6 auto-filled; §7 uses [REVIEWER] placeholders
Download Draft Generates .txt file via URL.createObjectURL
Submit to ICO Opens https://ico.org.uk/for-organisations/report-a-breach/ in new tab
Submit to NCSC Opens https://www.ncsc.gov.uk/section/about-this-website/incident-management in new tab
Disclaimer Amber banner on every expanded card warning human review is required

Design matches existing dark theme — C tokens only, no new dependencies.

How to test

  1. cd frontend && npm run dev — open the dashboard in a browser
  2. On load: confirm the UK Compliance Reports section shows the green "No reportable incidents" card
  3. Click ⚡ SIMULATE ATTACK and wait ~4 s for all events to fire
  4. Confirm the section header switches to the red "UK Regulatory Notification Required" banner with the count badge
  5. Confirm 4 report cards appear (Spearphishing, Credential Stuffing, Ransomware, DNS Exfiltration)
  6. Each card header shows MITRE code and affected system — click to expand
  7. Expanded card shows the incident summary table and all 7 draft sections
  8. §7 (Data Controller Contact) shows [REVIEWER] placeholders and the "ACTION REQUIRED" badge
  9. Live countdown timers decrement every second (use browser DevTools to mock Date ahead by 23h to test the red NCSC warning)
  10. Click ⬇ Download Draft — confirm a .txt file downloads containing the full 7-section report
  11. Click ⚖️ Submit to ICO — confirm the ICO breach-reporting page opens in a new tab
  12. Click 🏗 Submit to NCSC — confirm the NCSC incident management page opens in a new tab
  13. Run SIMULATE ATTACK a second time — confirm previous reports are cleared and 4 new cards appear

Generated by Claude Code

Implements live compliance report cards that automatically appear when
the SIMULATE ATTACK flow fires CRITICAL severity incidents. Each card
shows live 24h NCSC and 72h ICO countdown timers, a 7-section pre-filled
UK draft notification report, download-as-text, and direct links to the
ICO and NCSC submission portals.

Closes #83
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
retail-shield Ready Ready Preview, Comment Jun 6, 2026 11:24am

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant