Provenance queryable for compliance lookups
Why it matters
GDPR Art. 30 requires a Records of Processing Activities identifying each category of data subjects and the source of their data. Art. 17 (right to erasure) requires that you can efficiently locate and delete all records from a specific source when that source becomes non-compliant or a data subject invokes their rights. Without an index on source_id, bulk lookups require full table scans that become prohibitively slow at scale. CCPA §1798.100 adds a parallel right to know which business collected the personal information and from what source.
Severity rationale
High because missing indexes on provenance fields make GDPR Art. 17 erasure-by-source and Art. 30 compliance lookups operationally infeasible at production table sizes.
Remediation
Add indexes on both source_id and source_type, then expose a compliance query function or admin endpoint that retrieves all contacts for a given source.
CREATE INDEX idx_contacts_source_id ON contacts (source_id);
CREATE INDEX idx_contacts_source_type ON contacts (source_type);
// src/lib/compliance/lookup.ts
export async function getContactsBySource(sourceId: string) {
return db.contacts.findMany({
where: { source_id: sourceId },
select: { id: true, email: true, acquired_at: true, source_type: true },
orderBy: { acquired_at: 'desc' },
})
}
Surface this function in an admin panel so operations teams can run source-based erasure requests without direct database access.
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 Data Sourcing & Provenance Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 30 — Records of processing activities — provenance must be queryable for supervisory authority requests
- gdpr · Art. 17 — Right to erasure — must be able to identify all data from a source for deletion
- ccpa · §1798.100 — Right to know — must be able to report all data collected from a given source
Taxons
History
- 2026-04-18·v1.0.0·Initial import from data-sourcing-provenance·automated