Consent records stored with timestamp, policy version, and mechanism
Why it matters
GDPR Art. 7(2) requires that consent be demonstrable — if challenged by a regulator or in litigation, you must prove when the user consented, to which policy version, and via which mechanism. A current-state boolean in a user_settings table provides none of this. GDPR Art. 5(2) (accountability principle) and SOC 2 CC2.3 both require documented audit trails. Without immutable consent records, every withdrawal or complaint triggers a 'our word against theirs' dispute that regulators resolve in the user's favor.
Severity rationale
High because undemonstrable consent is legally equivalent to no consent under GDPR Art. 7(2), converting any disputed processing into an unlawful processing violation.
Remediation
Create an append-only user_consent_audit table and write a new row on every consent change — never update existing rows. Include policy_version so consent granted under an old policy is distinguishable from consent under a revised one.
CREATE TABLE user_consent_audit (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
processing_type VARCHAR(50) NOT NULL,
consent_given BOOLEAN NOT NULL,
consented_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
policy_version VARCHAR(20) NOT NULL,
collection_mechanism VARCHAR(50) NOT NULL, -- 'signup-form', 'settings-ui', 'api'
ip_address INET
);
-- No UPDATE or DELETE grants on this table for the application role
Query the most recent record per (user_id, processing_type) to determine current consent state — never rely on a separate boolean cache.
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 Community Privacy & Controls Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- gdpr · Art. 7 — Conditions for consent — demonstrable consent with timestamp and version
- gdpr · Art. 5(2) — Accountability principle — controller must demonstrate compliance
- ccpa · §1798.120 — Right to opt-out of sale or sharing of personal information
- iso-27001:2022 · A.5.34 — Privacy and protection of personally identifiable information
- soc2:2017 · CC2.3 — Communication of privacy commitments and obligations
Taxons
History
- 2026-04-18·v1.0.0·Initial import from community-privacy-controls·automated