6. Personal data: anonymisation gate before Bronze and a token vault
6. Personal data: anonymisation gate before Bronze and a token vault
Date: 2026-10-26
Status
Accepted
Problem
Personal data is present in two of the three sources and, indirectly, in the third. The full register is in data classification; the headline:
| Source | Personal data present | Examples |
|---|---|---|
| Salesforce | Yes, direct | Lead and Contact names, emails, phones, addresses, titles; CampaignMember links a person to a campaign; Task and Event free text; User (employee) names and emails on owner and audit fields |
| HubSpot | Yes, direct and behavioural | Contact properties; IP-derived location; cookie-based visitor id
(hutk); email engagement per recipient (opens, clicks with
IP and user agent); form submissions; notes, calls and emails as free
text; consent and subscription status |
| Google Ads | Mostly aggregate, with exceptions | Performance metrics are aggregates and not personal. Click
identifiers (gclid) become personal when joined to a CRM
lead that captured the same gclid. Customer Match and
enhanced-conversion uploads contain hashed identifiers.
change_event carries the email of the employee who made
each change. |
Two positions for the gate were weighed. A first draft placed it at Silver → Gold, which keeps raw fidelity in two restricted layers but makes erasure a physical delete across Bronze, Silver, Delta history and landing files. The architect's reference design for right to erasure on a lakehouse (reference/right-to-erasure-on-a-lakehouse.png) sets the opposite rule: personal identifiers are anonymised before Bronze; erasure is primarily the deletion of a mapping, not a scrub of ten stores. The architect confirmed that rule on 2026-10-26.
Terminology, stated precisely because regulators do: replacing an identifier with a token while a mapping exists is what GDPR Recital 26 calls pseudonymisation; the data is still personal data, with reduced risk. Once the mapping is deleted and no reasonable means of re-identification remain, the residual tokenised rows are anonymous. These documents call the mechanism the anonymisation gate after that end state, the term the business uses; towards the DPO or a regulator the tokenised layers are described as pseudonymised until the mapping is deleted. The DPO must agree with that position for this design before go-live.
Decision
We will run an anonymisation gate inside the Bronze loader, between the landing files and the Bronze Delta tables, backed by a token vault outside OneLake. Nothing carrying a direct identifier is ever written to a Delta table.
1. Where the data is (the places that matter here)
| # | Place | Holds identifiers? | Erasure action |
|---|---|---|---|
| 1 | Landing files (Files/landing/..., written by the copy
activity and the adapters) |
Yes, for at most 7 days after successful promotion | Delete the subject's records by rewriting or deleting the file (Path B) |
| 2 | Bronze | Tokens only | None: not attributable once the mapping is gone |
| 3 | Silver | Tokens only | None |
| 4 | Gold and business_event |
Tokens only | None, unless the DPO requires person-level facts deleted as well (DELETE by token, then VACUUM) |
| 5 | Delta history and time travel | Tokens only | None |
| 6 | Token vault | The mapping | The only place erasure must succeed (Path A) |
| 7 | Adapter state and Service Bus messages | Source object ids and tokens, no identifiers | 30-day retention; messages expire |
| 8 | Logs and traces (Functions, pipelines, Application Insights) | Must not: payload logging is forbidden; object ids only | Purge by subject hash if a breach of the logging policy is found |
| 9 | Non-production copies | Tokens only, refreshed from tokenised production | Refresh; never from a raw copy |
| 10 | Backups and exports (optional cross-region export of Bronze) | Tokens only | Retention clock, documented |
2. The gate (in the Bronze loader, driven by the classification register):
- Detect: every column of every landed object must have a classification entry; an unclassified column fails the run. A PII scanner (patterns for email, phone, IBAN, national ids; name heuristics) runs over all string columns as a safety net and quarantines the record if it finds an identifier in a column not classified as one.
- Tokenise: identifier fields are replaced by a token
obtained from the vault by lookup-or-create on the normalised identifier
(lower-cased email as the primary identity key; phone and source record
id as secondary keys linked to the same subject). Deterministic per
subject, so the same person in Salesforce and HubSpot receives the same
token and cross-source joins work everywhere downstream. Employee
identifiers (owners, change authors) are tokenised the same way with
subject_type = employee.gclidis tokenised; it carries the click identity for erasure and for a future click-level join, while attribution today is at campaign level through theutm_*parameters captured with it (domain model). - Rewrite: the verbatim payload JSON is rewritten
with the tokens in place of the identifier fields;
_payload_hashis computed over the rewritten payload. - Drop or redact: free-text fields (notes, call bodies, email bodies, form free text) are dropped by default; a classification entry may allow a redacted copy.
- Generalise: IP address to country; city and postcode dropped; user agent dropped; click ids tokenised; cookie and visitor ids dropped unless a consumer needs the link (the classification register decides per column).
- Carry: consent and subscription flags pass through unchanged, keyed by token.
3. The token vault
- A separate store, not in OneLake: Azure SQL Database with transparent data encryption under a customer-managed key in a dedicated Key Vault, Entra-only authentication, PIM-eligible access for the two roles that may touch it (gate identity: lookup-or-create, also used read-only by the reconciler's weekly hash samples; erasure role: delete and reverse lookup), auditing to Log Analytics, geo-redundant backup with a short retention agreed with the DPO.
- Table
token_map:lookup_hash= HMAC-SHA256(k_lookup, normalised identifier) so no plaintext identifier is stored for lookup;token= random 128-bit value (not derivable from the identifier);identifier_enc= identifier encrypted under the customer-managed key, for authorised reverse lookup only;subject_type,jurisdiction,created_at,erased_at. Asubject_linktable ties secondary identifiers (phone, source record ids) to the same token. k_lookuplives in the vault's Key Vault and is used only inside the gate and the erasure role. It is long-lived; rotation re-hasheslookup_hashunder the new key version in place (tokens are unaffected, because tokens are random, not derived).- Reverse lookup (token → identity) exists only through a vault API for the erasure role and for an explicitly approved consumer (for example a marketing-automation push that needs an email); never through the lake.
- Alternatives for the store: Azure Cosmos DB (also acceptable); a lakehouse table (rejected: same blast radius as the data it protects); Key Vault alone (rejected: not a mapping store).
4. Erasure run (the runbook, in order):
- Request received from the data subject or the DPO; identity, scope and legal holds verified.
- Path A, crypto-shred: in the vault, delete
lookup_hash,identifier_encandsubject_linkrows for the subject and stamperased_at. From this moment the subject's tokens in every lake layer, history and event are not attributable. - Path B, only where direct identifiers exist: delete the subject's records from landing files younger than 7 days; confirm no payload logging occurred (policy), else purge Application Insights by subject hash; non-production is refreshed from production, never from a raw copy; the optional backup export is on its retention clock.
- Verify per store: vault count = 0 for the subject; landing scan = 0; log scan = 0; optionally Gold count by token if the DPO required deletion there.
- Evidence record: request id, SHA-256 of the
normalised identifier (computed at request time, not stored elsewhere),
scope, each store, time, who, result. Appended to immutable
storage (Azure Blob with a time-based retention policy,
write-once, with a hash chain) and summarised in
control.erasure_log. A zero-row query is a test, not evidence; the record is the evidence. - Reply within one month (GDPR Article 12).
- Path A requires the DPO's documented position that residual tokenised data is no longer attributable (Recital 26); without it, Path B extends to Gold deletion by token.
5. Access and workspaces: the restricted workspace holds the landing files (place 1), the control schema, the Bronze loader (the only identity with vault lookup-or-create) and the Silver and Gold jobs. Bronze, Silver and Gold hold tokens and may be shared more widely than before, but remain personal data in law until a mapping is deleted; the workspace split is kept as the access boundary.
⚠️ Requires stakeholder input (DPO): the Recital 26 position for Path A; jurisdictions of data subjects; retention for landing files (7 days proposed), vault backups and adapter state; whether person-level facts in Gold must be deleted on erasure.
Considered Options
| Option | Summary | Pros | Cons |
|---|---|---|---|
| ✅ Gate before Bronze in the Bronze loader, token vault outside OneLake | Identifiers replaced at landing → Bronze; random tokens by vault lookup; erasure deletes the mapping | No identifier in any Delta table, history, event or export; erasure is one delete plus verification; one place for cross-source identity; replay and reload never touch identifiers; broad Gold audience without per-consumer privacy review | The vault is on the ingestion path (batch lookups, retries, caching per run); landing files are the one hot spot and must be purged on a short clock; free text is lost unless redacted; a consumer that needs identities must use the vault API |
| Gate at Silver → Gold (first draft) | Raw fidelity with identifiers in Bronze and Silver; HMAC tokens in Gold | Debugging and reconciliation on identifiers; no vault | Identifiers in two layers plus history and landing; erasure is physical DELETE plus VACUUM across them; HMAC tokens are recomputable by anyone with the key. Rejected by the architect in favour of the reference design. |
| Gate in each adapter before landing | Functions tokenise before writing landing files | Landing files never hold identifiers | Gate logic duplicated per adapter and vendor connector (the Salesforce copy activity cannot run it); the vault sits behind the public webhook path. Rejected; the loader is the single choke point. |
| HMAC-only tokens, no vault | Deterministic keyed hash, no mapping store | Simplest | Erasure cannot delete a mapping, only the key for everyone; re-identification possible with the key and a candidate identifier. Rejected. |
| No gate, access control only | Security in the semantic model | Least work | Fails data minimisation; one misconfiguration exposes everything. Rejected. |
Consequences
Positive:
- Erasure is a deletion in one store with a verifiable evidence trail, instead of a scrub across layers.
- Bronze, Silver and Gold can be reloaded, replayed, exported and shared without ever moving an identifier.
- Cross-source identity resolution happens once, at the gate, and every layer inherits it.
Negative / Trade-offs:
- The vault is a critical dependency: the Bronze loader batches lookups (thousands per call), caches tokens for the run, and retries; the landing files are retained until promotion succeeds, so a vault outage delays rather than loses data.
- Reconciliation hash samples must pass the source sample through the same gate before comparing; counts are unaffected.
- Some analyses (named contact lists) require the vault API under the erasure role's governance; the lake cannot answer them.
Risks: | Risk ID | Description | Impact (E/H/M/L) |
Mitigation | |---------|-------------|------------------|------------| |
R1 | An unclassified column or free text carries an identifier past the
gate | H | Hard fail on unclassified columns; PII scanner on all string
columns; free text dropped by default | | R2 | Vault compromise (dump
plus k_lookup) enables re-identification | H |
Customer-managed key, Entra-only auth, PIM, auditing, encrypted
identifier column, alerting on reverse lookups | | R3 | Vault
unavailable stalls ingestion | M | Batch API, retries, per-run token
cache; landing retained; Azure SQL S1 at launch (locally redundant; the
Standard tier cannot be zone-redundant), moved to zone-redundant General
Purpose serverless if the vault SLA requires it (technology
architecture, assumption A-64) | | R4 | Payloads logged by an
adapter or pipeline leak identifiers outside the lake | H | Logging
policy (ids only), code review item, Application Insights purge in the
runbook | | R5 | DPO does not accept the Recital 26 position | M | Path
B extends to Gold deletion by token; design unchanged otherwise |
Related
- Supersedes: the Silver → Gold gate position in the 2026-10-26 first draft of this record
- Related ADRs: 2, 5, 8, 10
- Related requirements: Data integrity; (implicit) regulatory compliance
- Related documents: data classification, Gold schema, Bronze loader components, reference design
- Principles: DP-06, TP-03, TP-04
- TOGAF phase: C (Data)
- Decision maker(s): Lead Architect (decision 2026-10-26); DPO sign-off on the Recital 26 position pending
- Stakeholders: Marketing Operations, IT Security, Legal