Unity Catalog (how security works)
- Securables: metastore → catalogs → schemas → tables/views/functions/materialized views → volumes/external locations → credentials. Privileges inherit downward (grant at catalog ⇒ applies to all current/future objects in its schemas). (Microsoft Learn, Databricks Documentation)
How to secure tables (and “hide” them)
- Grant only what’s needed on the parents
If a user doesn’t haveUSE CATALOG(on the catalog) andUSE SCHEMA(on the schema), they can’t even see the objects inside. Grant these only to people who should browse that area. (Microsoft Learn) - Grant table-level access explicitly
GiveSELECTto read,MODIFYto write (append/update/delete), and keepMANAGElimited to data stewards. Example policy-by-group:
-- grant browse-only on the container
GRANT USE CATALOG ON CATALOG finance TO `analyst_ro`;
GRANT USE SCHEMA ON SCHEMA finance.curated TO `analyst_ro`;
-- allow read but not write
GRANT SELECT ON ALL TABLES IN SCHEMA finance.curated TO `analyst_ro`;
-- writers (still need USE privileges above)
GRANT MODIFY ON ALL TABLES IN SCHEMA finance.curated TO `etl_rw`;
(You can also grant at catalog level to cascade.) (Databricks Documentation)
- To “hide” tables
Don’t grantUSE CATALOG/USE SCHEMAon the parents. Note: in many workspaces themaincatalog is browseable by default—use your own catalogs and controlUSEprecisely. (Microsoft Learn) - Fine-grained (when users share a schema):
- Row filters and column masks (per table) to enforce row/column-level security.
- Dynamic views for read-only, filtered projections. (Databricks Documentation)
What permissions exist? (most-used, by object)
- Catalog:
USE CATALOG,CREATE SCHEMA, plus cascade grants likeSELECT,MODIFY,EXECUTE,MANAGEif given at catalog scope. - Schema:
USE SCHEMA,CREATE TABLE/VIEW/FUNCTION/MATERIALIZED VIEW/VOLUME,SELECT,MODIFY,EXECUTE,MANAGE. - Table/View/MV:
SELECT,MODIFY,REFRESH(MV),MANAGE. - Function/Procedure/Model:
EXECUTE. - Volume:
READ VOLUME,WRITE VOLUME.
(Full matrix lives in docs.) (Microsoft Learn)
What is MANAGE?
Lets a principal view & change privileges, transfer ownership, drop/rename the object. It’s not included in ALL PRIVILEGES, and holders still need USE CATALOG/USE SCHEMA to reach the object. Think “privilege admin for this object.” (Databricks Documentation)
How to manage privileges on objects
- SQL (works everywhere)
-- show, grant, revoke
SHOW GRANTS ON TABLE finance.curated.sales;
GRANT SELECT ON TABLE finance.curated.sales TO `analyst_ro`;
REVOKE SELECT ON TABLE finance.curated.sales FROM `analyst_ro`;
- Catalog Explorer (UI): Data → pick object → Permissions tab → Grant/Revoke.
- CLI and Terraform (
databricks_grant) for automation / IaC. (Microsoft Learn, Terraform Registry)
What is Data Access Control in Databricks?
Three systems, used together:
- Unity Catalog for data objects (tables/views/functions/volumes/etc.).
- Workspace ACLs for notebooks, repos, clusters/SQL warehouses, etc.
- Account RBAC for account-level resources (users/groups/SPs, workspaces). (Databricks Documentation, Microsoft Learn)
Different ways to provide privileges in UC
- SQL GRANT/REVOKE, Catalog Explorer (UI), Databricks CLI, Terraform. Use inheritance to keep policies DRY (grant at catalog/schema when possible). (Databricks Documentation, Microsoft Learn)
Securing files behind tables
- Use storage credentials + external locations for governed access to cloud storage, then build tables/volumes on top.
- For files (non-tabular), use Volumes with
READ VOLUME/WRITE VOLUME. (Microsoft Learn)
Row/column-level security (copy-paste starters)
Column mask (show full SSN only to auditors):
CREATE OR REPLACE FUNCTION governance.mask_ssn(ssn STRING) RETURNS STRING
RETURN CASE WHEN is_account_group_member('auditors') THEN ssn ELSE concat('XXX-XX-', right(ssn,4)) END;
ALTER TABLE finance.curated.customers
ALTER COLUMN ssn SET MASK governance.mask_ssn;
Row filter (only see own region):
CREATE OR REPLACE FUNCTION governance.row_is_my_region(rgn STRING) RETURNS BOOLEAN
RETURN rgn = current_user_region(); -- your UDF/lookup
ALTER TABLE finance.curated.orders
SET ROW FILTER governance.row_is_my_region ON (region);
Docs include ABAC-based (tag) policies if you prefer central governance. (Databricks Documentation)
End-to-end “secure by default” checklist
- Model data: catalogs per domain/env; schemas for bronze/silver/gold.
- Least privilege: grant
USEonly where browsing is allowed;SELECT/MODIFYonly to the right groups;MANAGEto stewards. (Microsoft Learn) - Govern files: external locations + volumes; avoid direct keys on clusters. (Microsoft Learn)
- Fine-grained controls: row filters, masks, or dynamic views. (Databricks Documentation)
- Automate via Terraform/CLI; audit with system tables & lineage (Catalog Explorer). (Terraform Registry)
Category: