Part E · Chapter 22 · Governance and operating models

22. Classification, privacy and security controls

Classification says how sensitive each piece of data is; the controls make sure each person sees only what that allows, everywhere the data goes. Classify once, let the classification follow the data down the lineage, and let the database enforce it for every role.

A policy following the data, from one table to the board
Playback speed

The clip shows four classification levels, with the claims and customer columns at each. The claim's cause then travels from the claims system to the warehouse and the board's model, keeping its level at every hop. Three roles run the same queries: the claims handler sees every claim, the medical ones included, and the adjusters' documents; the analyst sees the claims without the medical ones and is refused the documents; finance sees the money but is refused the cause. The analyst reads customers through a masked view: an initial and a year of birth. Last, the copies a deleted claim must also leave.

The idea: classify, follow, enforce

Classification gives every column a level that says how carefully it must be handled. Harbour Mutual uses four:

  • Public: published by Harbour Mutual itself, such as its product names.
  • Internal: for staff, harmless outside, such as a claim's status.
  • Confidential: identifies a person or carries money: names, dates of birth, reserves, payments.
  • Special category: details about a person's health, such as an adjuster's notes on an injury. The strictest level.

Then two habits make classification work. It follows the data: a copy or a figure computed from a confidential column is confidential too, until its owner decides otherwise and says why. And the controls enforce it where the data is read, for each role: which rows (row-level security), which columns (column grants), and which values are shown only in part (masking). The same goes for time: retention says how long each kind of data is kept, and deletion must reach every copy the lineage shows.

A column can be sensitive in only some rows A claim's cause is usually harmless ("storm"), but "medical" reveals something about a person's health. The column is confidential, and a row policy hides the medical rows from the roles that may not see them.
Remember Classify each column once, let the classification travel with the data, and enforce it in the database for every role.

A worked example: three roles, the same queries

The claims handler handles claims, injuries included. The analyst builds trends and must not see health details. Finance posts the money and does not need the causes. The policy below grants each exactly that: of the 60 claims, the analyst sees 56, because the 4 medical claims are hidden.

The roles, the column grants, the row policies and the masked view (PostgreSQL)
CREATE ROLE claims_handler NOLOGIN;
CREATE ROLE analyst NOLOGIN;
CREATE ROLE finance_reporting NOLOGIN;
ALTER TABLE claims ENABLE ROW LEVEL SECURITY;
GRANT SELECT (claim_id, claim_number, policy_id, loss_date, reported_date, cause, status, reserve) ON claims TO claims_handler;
CREATE POLICY claims_handler_claims ON claims FOR SELECT TO claims_handler USING (true);
GRANT SELECT (claim_id, claim_number, policy_id, loss_date, reported_date, cause, status, reserve) ON claims TO analyst;
CREATE POLICY analyst_claims ON claims FOR SELECT TO analyst USING (cause <> 'medical');
GRANT SELECT (claim_id, claim_number, policy_id, loss_date, reported_date, status, reserve) ON claims TO finance_reporting;
CREATE POLICY finance_reporting_claims ON claims FOR SELECT TO finance_reporting USING (true);
ALTER TABLE claim_payments ENABLE ROW LEVEL SECURITY;
GRANT SELECT (payment_id, claim_id, paid_on, amount) ON claim_payments TO claims_handler;
CREATE POLICY claims_handler_claim_payments ON claim_payments FOR SELECT TO claims_handler USING (true);
GRANT SELECT (payment_id, claim_id, paid_on, amount) ON claim_payments TO analyst;
CREATE POLICY analyst_claim_payments ON claim_payments FOR SELECT TO analyst USING (true);
GRANT SELECT (payment_id, claim_id, paid_on, amount) ON claim_payments TO finance_reporting;
CREATE POLICY finance_reporting_claim_payments ON claim_payments FOR SELECT TO finance_reporting USING (true);
ALTER TABLE claim_documents ENABLE ROW LEVEL SECURITY;
GRANT SELECT (document_id, claim_id, doc) ON claim_documents TO claims_handler;
CREATE POLICY claims_handler_claim_documents ON claim_documents FOR SELECT TO claims_handler USING (true);
GRANT SELECT (document_id, claim_id) ON claim_documents TO analyst;
CREATE POLICY analyst_claim_documents ON claim_documents FOR SELECT TO analyst USING (true);
ALTER TABLE customers ENABLE ROW LEVEL SECURITY;
GRANT SELECT (customer_id, region_id, name, birth_date, customer_since, email) ON customers TO claims_handler;
CREATE POLICY claims_handler_customers ON customers FOR SELECT TO claims_handler USING (true);
CREATE VIEW customers_masked AS SELECT customer_id, region_id, LEFT(name, 1) || '.' AS name, EXTRACT(YEAR FROM birth_date)::int AS birth_year FROM customers;
GRANT SELECT ON customers_masked TO analyst;
The same queries as each role, on PostgreSQL in your browser

PostgreSQL starts in this browser when you press Run.

Each query as each role: what PostgreSQL returned in your browser, and what the lab expects
RoleQueryPGliteExpectedSame
Claims handler Count the claims 60
Claims handler Count the medical claims 4
Claims handler Read an adjuster's document Readable
Claims handler Read the first customer's name Jan Smit
Claims handler Read the first customer through the masked view Permission denied
Analyst Count the claims 56
Analyst Count the medical claims 0
Analyst Read an adjuster's document Permission denied
Analyst Read the first customer's name Permission denied
Analyst Read the first customer through the masked view J. · 2000
Finance Count the claims 60
Finance Count the medical claims Permission denied
Finance Read an adjuster's document Permission denied
Finance Read the first customer's name Permission denied
Finance Read the first customer through the masked view Permission denied

A table of fifteen checks: five queries (count the claims, count the medical claims, read a document, read a customer's name, read a customer through the masked view), each run as the claims handler, the analyst and finance. For each, what PostgreSQL returned in your browser and what the lab expects from the policy. Press Run to start PostgreSQL in the browser; each query runs as its role, and the role is reset straight after.

What each role gets from each query (computed from the policy and the seed)
QueryClaims handlerAnalystFinance
Count the claims605660
Count the medical claims40Permission denied
Read an adjuster's documentReadablePermission deniedPermission denied
Read the first customer's nameJan SmitPermission deniedPermission denied
Read the first customer through the masked viewPermission deniedJ. · 2000Permission denied
Try this In the Retrieval workbench, ask about the injuries on a claim as the claims handler, then as the analyst: the same classification and roles decide what an AI assistant may quote.

Why it matters for Alex

The board wants analysts and an AI assistant on the claims data. Alex has to show, not promise, that no analyst can read a medical note, and that a claim deleted at the end of its retention is gone from the warehouse and the reserving workbooks too. Your organisation's legal and regulatory duties decide the levels, the retention periods and who must be told when something goes wrong; the data protection officer and the legal team set them, and this design makes them enforceable.

The rules behind these controls For an insurer in the EU, these controls are not only good practice. The rules below are summarised, not quoted, so check each against its source with your legal team before you rely on it; this is not legal advice.
The rules behind the controls: what each asks of an insurer, and where it is written
ControlWhat it asksSource
Health details are a special categoryProcessing data concerning health is prohibited unless one of the conditions listed in Article 9(2) applies; data concerning health is personal data about a person's physical or mental health that reveals information about their health status.GDPR (Regulation (EU) 2016/679), Article 9(1) and (2); definition in Article 4(15)
Only what each role needsPersonal data must be adequate, relevant and limited to what is necessary for the purposes it is processed for (data minimisation).GDPR, Article 5(1)(c)
Protection by defaultBy default, only the personal data necessary for each specific purpose is processed, and it is not made accessible to an indefinite number of people without the person's intervention.GDPR, Article 25(2)
Security of processingAppropriate technical and organisational measures, including as appropriate pseudonymisation and encryption, and the ability to ensure the ongoing confidentiality of processing systems.GDPR, Article 32(1)(a) and (b)
Masked data is still personal dataPseudonymised data that can be attributed to a person with additional information is still personal data; only anonymous data falls outside the regulation.GDPR, Article 4(5) and Recital 26
Kept no longer than necessaryPersonal data is kept in a form that identifies people for no longer than is necessary for the purposes it is processed for (storage limitation).GDPR, Article 5(1)(e)
Erasure on requestA person can have their personal data erased without undue delay when a ground in Article 17(1) applies, unless an exception in Article 17(3) applies, such as a legal obligation or legal claims.GDPR, Article 17(1) and (3)(b) and (e)
A record of the processingThe controller keeps a record of processing activities, with the categories of personal data and, where possible, the time limits for erasing them.GDPR, Article 30(1)(c) and (f)
Telling the regulator about a breachA personal data breach is notified to the supervisory authority without undue delay and, where feasible, within 72 hours of becoming aware of it, unless it is unlikely to result in a risk to people.GDPR, Article 33(1)
A data protection officerA data protection officer is designated when the core activities consist of processing special categories of data on a large scale.GDPR, Article 37(1)(c)
Access limited to approved functionsInsurers limit physical and logical access to information and ICT assets to what is required for legitimate and approved functions and activities, with policies for access rights.DORA (Regulation (EU) 2022/2554), Article 9(4)(c); insurers are in scope under Article 2(1)(n); it applies from 17 January 2025 (Article 64)
Data protected at rest, in use and in transitICT security policies maintain high standards of availability, authenticity, integrity and confidentiality of data, whether at rest, in use or in transit.DORA, Article 9(2)

Where it goes wrong

  • Classified in the source, open in the copy. The claims system is locked down; the warehouse copy and the export in a shared folder are not.
  • Controls in the report. Hiding a column in a dashboard while anyone with a query tool reads the table underneath.
  • Access person by person. Grants to named people pile up and nobody removes them. Grant to roles, and put people in roles.
  • Deleted in one place. A claim deleted in the claims system lives on in the warehouse, the reserving workbook and last year's backup.

Exercises

The lab checks each one against facts written down in advance, so any answer the brief allows passes. A pass is kept in this browser.

Classify the columns

Choose the classification of each column under Harbour Mutual's scheme.

claim_documents.doc: An adjuster's notes on a claim, injuries included
claims.cause: What caused the loss; for a travel claim it can be "medical"
claims.reserve: What the insurer still expects to pay
claim_payments.amount: A payment made on a claim
customers.name: The customer's name
customers.birth_date: The customer's date of birth
customers.email: The customer's email address
claims.status: Open, closed or rejected
products.name: The product's name, as on the website

Follow the classification

Each column below is a copy, or is computed, further down the lineage. Choose the classification it carries.

cause (stg_claims, Data warehouse)
reported_quarter (fact_claim, Data warehouse)
claims_by_cause (Board semantic model, Board reporting)
loss_ratio (Board semantic model, Board reporting)
earned_premium (fact_premium, Data warehouse)
ibnr (Reserving triangle, Reserving workbooks)

Who sees what?

Each query runs as one role under the policy above. Choose what the role gets back. The chapter's run on PostgreSQL shows the same.

Claims handler: Count the medical claims
Analyst: Count the claims
Analyst: Count the medical claims
Finance: Count the medical claims
Analyst: Read an adjuster's document
Analyst: Read the first customer through the masked view
Claims handler: Read the first customer's name

On Azure

Checked against Microsoft's documentation on 18 October 2026.

On Azure, classification and its controls come from three places:

  • Microsoft Purview classifies columns when it scans a source (built-in and custom classifications, such as a person's name), and sensitivity labels from Microsoft Purview Information Protection mark files, Power BI and Microsoft Fabric items; a label travels with the data into downstream Fabric items and exports.
  • Microsoft Entra groups are the roles: one group for claims handlers, one for analysts, one for finance, granted in the database and in the lakehouse.
  • The database enforces it: row-level security and column permissions in Azure SQL and in Fabric's SQL endpoints, dynamic data masking in Azure SQL, Power BI row-level security for reports, and row filters and column masks in Azure Databricks' Unity Catalog.

Retention and deletion need both: a lifecycle rule on the storage, and a deletion job that walks the lineage to every copy.

Take it to work

Classification and access matrix

Write down how sensitive each dataset is and what each role may read of it.

Levels

  • Your classification levels, with one example each
  • Who decides a column's level?

Columns

  • Each sensitive column, its level, and the rows that are more sensitive than the rest

Roles

  • Each role, its group, and what it may read: tables, rows, columns, masked values

Retention and deletion

  • How long each kind of data is kept, and who set it
  • Every copy a deletion must reach

Checks

  • The queries that prove each role sees what it may, and when they run

Tools in this chapter

  • Retrieval workbench · Chunk and index Harbour Mutual's documents with their access rights, and ask questions as different roles.
  • Contract editor · Write a data contract, validate it, and check whether a proposed change breaks its consumers.

Terms taught here: ClassificationPersonal dataMaskingRow-level security

An unhandled error has occurred. Reload 🗙

Reconnecting…

Your connection to the Cloud Data Architecture Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.