nis2-agile/docs/sql/002_email_log.sql
Cristiano Benassati 6f4b457ce0 [FEAT] Add EmailService, RateLimitService, ReportService + integrations
Services:
- EmailService: CSIRT notifications (24h/72h/30d), training alerts, welcome email
- RateLimitService: File-based rate limiting for auth and AI endpoints
- ReportService: Executive HTML report, CSV exports (risks/incidents/controls/assets)

Integrations:
- AuthController: Rate limiting on login (5/min, 20/h) and register (3/10min)
- IncidentController: Email notifications on CSIRT milestones
- AuditController: Executive report and CSV export endpoints
- Router: 429 rate limit error handling, new audit export routes

Database:
- Migration 002: email_log table for notification tracking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 19:12:46 +01:00

18 lines
906 B
SQL

-- ═══════════════════════════════════════════════════════════════════════════
-- NIS2 Agile - Migration 002: Email Log
-- ═══════════════════════════════════════════════════════════════════════════
USE nis2_agile_db;
CREATE TABLE IF NOT EXISTS email_log (
id INT AUTO_INCREMENT PRIMARY KEY,
recipient VARCHAR(255) NOT NULL,
subject VARCHAR(500) NOT NULL,
type VARCHAR(100),
status ENUM('sent','failed') DEFAULT 'sent',
error_message TEXT,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
INDEX idx_recipient (recipient),
INDEX idx_created (created_at)
) ENGINE=InnoDB;