KVKK Technical Measures: Implementing Permissions, Access Logs and Masking

How are KVKK technical measures implemented in systems? A permission matrix, access reviews, database and file logs, masking, pseudonymization and evidence examples for test environment data.
Technical summary
Technology
KVKK, Active Directory, SQL Server Audit, Dynamic Data Masking, Windows object access auditing, DLP
Topic
Implementing and verifying KVKK technical measures in enterprise IT systems
Level
Intermediate
Prerequisites
  • A personal data processing inventory
  • Directory and database administration access
  • A central logging infrastructure
In this article8 sections

The first question after a breach isn’t “do you have a policy?”; it’s “who accessed this record, and when?” Most organizations have no answer, because sign-in logs were kept but data-level logging was never turned on. KVKK’s data security obligation is a single article on paper; in systems, it means a permission matrix, database audit records, copies in test environments and masking rules. This guide is for system administrators and information security leads and explains how a measure is implemented and how it’s proven. It isn’t legal advice; decisions on legal basis and retention periods are made with the legal and compliance team.

Where technical measures fit in KVKK

Article 12 of Law No. 6698 on the Protection of Personal Data (KVKK) requires the data controller to take “all necessary technical and administrative measures to ensure an appropriate level of security” to prevent unlawful processing of and access to personal data and to ensure its safekeeping. The law doesn’t name technologies. The concrete framework is drawn by the Personal Data Protection Authority’s Personal Data Security Guide (Technical and Administrative Measures) and the Board’s decisions.

The technical measures in the guide are: a permission matrix and permission control, access logs, user account management, network and application security, encryption, penetration testing, intrusion detection and prevention, monitoring of log records, data masking, data loss prevention, backup and key management. For special categories of personal data, the Board’s decision No. 2018/10 dated 31 January 2018 raises the bar: logging access to this data, at least two-factor authentication for remote access, encryption in transit and so on.

On the enterprise cybersecurity side, the essence is this: documentation isn’t enough; you need to show with dated records that the measure works in the relevant system. Every measure should have an implementation point and evidence. A measure without evidence doesn’t exist.

The technical counterpart of the personal data inventory

The legal team’s inventory consists of rows like “customer contact details, in the CRM, 10 years”. A system administrator can do nothing with such a row. Its counterpart must be known: which server, which database, which table and column, which file share, which SaaS application?

For each inventory row, build a “technical data map” that holds these fields:

  • Storage location: server name, database/schema/table or share path, cloud tenant.
  • Data fields: sensitive columns such as national ID number, IBAN or health information are marked separately.
  • Access channels: application interface, direct database connection, reporting tool, API, exports.
  • Copies: backups, test and development environments, the reporting data warehouse, Excel files users have downloaded.
  • System owner and data owner: who approves access requests and who does the review.

The area most often missed is copies. Permissions on the production database are tight; the reporting copy of the same data transferred overnight is left open at “Domain Users” level. Without seeing this, the inventory can’t be considered complete. For unstructured data on file servers, the methods for sensitive data discovery on file servers fill in the missing part of the map.

The authorization matrix and access reviews

The permission matrix is a table showing the permissions between roles and personal data sets. For it to be workable, the chain must be clear: a role is tied to a directory group, and the group to an application or database role. Permissions granted directly to a person break both reviews and the offboarding process. A permission outside the matrix is a permission without an owner.

Role Data set Permission Technical counterpart
Call center Customer contact Read, masked AD group → CRM role, national ID masked
Accounting Customer account, IBAN Read/write AD group → ERP role
HR specialist Personnel files Read/write A separate share, HR group only
Reporting Sales reports Read A pseudonymized view, no raw table
Database administrator All tables Management A separate administrator account, sessions logged

An access review compares the matrix with reality. The first step is to export group memberships, including nested groups; if you pull only direct members, access coming from nested groups is invisible:

Get-ADGroupMember -Identity "CRM_Customer_Read" -Recursive |
  Get-ADUser -Properties Enabled, LastLogonDate, Department |
  Select-Object SamAccountName, Name, Department, Enabled, LastLogonDate |
  Export-Csv -Path .\CRM_Customer_Read_review.csv -NoTypeInformation -Encoding UTF8

Send the list to the data owner, get a “keep / remove” decision for each user and record the removal dates. That’s the evidence of the review. Bring local accounts in the application’s own user table into the same cycle; accounts outside the directory are the most often forgotten access. For how to document this in an audit, see the access review evidence guide on the compliance side.

Keeping access logs

An access log should answer one question: who accessed which personal data, when, and through which channel? A sign-in log doesn’t tell you this. Data-level logging is needed. Options by source:

  • Application log: The most meaningful record is the “customer card viewed / exported” event produced by the application. In new development, this event should be logged with the user, record ID and operation type.
  • Database auditing: If the application doesn’t produce logs, or there is direct database access, the database’s audit feature is brought into play.
  • File system auditing: On a Windows file server, object access auditing is turned on and SACLs are defined on sensitive folders; access shows up in the Security log as event ID 4663.

An example configuration in Microsoft SQL Server that writes read and change operations on a sensitive table to a file:

USE master;
CREATE SERVER AUDIT PersonalDataAudit
  TO FILE (FILEPATH = 'E:\SQLAudit\', MAXSIZE = 256 MB);
ALTER SERVER AUDIT PersonalDataAudit WITH (STATE = ON);

USE CRM;
CREATE DATABASE AUDIT SPECIFICATION CustomerTableAccess
  FOR SERVER AUDIT PersonalDataAudit
  ADD (SELECT, UPDATE, DELETE ON OBJECT::dbo.Customer BY public)
  WITH (STATE = ON);

On a Windows file server, the audit subcategory is turned on first, then an audit entry (SACL) is added to the folder. A subcategory turned on without a SACL produces no logs:

auditpol /set /subcategory:"File System" /success:enable /failure:enable

On domain servers, distribute this setting through Group Policy’s Advanced Audit Policy Configuration. A local change made with auditpol can be overwritten by the GPO value at the next policy application. That’s the typical cause of the “auditing was on, then it disappeared” complaint in the field.

Three mistakes keep recurring in logging design. First: the application connects to the database with a single service account, and database auditing shows only the service account. An application log is essential to tell end users apart. Second: logs sit where the administrator accessing the data can delete them. Logs should flow to a central system, and system administrators shouldn’t be able to change these records. Third: no volume calculation is done. Logging every SELECT on a high-traffic table fills the disk within days; limit the scope to sensitive tables and bulk exports. A full disk means lost logs. For retention period, integrity and access control, see the central log retention architecture article.

Masking, pseudonymization and anonymization

These three techniques are constantly confused; their legal consequences differ. Anonymous data can’t be linked to a person even when matched with other data, and it falls outside the scope of KVKK. Pseudonymization and masking don’t stop data from being personal data. They only limit what the person accessing it sees.

Technique What it does Reversible? Typical use
Dynamic masking Hides the value in the query result Yes, the source data doesn’t change Call center screen
Static masking Permanently changes the value in the copied data No (for the copy) Test environment
Pseudonymization Replaces the identity with a keyed value Yes, with the key Reporting, analytics
Anonymization Permanently breaks the link to the person No Statistics, external sharing

An example of Dynamic Data Masking in SQL Server:

ALTER TABLE dbo.Customer
  ALTER COLUMN NationalID ADD MASKED WITH (FUNCTION = 'partial(0,"*******",4)');
ALTER TABLE dbo.Customer
  ALTER COLUMN Email ADD MASKED WITH (FUNCTION = 'email()');

GRANT UNMASK TO [CRM_Authorized_Role];

A common pseudonymization method is taking an HMAC of the identity field with a secret key. A plain hash without a key (such as SHA-256 alone) can be reversed in fields with a limited value space, such as the national ID number, by computing all possibilities. A hash isn’t encryption. The key is kept separate from the team using the data. In anonymization, deleting the name and ID number isn’t enough; the combination of date of birth, postal code and gender can make a person re-identifiable. The generalization, noise addition and k-anonymity methods in the Authority’s anonymization guide target this risk.

Using real data in test environments

Restoring a production backup to a test server takes ten minutes. The result is a weakly protected copy of personal data that doesn’t appear in the inventory. In the test environment, developer access is broad, logging is weak, and external software companies connect. Attackers look there first too.

A workable order of decisions:

  1. Is synthetic data enough? For most functional tests, yes. Generated data should follow field formats (the national ID algorithm, IBAN structure).
  2. If a real data distribution is needed, the copy taken from production goes through static masking before being moved to the test environment. The masking script runs on the production side or in a separate intermediate environment; raw data never reaches the test network.
  3. If unmasked data is unavoidable (for example, reproducing a production bug exactly), it’s an exception: it’s managed as a time-limited, approved environment whose access follows the same rules as production, which is deleted when the work is done and whose deletion is recorded.

Masking should preserve referential integrity: if the same customer number doesn’t turn into the same masked value in every table, application tests break. That’s why transformations are chosen that are deterministic (the same input gives the same output) but whose key the test team doesn’t hold.

Technical measures checklist

Use the steps below when reviewing a system from a personal data standpoint. Next to each item, write the answer to “how is it shown?” That answer is the evidence.

  • The system is recorded in the technical data map with its location, fields and copies; a system owner is defined.
  • Access to personal data is granted only through groups; there are no permissions assigned directly to individuals.
  • The date of the last access review, the approver and the removed access are recorded.
  • Access to sensitive tables and folders is logged at the user level; logs flow to a central system and can’t be deleted by system administrators.
  • There’s an alert rule for bulk exports and high-volume queries.
  • Unnecessary fields are masked on screens; the right to unmask is justified and limited.
  • There’s no raw personal data in test and development environments, or it’s managed with an exception record.
  • Disk encryption is enabled on endpoints and servers; TLS is mandatory in transit (for details, see the encryption controls guide).
  • A periodic destruction job is defined for data whose retention period has expired, and output showing it ran is kept.
  • Data loss prevention rules recognize personal data patterns (national ID number, IBAN) and run at least in monitoring mode.

Which control to tackle first depends on the type of data in the system and its exposure. For monitoring sensitive data patterns in email, cloud sharing and endpoints, a data loss prevention (DLP) project, and for prioritizing across systems, a cybersecurity risk assessment, are sensible starting points. Current versions of the Authority’s guides are on kvkk.gov.tr; details of SQL Server masking behavior are in Microsoft’s Dynamic Data Masking documentation.

Frequently asked questions

Does pseudonymized data fall outside the scope of KVKK?

No. Pseudonymization stops data from directly identifying someone, but because it can be linked back to the person with a key or mapping table, it remains personal data. Only data whose link to the person has been irreversibly broken, that is, anonymized data, falls outside the scope.

Are sign-in logs sufficient as KVKK access logs?

Usually not. A sign-in log shows that the user entered the system; it doesn’t show whose data they accessed. Application- or database-level logs that link the user to the record or table accessed are needed.

Can a masked copy of production data be used in the test environment?

If the masking is permanent and irreversible, and indirect identifiers have also been dealt with, the risk drops considerably. Masking should run at a point where raw data never reaches the test network; the test team shouldn’t hold the key or mapping information.

No, they’re only part of the data security obligation. Privacy notices, legal basis, retention periods, data subject requests and data processor agreements are assessed together with the legal and compliance teams; this article isn’t legal advice.

Support

Contact us for support or a discovery session on this topic.

Contact form
[email protected]

Eretek Cybersecurity

Firewall, VPN, endpoint security and threat prevention. We reduce the attack surface and measure and report the risks.

Knowledge Center

Other articles