When an auditor or a privacy consultant asks "can we see your access matrix?", most organisations open a spreadsheet. It lists roles and application screens, but the database is usually a single row: "DBA: full access". This article explains how to build a usable access matrix for the database layer, gives a sample table, and covers what it takes for the matrix not to remain just a document.

What Is an Access Matrix?

An access matrix is a document that shows, in one table, which role may perform which operation on which resource. Roles are the rows, resources and operations are the columns, and each cell says "allowed", "not allowed" or "with approval". The goal is to answer two questions together: who can reach what, and why is that access needed?

For any organisation processing personal data this document becomes a requirement in practice. The Turkish Personal Data Protection Board's data security guide lists defining access rights and checking them regularly among the technical measures. The law does not use the words "access matrix", but a matrix is the most common way to show that access is defined and controllable.

The Axes of a Database Matrix

A matrix written for application screens does not work for a database, because database access is granted at four layers. The columns of the matrix should keep those layers apart:

  • Environment: production, test, development. The same role may read in production and write in test.
  • Scope: server, database, schema, table or column. Columns holding personal data need their own row.
  • Operation: read (SELECT), data change (INSERT, UPDATE, DELETE), structure change (CREATE, ALTER, DROP), granting access (GRANT).
  • Mode of access: standing permission, temporary access by request and approval, masked view only.

The rows are roles, not people. Typical roles: the application service account, DBA, developer, reporting and analytics, application support, external vendor and the emergency account. Shared accounts need their own row with the people who use them listed; otherwise the matrix is useless for the question "who did this?".

A Sample Access Matrix

The table below is a starting example for the production environment. Adapt it to your own roles and schemas; the real value lies in discussing and deciding each cell one by one.

Role (production) Read Personal data columns Data change Structure change Grant
Application service account Own schema As the application needs Own schema No No
DBA Yes By request and approval Through an approved change Through an approved change Through an approved change
Developer By request and approval Masked only No (requests it) No (requests it) No
Reporting and analytics Reporting views Masked only No No No
Application support By request and approval With justification, per column No No No
External vendor Time-boxed, by request Masked only Through an approved change Through an approved change No
Emergency account Kept disabled; every use is recorded and reviewed afterwards

The "by request and approval" and "through an approved change" cells are the most important part of the matrix. They are not a standing permission but a mode of access that needs a justification and an approval each time. Writing "yes" in those cells gives everyone who reads the matrix the wrong picture.

Building It in Seven Steps

  1. Inventory: list the production servers, databases and the tables holding personal data.
  2. Roles: write duties, not people. Name the owner (the approving manager) of each role.
  3. Sensitive columns: mark columns such as national ID, phone, e-mail, address, card and account data separately.
  4. Cell decisions: for each role and resource decide "yes", "no", "by request and approval" or "masked only", and write the reason next to it.
  5. Pull the real state: extract the current permissions from the database and compare them with the matrix (next section).
  6. Close the gaps: remove excess permissions, grant missing ones through a request, and record every decision.
  7. Schedule: compare the matrix with real permissions at set intervals and review only what changed.

The Gap Between the Matrix and Real Permissions

The most common problem: the matrix is well written, but the real permissions in the database live independently of it. A db_owner granted for a project is never removed, a leaver's account is not dropped, role membership grows through nested groups. Auditors ask for the list pulled from the system, not the matrix.

So the matrix should have two parts: what should be (the decision) and what is (the list pulled from the system). Queries that pull the complete permission list for SQL Server, PostgreSQL and Oracle, and a method that reviews only the difference between rounds, are in the database user access review article.

The Question the Matrix Does Not Answer

Even a perfect matrix answers only "who can reach what". In an audit, and after an incident, the question is different: when did the person with access use it, for what reason, and with whose approval? Every action of a DBA with standing access complies with the matrix, but the matrix does not say which one rested on a request. This gap is covered in detail in they had the access but no reason.

SQL Change Guard is designed to make the "by request and approval" and "through an approved change" cells enforceable: changes bound for production and data requests from production are opened with a justification, routed for approval by role and risk, sensitive columns are masked, and an evidence file is produced for every request. The product does not list standing permissions in the database; that list is still taken from the database itself.

Frequently Asked Questions

Can the access matrix be kept in a spreadsheet?

For the decision part, yes; what matters is that the version history and the approver are known. Real permissions should not be typed into the spreadsheet by hand but pulled from the system again at every review.

How often should the access matrix be reviewed?

Most organisations review production every three or six months, while leavers and role changes are handled without waiting. The right frequency is set by your own risk assessment and the regulations you are subject to.

Is an access matrix mandatory under KVKK?

The law does not use the words "access matrix"; it requires the data controller to take the measures needed for an appropriate level of security. The Board's guide lists defining and checking access rights among those measures, and a matrix is the most common way to show it.

Is it wrong to give DBAs full access in production?

In most organisations it is unavoidable, because maintenance and emergency work require it. The problem is not the access itself but that its use is not tied to a request and an approval. In the matrix this is written as a "through an approved change" rule next to the standing access.

Make the "by request and approval" cell enforceable

We will show the justification, approval and masking steps of a production change and a production data request on your own scenario.

Book a Demo →