Data & Integrity

Data Masking & Redaction

Intermediate

Often a screen, a log, a support tool, or a test database needs to show that data exists without showing the actual sensitive value. Masking and redaction reveal just enough (the last 4 digits, part of an email) while hiding the rest. This limits who can see full sensitive data to only those who truly need it.

Masking shows a partial value (**** **** **** 4321). Redaction removes it completely ([redacted]). Tokenisation and anonymisation replace it with a safe stand-in. The goal is data minimisation in practice: the fewest people and systems seeing full sensitive values. It supports safe logging, support tools, analytics, exports, and non-production test data.

This connects Data Classification (what is sensitive), Observability & Logging Hygiene (do not log it), Test Data & Environments (mask before reuse), and Privacy. The mistake to avoid: showing or storing the full value when a masked one would do.

Reveal only what's needed

Full value, hidden in the UI // API returns the whole number; the frontend shows ****
{ "accountNumber": "12345678" } // full value on the wire and in logs

The full value is sent to the browser (and likely logged on the way) and only visually masked. Anyone inspecting the response or the logs sees it all. Masking must happen before the value leaves the trusted layer.

Masked server-side { "accountNumberMasked": "****5678" } // only the safe form leaves
// the full value is fetched separately, access-checked and audited, only when needed

Only the masked form is sent by default. The full value needs an authorised, audited request, so it is not casually exposed in responses or logs.

Do it correctly

Self-review checklist

Why it matters: Most people and systems that touch sensitive data only need to recognise it, not read it in full. Every place the full value appears is another chance for it to leak. Masking and redaction make minimal exposure the default, which reduces the breach surface across logs, screens, exports, and test data alike.