GDPR & POPIA Compliance for SaaS Platforms

GDPR & POPIA COMPLIANCE FOR SAAS PLATFORMS

production v1.0

GDPR & POPIA Compliance for SaaS Platforms

Technical and operational requirements for GDPR (EU) and POPIA (South Africa) compliance in multi-tenant SaaS platforms.

Applicability

When POPIA Applies

When GDPR Applies

Overlap

Both laws share the same core principles. Build for GDPR (stricter) and you satisfy POPIA automatically. Key differences:

RequirementGDPRPOPIA
Notification deadline72 hours"As soon as reasonably possible"
DPO required?Yes (>250 employees or special categories)Yes (Information Officer, registered with Regulator)
FinesUp to €20M or 4% global turnoverUp to R10M or 10 years imprisonment
Data transferAdequacy decisions, SCCs, BCRsSimilar, but SA not yet on EU adequacy list
Right to be forgottenArticle 17 — explicit rightSection 24 — similar, less explicit
Data portabilityArticle 20 — structured, machine-readableNot explicitly required, but best practice

Lawful Basis for Processing

Per Data Type

DataLawful BasisJustification
Email addressConsent (registration)Required for account creation and OTP auth
Display nameConsent (optional)User chooses to provide
Company nameConsent (optional)User chooses to provide
IP addressLegitimate interestSecurity, rate limiting, abuse prevention
Geo location (country/city)Legitimate interestPOPIA compliance (jurisdiction), Cloudflare auto-detection
Token balanceContractBilling relationship
Activity logLegitimate interest + Legal obligationSecurity audit, POPIA Section 19
Agent chat historyContractService delivery
OAuth tokensContractSSO functionality

Technical Requirements

Data Minimisation

DO collect:
  ✓ Email (required for auth)
  ✓ Consent timestamp + IP (required for compliance)
  ✓ Activity log (required for security)

DO NOT collect:
  ✗ Full name (unless user volunteers it)
  ✗ Physical address (not needed)
  ✗ Date of birth (not needed)
  ✗ Government ID numbers (not needed)
  ✗ Browsing history beyond platform (no third-party tracking)
  ✗ Device fingerprinting beyond session (anon demo only)

Encryption

LayerRequirement2nth Implementation
In transitTLS 1.2+Cloudflare manages (TLS 1.3)
At rest (DB)AES-256 or equivalentCloudflare D1 encrypted at rest
At rest (KV)Encrypted storageCloudflare KV encrypted at rest
BackupsEncryptedD1 automatic (Cloudflare managed)
SecretsEnvironment variablesWrangler secrets (encrypted)

Access Control

Principle of least privilege:
  - Users see only their own data
  - Partners see only their scoped content
  - Admin access requires explicit role
  - OAuth scopes limit data exposed to relying parties
  - No wildcard database queries without user_id filter

Data Retention

Data TypeRetention PeriodJustification
User accountUntil deletion requestedOngoing service
Activity log12 monthsSecurity audit
Auth sessions7-30 days (auto-expire)Session management
OTP codes10 minutes (auto-expire)Authentication
OAuth auth codes10 minutes (auto-expire)Token exchange
Refresh tokens30 days (auto-expire)Session continuity
Anonymous fingerprints30 days (auto-expire)Demo rate limiting
Breach register5 years minimumLegal requirement
Consent audit trailLife of account + 5 yearsLegal requirement

Automatic Purge Implementation

-- Run daily via scheduled worker
DELETE FROM activity_log
WHERE created_at < datetime('now', '-12 months');

DELETE FROM anon_identities
WHERE last_seen < datetime('now', '-30 days');

DELETE FROM oauth_authorization_codes
WHERE expires_at < datetime('now');

DELETE FROM oauth_refresh_tokens
WHERE expires_at < datetime('now');

Privacy by Design Checklist

Registration Flow

Authentication Flow

Data Display

Third-Party Services

ServiceData SharedDPA RequiredStatus
CloudflareAll traffic (proxied)Yes (Cloudflare DPA)✓ Covered by Cloudflare terms
ResendEmail addresses (OTP)YesReview required
HetznerServer data (2nth.io)YesReview required
PaystackEmail + payment (billing)YesReview required
GitHubPublic code onlyNo (no PII)N/A

Information Officer Registration

POPIA Requirement (Section 55)

Responsibilities

  1. Encourage compliance within the organisation
  2. Handle data subject requests
  3. Ensure privacy impact assessments are conducted
  4. Cooperate with the Information Regulator
  5. Maintain breach register

Cross-Border Data Transfers

Current Architecture

User (SA/EU/Global)
  → Cloudflare Edge (nearest PoP — global)
  → Cloudflare D1 (edge replicated)
  → Hetzner Cloud (Helsinki — 2nth.io instances)

POPIA Section 72 — Transborder Flows

Personal information may be transferred if:

  1. Recipient country has adequate protection (EU countries qualify)
  2. Data subject consents
  3. Transfer is necessary for contract performance
  4. Binding corporate rules are in place

GDPR Chapter 5 — International Transfers

Privacy Notice Template

Every 2nth property must display:

  1. Who we are — Data controller identity and contact
  2. What we collect — Specific data types
  3. Why — Lawful basis per data type
  4. How long — Retention periods
  5. Who sees it — Third parties and sub-processors
  6. Your rights — Access, correction, deletion, portability, objection
  7. How to complain — Information Regulator contact details
  8. Updates — How changes to the notice are communicated