Data retention policy limits CDE storage to business requirements
Why it matters
PCI-DSS 4.0 Req 3.2 limits cardholder data storage to the minimum required for business or legal needs; Req 3.2.1 requires that data retention and disposal policies are defined and implemented. Data that is never deleted accumulates indefinitely — old failed transaction records, expired tokens, and support tickets create a growing pool of sensitive data that broadens breach impact year over year. GDPR Art. 5(1)(e) (storage limitation) and NIST SI-12 both require data to be disposed of when no longer needed. Without automated purging, retention policies are aspirational rather than enforced.
Severity rationale
Low because data accumulation expands breach impact over time but does not itself enable unauthorized access — the risk compounds gradually rather than presenting an immediate exploitable condition.
Remediation
Create docs/data-retention-policy.md with specific retention periods for at least three data types, then implement automated purging via a Vercel cron route or database scheduled job. Without automation, the policy is not enforced.
// src/app/api/cron/purge-data/route.ts
export async function POST(req: Request) {
if (req.headers.get('authorization') !== `Bearer ${process.env.CRON_SECRET}`)
return new Response('Unauthorized', { status: 401 });
const supabase = createClient(process.env.SUPABASE_URL!, process.env.SUPABASE_SERVICE_KEY!);
// Purge failed transactions older than 90 days (PCI Req 3.2)
await supabase.from('failed_transactions').delete()
.lt('created_at', new Date(Date.now() - 90 * 864e5).toISOString());
return new Response('ok');
}
In vercel.json, schedule the route at "cron": "0 3 * * *". Define transaction logs (7 years), audit logs (3 years), and failed attempts (90 days) as the minimum three retention categories.
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 PCI Compliance Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- pci-dss:4.0 · Req 3.2 — Storage of account data is kept to a minimum
- pci-dss:4.0 · Req 3.2.1 — Account data storage is kept to a minimum through implementation of data retention and disposal policies
- gdpr · Art. 5(1)(e) — Storage limitation
- nist:rev5 · SI-12 — Information Management and Retention
- iso-27001:2022 · A.8.10 — Information deletion
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ecommerce-pci·automated