← Concepts

阅读中文版本

Data Masking Policies

Data masking replaces sensitive fields with structurally consistent non-sensitive substitutes, so non-production environments and least-privilege views receive usable data without exposing the.

security

Definition

Data masking is the transformation of sensitive data fields into non-sensitive substitutes that preserve the format, type, and referential integrity needed for the consuming workload, so that developers, analytics, and support see realistic data without access to the underlying secrets.

Context and scope

Applied in non-production database copies, analytics sandboxes, support tooling, and any context where the workload needs the shape but not the value.

Common misconceptions

  • Masking is reversible so it is encryption — masking is one-way by design; reversible masking is encryption with extra steps and a different threat model
  • Masking the obvious fields (SSN, email) is sufficient — foreign keys and join columns can re-identify individuals even when direct identifiers are masked

Anti-patterns

  • Using the same mask function for every environment, so the mask itself becomes a second identifier
  • Masking display values but leaving search indexes on the real values, allowing recovery through query

Related concepts

Authoritative source

https://en.wikipedia.org/wiki/Data_masking

What it is

Data masking is the transformation of sensitive data fields into non-sensitive substitutes that preserve the format, type, and referential integrity needed for the consuming workload, so that developers, analytics, and support see realistic data without access to the underlying secrets. Applied in non-production database copies, analytics sandboxes, support tooling, and any context where the workload needs the shape but not the value. The threat model determines which controls apply: preventive controls block exploits, detective controls surface violations, and corrective controls restore integrity after an incident.

How it works

Effective implementations layer controls so that no single bypass compromises the asset. Verification happens at trust boundaries, not just at the perimeter. Cryptographic primitives are selected for the concrete property needed — unforgeability, indistinguishability, or non-malleability — and never composed ad hoc. Failure modes fail closed: a verification error denies rather than allows.

When to enforce and pitfalls

Enforce wherever an attacker can influence input that crosses a trust boundary. Common pitfalls include treating obfuscation as a control, relying on secrecy of the algorithm rather than the key, and auditing the happy path while ignoring error-handling branches where bypasses often hide. Rate-limit and log every verification attempt so brute-force and oracle attacks become visible.