Databricks DE ยท Topic 8.4
Attribute-Based Access Control (ABAC)
Govern by attribute, not by table: tag data with governed tags, write one CREATE POLICY targeting the tag, and it applies automatically โ cascading through the catalog hierarchy. This deep dive walks the verified policy DDL.
governed tagsCREATE POLICYhas_tag_valuecascades
The one-liner
ABAC = governed tags on data + policies (CREATE POLICY โฆ ROW FILTER / COLUMN MASK) that target a tag via has_tag_value() and attach at catalog/schema/table level, applying automatically to any matching object. Define once, enforce everywhere.
๐ท๏ธ Analogy: instead of locking each cabinet (per-table masks from 8.3), you put a "CONFIDENTIAL" sticker on documents and write one rule: "mask anything tagged CONFIDENTIAL." Tag a new doc โ the rule covers it instantly.
โ ๏ธ ABAC DDL is evolving โ row-filter/column-mask policies are the core offering; GRANT policies are Beta. Verify current status in the docs.
Tag a column โ the policy fires automatically
โธ click "tag pii" on a column; the catalog policy masks it
ABAC policy on CATALOG prod: mask columns tagged pii unless user โ pii_readers
๐ catalog prod (policy attached)
๐ schema sales
๐ customers.name visibletag pii
๐ customers.ssn visibletag pii
๐ customers.email visibletag pii
Nothing tagged yet โ nothing masked.
2 ยท Column-mask policy (mask any tagged column)
CREATE FUNCTION prod.sales.redact_ssn(s STRING) RETURNS STRING
RETURN CASE WHEN is_account_group_member('pii_readers') THEN s ELSE '***-**-****' END;
CREATE POLICY redact_ssn_policy
ON SCHEMA prod.sales
COLUMN MASK prod.sales.redact_ssn
TO `account users`
FOR TABLES
MATCH COLUMNS has_tag_value('pii', 'ssn') AS ssn_col
ON COLUMN ssn_col; -- every pii=ssn column in the schema is masked
3 ยท Row-filter policy (hide rows by tag)
CREATE POLICY hide_eu_customers
ON SCHEMA prod.sales
ROW FILTER prod.sales.is_not_eu_address
TO `account users`
FOR TABLES
MATCH COLUMNS has_tag_value('pii', 'address') AS addr_col
USING COLUMNS (addr_col); -- the filter receives the tagged column
Match with has_tag('key') / has_tag_value('key','value'), combinable with AND/OR/NOT. Scope ON CATALOG, ON SCHEMA, or ON TABLE; a higher-level policy cascades to current & future matching objects.
4 ยท ABAC vs per-table (8.3) โ click each
Per-table (8.3)
ABAC (8.4)
Per-table row filters / column masks.
- Configure each table with ALTER TABLE
- New table โ configure again
- Fine for a few tables; doesn't scale
ABAC โ by tag, hierarchical.
- Define a policy once, targeting a tag
- Attach at catalog/schema โ cascades to matching objects
- Tag a new column โ auto-covered
| Per-table | ABAC |
| Defined | on each table | once, by tag |
| New table/column | configure again | auto-covered if tagged |
| Best for | a few tables | enterprise-wide |
Why it matters
- Per-table masks/filters don't scale to thousands of tables โ ABAC governs by tag, hierarchically; tag a new column
pii and the mask is already enforced.
- "Enforce PII masking across a whole catalog?" โ ABAC governed tags + policy.
๐ข Real-world use case: tag every PII column pii and set one column-mask policy on the prod catalog โ every current and future pii-tagged column is masked automatically, no per-table work.
Uses, edge cases & limitations
- Uses: org-wide PII masking, region/tenant row isolation by tag, consistent governance across large catalogs with minimal admin.
- Edge cases: governance is only as good as your tagging โ an untagged PII column won't be masked; mind policy precedence when multiple policies match.
- Limitation: built on row-filter/column-mask machinery (8.3), so those perf & time-travel/CLONE constraints apply; verify feature availability (e.g. GRANT policies are Beta); ABAC DDL is still evolving.
Common gotchas
- โ Relying on ABAC while data is untagged โ no tag, no protection.
- โ Re-doing per-table masks when a tag + policy covers all of them.
- โ Using ungoverned tags for policies โ ABAC matches governed tags.
- โ Assuming every ABAC feature is GA โ GRANT policies are Beta; confirm in docs.
- โ Ignoring policy overlap/precedence when multiple policies target an object.