Entitix

Privacy, security and AI

Data masking and access control: deciding who sees what

  • Updated
  • 6 min read
Contents

Most people who work with data do not need to see all of it. An analyst studying payment patterns does not need card numbers; a developer testing a new feature does not need real customers. Access control decides who may reach which data, and masking makes data useful without revealing what should stay hidden. Together they put the principle of least privilege into practice.

In short

  • Decide access per role and per data class, not person by person and table by table.
  • Distinguish environments: what is acceptable in production is rarely acceptable in test.
  • Masking hides sensitive values: redaction, partial masking, substitution, generalization, tokenization, keyed hashing or synthetic data.
  • Pseudonymized data is still personal data under the GDPR; only truly anonymized data is not.
  • Review access regularly (recertification), and record why each role has the access it has.

Access control, the basics

ConceptMeaning
Least privilegeEveryone gets the access their work needs, and no more
Need to knowAccess to sensitive data requires a business reason, not only a position
Role-based access (RBAC)Access is given to roles, people are given roles
Attribute-based access (ABAC)Access depends on attributes of the person, the data and the context, such as department, classification or location
Row-level securityPeople see only the rows they may see, such as their own region’s customers
Column-level securitySensitive columns are hidden or masked for some roles
Segregation of dutiesNo single person controls a sensitive process from start to end

Deciding access per data class

The most manageable approach combines roles with the data classification:

RolePublic and internalConfidentialPersonal dataSpecial categories
Customer service agentReadReadReadMasked
Marketing analystReadReadMaskedNo access
Data scientist (production)ReadMaskedMaskedNo access
Developer (test environment)ReadMaskedSyntheticNo access
Outside auditorReadRead, by requestRead, by requestBy request

Each cell is a decision with a reason that a data owner approved. Recording the justification makes access reviews and audits much easier.

Masking techniques

TechniqueWhat it doesExampleReversible?
RedactionReplaces the value entirely*****No
NullingRemoves the valueemptyNo
Partial maskingKeeps part of the value visible**** **** **** 4821No
SubstitutionReplaces with a realistic fake valueA random name from a listNo
ShufflingMoves real values between recordsBirth dates swapped between customersNo, but real values remain
GeneralizationReduces precisionAge band 30–39 instead of a birth dateNo
TokenizationReplaces with a token; a protected vault holds the mappingTKN-8F3A21Yes, through the vault
Keyed hashingA one-way function with a secret keyA fixed code per customer, for joining data setsNot without the key
EncryptionReversible with the key; format-preserving variants keep the shapeAn account number that still looks like oneYes, with the key
Synthetic dataGenerated data with similar statistical propertiesA test database with no real peopleNo real records

Two cautions. A plain hash of a value with few possibilities, such as a national identification number or a phone number, can be reversed by hashing every possible value; use a secret key. And shuffled or substituted data can still reveal real information if a few rare values remain.

Static and dynamic masking

  • Static masking changes the data in a copy, for example when production data is copied to a test environment. The copy never holds the original values.
  • Dynamic masking hides values at query time, depending on who asks. The data is unchanged; different roles see different results.

Test and development environments should normally receive statically masked or synthetic data. Copying production data into test as it is turns every test environment into a production-grade risk.

Pseudonymization and anonymization

Under the GDPR, pseudonymization means processing personal data so that it can no longer be attributed to a person without additional information kept separately and protected (Article 4(5)). Pseudonymized data is still personal data, but pseudonymization is a recognized safeguard (Articles 25 and 32).

Anonymized data, from which a person can no longer be identified by any means reasonably likely to be used, is not personal data (Recital 26). True anonymization is harder than it looks: rare combinations of values can identify people even without names.

Keeping access under control

  1. Define roles around how people work, each with an owner who approves membership.
  2. Set rules per role, data class and environment, with a justification.
  3. Implement them in each platform: database grants, row and column security, masking policies.
  4. Recertify regularly: the role owner confirms who still needs access, for example every six or twelve months.
  5. Log and monitor access to restricted data.

Common mistakes

  • Access granted person by person. Nobody can say any more why someone has access.
  • Production data in test. The weakest environment holds the most sensitive data.
  • Plain hashing as anonymization. Hashed identifiers can often be reversed or linked.
  • Masking only in one tool. Data exported to a spreadsheet loses the masking of the report.
  • No recertification. People change jobs and keep their access.
  • Role explosion. Hundreds of nearly identical roles are as unmanageable as individual grants.

Frequently asked questions

What is data masking?

Data masking replaces sensitive values with modified or fictitious ones, so that data can be used for testing, analysis or support without revealing what should stay protected. Techniques include redaction, partial masking, substitution, generalization, tokenization, keyed hashing and synthetic data.

What is the difference between static and dynamic data masking?

Static masking changes the values in a copy of the data, for example a test database, so the copy never holds the originals. Dynamic masking leaves the data unchanged and hides values at query time depending on who is asking.

Is pseudonymized data still personal data?

Yes. Under the GDPR, pseudonymized data can still be attributed to a person with additional information kept separately, so it remains personal data, although pseudonymization is a recognized safeguard. Only anonymized data, from which people can no longer be identified by reasonably likely means, falls outside the GDPR.

How often should access rights be reviewed?

Regularly and in proportion to the sensitivity of the data: commonly every six to twelve months for access to confidential and personal data, and more often for restricted data and privileged technical accounts. Changes of job should trigger a review straight away.