Compliance evidence exportable for legal review
Why it matters
GDPR Article 5(2) accountability and Article 30 records-of-processing requirements both assume that a controller can produce evidence of compliance on request — but "we have the data in the database" is not an evidence export mechanism. Without admin tooling that joins consent records, audit log entries, and erasure receipts into a coherent timeline, responding to a data protection authority inquiry or a data subject access request requires a bespoke database query every time, introducing inconsistency and delay. ISO 27001:2022 A.5.35 covers evidence of compliance activities. CCPA §1798.185(a)(8) requires businesses to document their data practices in a producible form.
Severity rationale
Info because the gap affects operational efficiency and legal defensibility but does not itself cause a data subject's rights to be violated — compliance tooling is the means, not the obligation.
Remediation
Add a GET /api/admin/contacts/:id/compliance-report endpoint that joins all three compliance data sources in one call:
// src/app/api/admin/contacts/[id]/compliance-report/route.ts
export async function GET(req: Request, { params }: { params: { id: string } }) {
const [consentRecords, auditLog, erasureLog] = await Promise.all([
db.consentRecord.findMany({ where: { contactId: params.id }, orderBy: { createdAt: 'asc' } }),
db.auditLog.findMany({ where: { entityId: { startsWith: params.id } }, orderBy: { createdAt: 'asc' } }),
db.erasureAuditLog.findMany({ where: { contactId: params.id }, orderBy: { processedAt: 'asc' } }),
])
return Response.json({
generatedAt: new Date().toISOString(),
contactId: params.id,
consentHistory: consentRecords,
operationalAuditTrail: auditLog,
erasureRequests: erasureLog,
})
}
Protect this route with admin-only authentication and log every export to the audit trail itself — an unauthenticated compliance export is itself a data exposure incident.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Compliance & Consent Engine Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 5(2) — Accountability — controller must be able to demonstrate compliance on demand
- gdpr · Art. 30 — Records of processing — must be made available to supervisory authority on request
- iso-27001:2022 · A.5.35 — Independent review of information security
- ccpa · §1798.185(a)(8) — Recordkeeping — records must be available to CPPA on request
Taxons
History
- 2026-04-18·v1.0.0·Initial import from compliance-consent-engine·automated