Data masking
Annex A 8.11 limits how much sensitive data each person sees once access control has admitted them. A 25–250-person firm can meet it with an automated sanitisation pipeline for test data, native dynamic masking for support screens, and strictly isolated re-identification keys. That combination satisfies UK GDPR and the certification auditor, and it files its own evidence.
The due-diligence questionnaire asks whether production data ever reaches your test environments. Your honest answer is "yes, unmasked", and the deal waits. ISO 27001 Annex A data masking closes that gap, and at 25–250 staff you can meet it with plumbing you mostly own already.
This guide covers what A.8.11 requires, the three techniques people confuse, and how to sanitise test data, mask support screens and guard re-identification keys. It ends with the audit questions and the automation that produces your evidence. It is written for security leads and engineering heads who need to pass ISO 27001:2022 without buying an enterprise masking suite.
Annex A 8.11 requires you to limit how much sensitive data each person sees after access control has admitted them. Where data is sensitive, especially personal data, you hide what a role does not need. Choose the masking technique to match your access-control policy and the law, not tool defaults.
Access control decides who can open a dataset. Annex A 8.11 decides how much of it they see once inside. A support agent sees the last four card digits, a developer tests against sanitised records, and an analyst works on data that cannot be traced back to a person.
Data masking in ISO 27001 is a preventive control that protects confidentiality. Obscured data cannot be read, copied or leaked by someone who was never shown it, so the exposure disappears before any misuse starts. It works as a handling rule applied per classification tier, and for personal data the technique you pick is also a legal decision.
The most common self-inflicted breach at 25–250 people isn't a hack. It is a production database copied into test with none of production's protections, or a full customer record visible to every support agent when the job needs three fields.
In practice the control asks three things of you:
Masking obscures the value a user sees. Pseudonymisation swaps an identifier for an alias that a separately guarded key can reverse. Anonymisation destroys the link to the person permanently. Under UK GDPR, pseudonymised data remains personal data because the key exists, while truly anonymous data falls outside data protection law.
The three differ in what survives and who can undo it:
The ICO guidance on pseudonymisation and UK GDPR scope is clear that pseudonymising does not take data out of data protection law. Pseudonymised data is personal data in the hands of anyone who holds the additional information, and as the key holder, that means you. A partner you share it with, without the key, may hold anonymous information, but your own copy stays in scope.
The techniques are not rivals. A support screen can show a masked value while the stored record is pseudonymised and the key sits in a vault. Your policy should say which layer protects which audience.
Regulators expect you to know which of the three you hold. Record the answer per dataset in your classification register, because it decides whether UK GDPR applies at all.
The pitfall is treating pseudonymised data as out of scope. A customer ID swapped for a UUID, with the lookup table in the next schema, is pseudonymised. So is a hashed email column. Both remain personal data for you, because you hold the lookup table or can simply recompute the hash.
Stop production data reaching dev, test and QA by running every database copy through an automated sanitisation step before it leaves production. Static masking replaces sensitive fields with realistic fakes while keeping records internally consistent, so tests still work. Modern database platforms and seed-data generators make this cheap, typically one to two weeks of engineering.
A workable pipeline has four steps:
End every run with a scan of the output for live-looking values and a row-count check. Classification and the access-control policy come first in the sequence, because masking rules are those policies made concrete.
The failure mode is the clone made "just this once". An engineer needs to reproduce a bug, copies production, and the exception becomes standing practice.
A test environment holding a production copy is a production environment with weaker controls.
Apply dynamic masking at the point of display: role-based rules at the database or application layer that show a truncated or obscured value by default. Mainstream databases and major SaaS platforms can do this with built-in features, so at 25–250 staff you rarely need a dedicated product. Choose the technique per use, then record it in policy.
SQL Server ships dynamic data masking as a column property. In Postgres, a view granted to a restricted role does the same job, as does an application-layer serialiser. Most SaaS support desks offer field-level permissions in their admin console. The support role gets the masked column, and a named exception role gets the real one.
Roll the masking out system by system, highest sensitivity first:
The pitfall here is over-engineering. An enterprise masking suite buys little when your database engine's built-in rules and a decent seed-data script cover the actual need. Dedicated tooling earns its place with data-estate complexity, not because the standard asks for it.
The table below matches each technique to its use. Write the choice into your classification and secure-development policies so it is a rule, not a habit.
| Technique | Use it when | Watch for |
|---|---|---|
| Salted hashing | You need to match records without reading them | Unsalted hashes of emails or phone numbers fall to enumeration |
| Tokenisation | You need matching, with the real value held elsewhere | The token vault becomes a key asset to protect |
| Format-preserving substitution | Systems validate the shape of a value, such as a postcode or card number | Substitutes must never be real, live values |
| Truncated display | A support agent must confirm identity | Reveal must stay a logged exception |
| Full redaction | Nothing downstream needs the value | The field loses all analytical use |
Treat re-identification keys as crown jewels, because whoever holds the pseudonymisation key can undo the whole scheme. Store keys separately from the data they unlock and restrict access to holders you can count on one hand. Rotate them, and log every unmasking event to your monitoring stack against a named person.
Four measures turn that into practice:
This mirrors what the ICO asks of pseudonymisation itself: hold the additional information separately and keep it secure, for example in a separate database or network segment.
The usual failure is convenience. The key ends up in the same database schema, in a config file in the application repository, or in a shared document. One compromise then reverses the whole scheme.
Rarely, on masking alone. The ICO states that masking is not an effective anonymisation technique by itself, though it helps when combined with generalisation and randomisation. Data counts as anonymous only if no one could re-identify people by means reasonably likely to be used, including joining your dataset to another. Check the claim before relying on it.
The ICO anonymisation guidance on masking effectiveness is the reference to check against. It names three risks that a claim of anonymity has to survive:
Mask a dataset in isolation and it can look safe. Publish two of them and the crossword solves itself: a postcode district and birth year in one, the same fields beside a job title in another. Keep masked datasets from being combined in ways that rebuild identities.
Write down why re-identification is not possible before you call anything anonymous. The ICO's motivated intruder test is the usual frame: could a reasonably competent person, with the resources and techniques likely to be available, identify someone? That reasoning is what you hand over when the claim is challenged.
The pitfall is declaring a dataset anonymous because the names are gone, then sharing it with a partner who holds the other half.
Add automated log redaction to your development standards. Sensitive values escape through debug logs, stack traces, file names, URLs, email subject lines and monitoring telemetry even when the database itself is well masked. Redact at the logging layer so engineers cannot forget, then sample log output to confirm the filter works.
Put the filter in a shared logging wrapper or the log pipeline, so every service inherits it. Allow-listing the fields that may be logged is safer than trying to deny-list every pattern for emails, card numbers and National Insurance numbers.
Then prove it works with three quick checks:
A beautifully masked database with leaking logs is still a leak. Logs are often kept longer and read by more people than the database.
Expect five questions. Is real customer data in test right now? What does a support agent see? Who can reverse pseudonymisation? How are database copies sanitised, and how does card or personal data stay out of logs? Auditors back them with live sampling of a non-production database and a low-privilege screen view.
The sampling usually runs as follows:
A mask that exists in the policy but not in the console isn't a control.
Have this evidence ready:
In certification-body practice, raw production personal data sitting in unprotected dev or test environments is the total-breakdown case and grades major. A masking rule missing on one system, an unreviewed unmasking log or a policy lagging current practice grades minor, though a pattern of minors can aggregate to major.
Make the pipeline the evidence. Run sanitised refreshes as a scheduled job that files its own verification output, and keep masking rules as code in git. Route every unmasking event to monitoring with a weekly review digest, and scan non-production stores regularly for live-looking personal data.
Each piece produces its own audit artefact:
At this scale, that pipeline answers the certification auditor and the enterprise questionnaire with the same artefacts. "Does production data reach non-production?" gets a dated scan report instead of a promise.
Build them in order. A.5.12 tells you which data is sensitive, A.5.15 decides who may open it, and A.8.11 decides what each person sees once inside. A masking rule with no classification behind it is guesswork. When encryption or hashing does the hiding, A.8.24 on cryptography joins the chain.
Only as an exception, never as a workflow. The exception needs a specific need, an approval, a time limit and a record, such as a ticket reference attached to an expiring grant. Auditors will ask which is your actual default, so make sure sanitised data is the answer you can show.
No. The table above covers the enumeration risk. The stronger choice is a keyed hash, such as an HMAC, with the key held in your key-management service rather than beside the data. That key is then a re-identification key and the hashed column is still personal data, so A.8.24's cryptography rules and the key controls above both apply.
Yes. Any use that exposes sensitive data to people or systems that do not need the real values falls within the control's intent. NIST SP 800-188 guidance on de-identification and masking tools warns that tools which merely mask personal information do not automatically achieve de-identification. Before data leaves for a partner or a model, test the re-identification risk of the exact extract and record the result.
Governance sits with whoever owns security and privacy, typically the CISO role, because choosing between masking, pseudonymisation and anonymisation is a compliance decision. Day-to-day enforcement lives with engineering and the data platform team, who run the pipeline and maintain the rules. Both need training on which technique applies where.
Every control in this framework and the clause guides that sit above them, grouped by control domain. Open any entry for its control definition, implementation steps and the audit evidence it expects. Dimmed entries are planned.
Work with a Trust Architect to scope your ISMS, close the gaps, and get audit-ready — without stalling your roadmap.