A Databricks production deployment carries three independent authorisation surfaces, each of which must be configured before a Data Engineer Professional can claim a workload is secure.
How it works
- The first surface is the workspace object plane: notebooks, repos, queries, dashboards, clusters, cluster policies, instance pools, jobs, and SQL warehouses.
- The second is the Unity Catalog data plane: catalogs, schemas, tables, views, volumes, functions, models, and external locations.
- The third is the compute identity plane: service principals, personal access tokens (PATs), OAuth machine-to-machine clients, and secret scopes.
The exam questions in this study area almost always test whether you recognise that a grant on a data object is not sufficient if the workspace ACL on the notebook or job is wrong, or if the cluster the principal runs against has a policy that strips the access mode required by Unity Catalog.
Workspace object ACLs use a fixed five-level hierarchy on most object types: NO PERMISSIONS, CAN READ (or CAN VIEW), CAN RUN, CAN EDIT, and CAN MANAGE. The ACL is set per object and per principal (user, group, or service principal).
The permission semantics differ slightly by object kind: a notebook CAN RUN permits execution against any cluster the principal can attach to, while a job CAN MANAGE RUN permits triggering and cancelling without permitting edits to the job definition. Cluster ACLs include the special CAN ATTACH TO permission, distinct from CAN RESTART and CAN MANAGE.
Secret scope ACLs use a smaller set: READ, WRITE, and MANAGE, applied per scope, with secret-key-level granularity only available on Databricks-backed scopes through the secret REST API.
# Grant a workspace group CAN RUN on a notebook
databricks workspace-permissions update notebooks/2839472847 \
--json '{
"access_control_list": [
{"group_name": "data-eng-readers", "permission_level": "CAN_READ"},
{"group_name": "data-eng-runners", "permission_level": "CAN_RUN"}
]
}'
# Grant CAN ATTACH TO on a job cluster, the minimum for a principal
# to execute a notebook against shared compute
databricks clusters update-permissions 0719-082842-snail123 \
--json '{
"access_control_list": [
{"group_name": "data-eng-runners", "permission_level": "CAN_ATTACH_TO"}
]
}'
The Unity Catalog grant model layers on top of these workspace ACLs.
The privileges that govern data access are scoped to securables in a containment hierarchy:
- metastore contains catalogs
- catalogs contain schemas
- schemas contain tables, views, functions, volumes, and models
The privileges with the broadest practical use are USE CATALOG, USE SCHEMA, SELECT, MODIFY, READ FILES, WRITE FILES, EXECUTE, CREATE TABLE, CREATE VOLUME, CREATE FUNCTION, CREATE MATERIALIZED VIEW, MANAGE, and BROWSE.
The BROWSE privilege is the discovery-only grant: it lets a principal see that an object exists without permitting reads of its contents.
The EXECUTE privilege applies to UDFs and is required when a row filter or column mask attached to a table references a SQL function the querying principal cannot otherwise execute.
-- Grant a service principal read access on a specific schema, with discovery
-- across the parent catalog
GRANT USE CATALOG ON CATALOG prod_data TO `sp-analytics-ro`;
GRANT USE SCHEMA ON SCHEMA prod_data.silver TO `sp-analytics-ro`;
GRANT SELECT ON SCHEMA prod_data.silver TO `sp-analytics-ro`;
-- Allow lineage-style discovery of bronze without granting reads
GRANT USE CATALOG ON CATALOG prod_data TO `sp-analytics-ro`;
GRANT BROWSE ON SCHEMA prod_data.bronze TO `sp-analytics-ro`;
Cluster policies sit between identity and compute. A policy fixes or constrains the cluster attributes a principal can set when launching all-purpose, job, or SQL compute.
For governance, the highest-impact attributes are spark_version (lock to the LTS DBR you have validated), data_security_mode (force USER_ISOLATION or SINGLE_USER for Unity Catalog compatibility), instance_profile_arn and equivalents, init_scripts (disallow user-supplied init scripts in regulated environments), azure_attributes.spot_bid_max_price, and aws_attributes.first_on_demand. A policy with data_security_mode fixed to SINGLE_USER is required for workloads that need machine-learning libraries or Python-only access modes; the shared user-isolation mode is required for multi-user notebooks that touch Unity Catalog row filters or column masks.
{
"spark_version": {
"type": "fixed",
"value": "16.4.x-scala2.13",
"hidden": false
},
"data_security_mode": {
"type": "allowlist",
"values": ["USER_ISOLATION", "SINGLE_USER"],
"defaultValue": "USER_ISOLATION"
},
"init_scripts.*": {
"type": "forbidden"
},
"node_type_id": {
"type": "allowlist",
"values": ["i3.xlarge", "i3.2xlarge"]
},
"autotermination_minutes": {
"type": "range",
"minValue": 10,
"maxValue": 60,
"defaultValue": 20
}
}
Secrets management closes the third surface. Production code never embeds credentials.
The Databricks Secret API exposes secrets through dbutils.secrets.get(scope, key).
The returned value is redacted by the notebook output handler:
- any
printor display that contains the secret value is rewritten to[REDACTED]in the cell output, - in the driver log,
- and in the Spark UI.
Secret scopes are either Databricks-backed (server-side encryption with metastore-level access lists) or backed by Azure Key Vault for Azure deployments.
The Key-Vault-backed scope inherits the Key Vault access policies and is the right pattern when a centralised key vault is the source of truth for the organisation.
# Production credential lookup. Never assign to a print-safe variable.
jdbc_user = dbutils.secrets.get(scope="prod-jdbc", key="username")
jdbc_password = dbutils.secrets.get(scope="prod-jdbc", key="password")
(spark.read.format("jdbc")
.option("url", "jdbc:postgresql://prod-warehouse.internal:5432/sales")
.option("user", jdbc_user)
.option("password", jdbc_password)
.option("dbtable", "orders")
.load())
The personal access token surface is the historical break-glass control.
PATs bind to a single user identity and inherit that user's full permission set.
The account console controls whether a workspace permits PATs at all, sets maximum lifetimes, and enforces an allowlist of users who can mint them.
Comparison
Service principal OAuth M2M tokens replace PATs for headless workloads:
- they are not tied to a human user,
- they can be rotated centrally,
- they support per-token scope reduction.
CI/CD pipelines that deploy Databricks Asset Bundles use service principal OAuth, never a human PAT.
💡 Exam Trap: A workspace ACL grant of
CAN RUNon a notebook is not sufficient if the principal lacksUSE CATALOGandSELECTon the data assets the notebook reads. Unity Catalog evaluates data privileges independently and will deny the query even when the notebook executes.
💡 Exam Trap: Cluster policies enforce
data_security_mode. A policy that allowlistsLEGACY_PASSTHROUGHorNONEfor shared clusters breaks Unity Catalog row filter evaluation: onlyUSER_ISOLATION(shared) andSINGLE_USER(single-user) access modes interoperate with Unity Catalog row filters, column masks, and dynamic views.
⚠️ Anti-Pattern: Embedding service credentials in notebook source or in DABs
databricks.ymlplaintext. The right surface is a Databricks-backed secret scope or a Key-Vault-backed scope, referenced throughdbutils.secrets.getat runtime or through{{secrets/scope/key}}placeholders in job configurations.
📊 Limit: Workspace ACLs accept up to 5,000 access control entries per object. In practice this is far above what any well-governed workspace needs because grants flow through groups, not individuals.
🎯 Scenario: A platform team rolls out a new policy that forces all interactive clusters to
USER_ISOLATION. Three nightly Lakeflow Jobs running on shared all-purpose clusters start failing withOperation not supported in current access mode. The Decision Anchor: choose job-cluster execution under the policy-controlled job compute pool for scheduled work, and reserveSINGLE_USERclusters for ML notebooks that depend on libraries the user-isolation mode does not support.
Decision Anchor. Choose USER_ISOLATION access mode when the workload is multi-user SQL or Python that touches governed data and must honour row filters, column masks, and dynamic views. Choose SINGLE_USER access mode when the workload is owned by one principal (a service principal for a job, or a single user for an ML notebook) and requires libraries or APIs not supported under shared user isolation.
