Add DSGVO-required audit logging for all data access and mutation routes #16
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
DSGVO Articles 5(2), 17, and 20 require a demonstrable audit trail of who accessed or modified personal data and when. This is currently absent:
company_profile_routes.py— DELETE has no audit logdsr_routes.py— DSR request handling (Art. 17 deletion, Art. 20 portability) is not loggedAs a DSGVO compliance platform, this is a fundamental requirement — and an embarrassing gap.
Required Actions
compliance/services/audit_service.pywith anAuditLoggerthat writes to a dedicatedcompliance_audit_logtable (append-only, no deletes)tenant_id,user_id,action,resource_type,resource_id,legal_basis,timestamp,ip_addressAuditLoggerinto every route that:GET /api/v1/audit-logendpoint for compliance officers to retrieve the trail (itself audited)Acceptance Criteria
compliance_audit_logaction=delete,legal_basis,user_id