Blog
Sep 20, 2026 - 12 MIN READ
Data Governance on Databricks: A Unity Catalog Runbook

Data Governance on Databricks: A Unity Catalog Runbook

A step-by-step model for governing a Databricks lakehouse with Unity Catalog: schemas as the governance unit, governed tags, three-tier roles from Entra ID, tag-driven row filters and column masks, service principals, and governance as code.

Radek Řezáč

Radek Řezáč

Governance on a lakehouse fails in two typical ways: rights are scattered across BI tools, notebooks and ad-hoc grants, or the model is so manual that every new user or table needs an engineer. This article describes a model that avoids both. Every access right and every protection is defined once, in Unity Catalog, deployed as code, and switched on by tags. It is based on a runbook written for a finance data platform migrating from SQL Server and SSAS to Databricks; the names here are generic.

Ten Rules

  1. One rule book. Every access right and protection is defined once, in Unity Catalog — never in the BI tool, a notebook or an application.
  2. Business sees Gold only. Bronze and Silver are engineering layers. Business users read certified views of their Gold domain schema.
  3. The schema is the unit. Each schema has one owner, one writing service principal and one rule for who may read it.
  4. Tags carry the meaning. Layer, source, domain, classification, personal data and row scope are governed tags.
  5. Tags switch protection on. A column tagged as personal is masked; a table tagged for row scope is filtered — by one policy per rule.
  6. People come from Entra ID. No local accounts; SSO with MFA.
  7. Roles, not people, get rights. Users join a functional role; rights go only to access roles; persona roles join the two.
  8. Business owners decide. Each Gold domain has a business owner who approves who joins its roles and which rows they see.
  9. Service principals write, people read. In production only service principals write data.
  10. Everything as code. Grants, tags, policies and memberships come from Git; anything else is drift.

The Namespace

One catalog per environment (dev, test, prod), each bound to its own workspace. Inside, Bronze and Silver are named after the source system, Gold after the business domain:

LayerSchemaHoldsWho can see it
Bronzeerp_bronzeraw copy of the sourceengineers only
Silvererp_silvercleansed, conformed dataengineers only
Goldfinance_golddimensions, facts, metric views, certified serving viewsbusiness users, through certified views
Sharedshared, control, dqcommon functions, run control and entitlements, data-quality resultsengineers and operators

When a second source arrives, it adds crm_bronze and crm_silver and feeds the same finance_gold. Schemas are created and owned by the CI service principal, so a running job can never re-grant, drop or untag an object.

CREATE SCHEMA IF NOT EXISTS erp_bronze   COMMENT 'Source raw landing, append-only';
CREATE SCHEMA IF NOT EXISTS erp_silver   COMMENT 'Source cleansed and conformed';
CREATE SCHEMA IF NOT EXISTS finance_gold COMMENT 'Dimensions, facts, certified serving views';

ALTER SCHEMA erp_bronze   SET TAGS ('layer' = 'bronze', 'source' = 'erp');
ALTER SCHEMA erp_silver   SET TAGS ('layer' = 'silver', 'source' = 'erp');
ALTER SCHEMA finance_gold SET TAGS ('layer' = 'gold', 'business_domain' = 'finance');

Because the meaning sits in tags, grant generation, policy scope and audit queries never have to parse a schema name.

Governed Tags

All tag keys are governed tags: account-level tag policies with closed value lists. Only the CI service principal and the data governance steward hold ASSIGN, so a free-text value or an unauthorised assignment is rejected by the platform rather than found later in a review.

FamilyKeyValuesDrives
Namespacelayer, source, business_domainbronze / silver / gold …, one per source and domaingrants and policy scope
Classificationclassificationpublic, internal, confidential, restrictedcertification and audit
Classificationpersonal_datanone, personal, sensitive_personalcertification and masking
Policyrlsentitlementwhich tables are row-filtered
Policyentitlement_axislegal_entity, organisational_unit, …which column the row filter evaluates

One tag, one meaning. Classifying a column as personal is what masks it — there is no second "mask me" tag to forget. Tags are part of the DDL change that creates the column, so no window exists in which a personal column is live but unmasked.

Identities: Three Ways to Bring Entra ID Users In

What has to be decided is where the functional role lives and who changes a membership:

Automatic identity managementEntra ID SCIMDatabricks-managed groups
VerdictRecommendedFallbackDev or a dated interim only
Functional role lives inEntra IDEntra ID, copiedDatabricks
Nested Entra groupsyesnon/a
Change takes effectnext sign-innext provisioning cycle (~40 min)when someone acts
Leaverloses access automaticallydeactivated at next cyclestays until removed

Rules that hold for every option:

  • Users, groups and service principals exist at the account level only — no workspace-local groups.
  • Workspace entitlements are assigned per persona group, never per user; cluster creation is never granted.
  • People use SQL warehouses, serverless or standard-access-mode compute only — all of them enforce row filters and masks.
  • Personal access tokens are prohibited: engineers use OAuth U2M, pipelines use service principals with OAuth M2M.

The Three-Tier Role Model

Users are members only of functional roles; privileges are granted only to access roles; persona roles join the two.

TierExampleOwnerPurpose
Functional roledp-fr-finance-controller-northbusiness owner / IAMwho the person is in the organisation
Persona roledp-prod-pr-finance-consumerdata platformone job profile
Access roledp-prod-ar-finance-gold-servedata platformone schema × one privilege level

An organisation change is one membership change; a new schema is one access role added to the personas that need it. Grants stay few and stable. Access-role levels are read (USE SCHEMA + SELECT), write (+ MODIFY, dev and test only), serve (SELECT on certified objects only) and execute, plus two exemption roles: pii-unmasked and unrestricted.

The mapping lives in a reviewed file, so adding a team is a pull request, not a console change:

# governance/personas.yml - functional -> persona -> access mapping
access_roles:
  erp-silver-read:      {envs: [dev, test, prod]}
  finance-gold-write:   {envs: [dev, test]}
  finance-gold-serve:   {envs: [dev, test, prod]}
  shared-execute:       {envs: [dev, test, prod]}

personas:
  finance-consumer:
    access: [finance-gold-serve, shared-execute]
    functional: [dp-fr-finance-controller-north, dp-fr-finance-controller-south]
  finance-engineer:
    access: [erp-silver-read, finance-gold-write, shared-execute]
    functional: [dp-fr-analytics-engineer]

A small script built on the Databricks SDK creates the persona and access groups, nests access ← persona ← functional, and assigns personas to the workspace. It runs in the CI/CD pipeline and is re-runnable.

Grants Generated From Tags

Grants go to access roles and workload service principals only, generated from the schema tags — a new source schema gets its grants by being tagged, not by new grant code.

GRANT USE CATALOG ON CATALOG `${catalog}` TO `dp-${env}-ar-finance-gold-serve`;
GRANT USE SCHEMA ON SCHEMA finance_gold   TO `dp-${env}-ar-finance-gold-serve`;
GRANT SELECT ON TABLE finance_gold.vw_profit_and_loss TO `dp-${env}-ar-finance-gold-serve`;

GRANT USE SCHEMA, SELECT         ON SCHEMA erp_silver   TO `${sp_finance_gold}`;
GRANT USE SCHEMA, SELECT, MODIFY ON SCHEMA finance_gold TO `${sp_finance_gold}`;

Binding consequences:

  • No human group holds MODIFY in production.
  • Consumers hold no grant on any Bronze or Silver schema. A request for one means a serving view is missing.
  • A consumer never receives schema-wide SELECT on Gold — only SELECT on named, certified objects.

Service Principals

One workload service principal per source × layer function — ingest, transform, Gold build — so the blast radius of a defect equals the schema boundary. A shared per-layer principal would let a bug in one source's ingest write another source's Bronze.

  • DDL by CI, DML by workload SP. Workload principals hold MODIFY / SELECT but are never owners.
  • Every job runs as its service principal via run_as in the bundle; a personal identity never runs a production job.
  • Secrets are scoped to the one principal that needs them (for example, only the ingest SP can read the source database credentials).
  • Workload SPs are exempt from row filters and masks, because builds must read complete data — listed by name in every policy's EXCEPT clause, never implied by ownership.

Row-Level Security From Tags

One ABAC row-filter policy per entitlement axis, defined once on the Gold schema. Row scope is data, not code: an entitlement table holds one row per functional role and key, loaded with a MERGE from a reviewed CSV whose required approver is the business owner.

CREATE OR REPLACE FUNCTION shared.fn_rls_legal_entity(legal_entity_key STRING)
RETURNS BOOLEAN
RETURN EXISTS (
  SELECT 1 FROM control.entitlements_legal_entity e
  WHERE is_account_group_member(e.functional_role)
    AND e.effect = 'allow' AND (e.key_value = legal_entity_key OR e.key_value = '*')
    AND current_date() BETWEEN e.valid_from AND coalesce(e.valid_to, DATE'9999-12-31')
) AND NOT EXISTS (
  SELECT 1 FROM control.entitlements_legal_entity e
  WHERE is_account_group_member(e.functional_role)
    AND e.effect = 'deny' AND e.key_value = legal_entity_key
    AND current_date() BETWEEN e.valid_from AND coalesce(e.valid_to, DATE'9999-12-31')
);

CREATE OR REPLACE POLICY rls_legal_entity
ON SCHEMA finance_gold
ROW FILTER shared.fn_rls_legal_entity
TO `account users`
EXCEPT `dp-${env}-ar-finance-unrestricted`, `${sp_finance_gold}`
FOR TABLES
WHEN has_tag_value('rls', 'entitlement')
MATCH COLUMNS has_tag_value('entitlement_axis', 'legal_entity') AS k
USING COLUMNS (k);

Rules that always hold:

  • Precedence: unrestricted override → explicit deny → explicit allow → default deny. A tagged table with no matching entitlement row returns nothing.
  • Totals by construction: the filter removes rows before aggregation, so every Gold aggregate, metric view and dashboard total covers only permitted rows.
  • The policy sits on the table; the user reads the view. A row filter cannot be attached to a view — views read the filtered table under the querying user.
  • Validity dates matter: a row past its valid_to stops granting access without a deployment.

When migrating from SSAS, the rules are converted, not invented: a cube role's Windows group becomes a functional role, AllowedSet / DeniedSet become allow / deny rows, and dynamic UserName() security becomes current_user() against the same entitlement table.

If tag-driven policies are not yet available on your runtime, the same tags can generate one ALTER TABLE … SET ROW FILTER per tagged table — the same model with more statements, and the exemptions moved into a wrapper function.

Column Masking From Tags

A mask policy on the catalog matches columns by classification tag. The function only masks; the policy's EXCEPT list decides who sees clear values.

CREATE OR REPLACE FUNCTION shared.fn_mask_personal(v STRING) RETURNS STRING
RETURN CASE WHEN v IS NULL THEN NULL ELSE '***' END;

CREATE OR REPLACE POLICY mask_personal
ON CATALOG `${catalog}`
COLUMN MASK shared.fn_mask_personal
TO `account users`
EXCEPT `dp-${env}-ar-pii-unmasked`, `${sp_erp_ingest}`, `${sp_erp_transform}`, `${sp_finance_gold}`
FOR TABLES
MATCH COLUMNS has_tag_value('personal_data', 'personal') OR has_tag_value('personal_data', 'sensitive_personal') AS c
ON COLUMN c;

Because the policy is on the catalog, it covers Bronze, Silver, Gold and data-quality quarantine alike — an engineer reading production Silver sees personal columns masked exactly as a consumer does in Gold. Deploy the mask policy before the first personal column lands.

Serving BI Tools Correctly

The BI storage mode decides whose scope applies:

How the BI tool readsWhose scope appliesRequirement
Live connectionthe viewer's own, on every queryper-user OAuth with Entra ID — never a shared technical account
Extractthe refresh principal's, once at refreshone extract per entitlement scope; the extract principal is entitled, not exempt

A Gold object is published only after a certification gate: business description, owners and steward recorded, the full classification tag set (including personal_data on every column), row-scope tags where needed, a freshness expectation, DQ expectations and a recorded storage mode. Only then is SELECT generated for the serve role.

Operating It: Governance as Code

ControlRule
Everything in Gitgroups, memberships, grants, ownership, tags, entitlement rows, functions, policies
DeploymentCI/CD under the CI service principal, promoted dev → test → prod
Test = prodtest carries the same policies and grants, so the model is proven before cutover
Daily drift checkreports anything present but not in Git, any user directly in a persona or access role, any grant to a persona
Break-glassincident only, with ticket, owner and expiry; the equivalent change is committed before closure
Auditsystem tables (access, lineage) reviewed monthly by Security

Worked Example: A New Controller Joins

  1. The new controller requests access to finance reporting.
  2. The business owner adds them to dp-fr-finance-controller-north in Entra ID.
  3. At sign-in, the user appears in the Databricks account automatically.
  4. The functional role is already a member of the finance-consumer persona — in Git.
  5. The persona already holds finance-gold-serve → SELECT on certified views.
  6. The entitlement row for that functional role is already approved.
  7. The user opens the dashboard and sees their region's rows, with personal names masked.

No grant was typed, no engineer was involved, no BI filter was set up. When the controller leaves, disabling the Entra account removes everything.

Conclusion

The model rests on a few ideas: the schema is the governance unit, tags carry meaning and switch protection on, rights flow through three role tiers, row scope is approved data owned by the business, and everything is deployed as code with drift detection. The result is a platform where onboarding a user is a group membership, onboarding a table is a set of tags, and every protection is provable from Git.

Radek Řezáč • Senior Lead Data Engineer • © 2026