Home / Databricks on Azure

Databricks on AzureChecklistIntermediate

Azure Databricks workspace admin settings hardening checklist: tokens, result downloads, notebook export, legacy DBFS and verbose audit

Review and lock down the Azure Databricks workspace settings that control data exfiltration, tokens and legacy access, with CLI commands to read, change and audit each one.

Deepak Bhardwaj7 min read

Applies toAzure Databricks (Premium tier), Databricks CLI 0.2xx, Workspace Conf API 2.0 and Settings API, Terraform databricks provider

When to use this checklist

Use it when a new workspace goes to production, after a security review flags "default settings", or when someone asks how a user downloaded a full table to a laptop. Most workspace security settings are on by default because they are convenient. Each one below can be read from the CLI, changed safely and tracked in the audit log.

Run everything as a workspace admin with the Databricks CLI configured for the target workspace:

databricks auth describe --profile prod
databricks current-user me --profile prod

Warning

Several of these settings change what users and jobs can do immediately. Disabling notebook export, result downloads or legacy DBFS can break a team's daily workflow or a job that depends on it. Announce the change, apply it to a test workspace first and keep the rollback command ready.

Step 1: capture the current state

Two APIs hold these settings. Older toggles live in workspace-conf as string key/value pairs. Newer ones are typed objects under settings.

# Workspace-conf keys (comma-separated). Values come back as strings.
databricks workspace-conf get-status \
  enableTokensConfig,maxTokenLifetimeDays,enableIpAccessLists,enableResultsDownloading,enableExportNotebook,enableNotebookTableClipboard,enableUploadDataUis,enableWebTerminal,enableDbfsFileBrowser,enableVerboseAuditLogs \
  --profile prod

# Settings API objects
databricks settings enable-results-downloading get-enable-results-downloading --profile prod
databricks settings enable-export-notebook get-enable-export-notebook --profile prod
databricks settings restrict-workspace-admins get --profile prod
databricks settings disable-legacy-dbfs get --profile prod
databricks settings disable-legacy-access get --profile prod

Key names vary between releases, and some keys move from workspace-conf to the Settings API over time. If a key returns empty or an error, check the admin settings page and databricks settings --help for your CLI version. Save the output as your baseline before you change anything.

Step 2: work through the checklist

# Setting Risk if left default Recommended Where
1 Personal access tokens Long-lived tokens leak in scripts and Git Limit who can create; set a max lifetime enableTokensConfig, maxTokenLifetimeDays
2 Restrict workspace admins Admins can mint tokens or set jobs to run as other users RESTRICT_TOKENS_AND_JOB_RUN_AS settings restrict-workspace-admins
3 Notebook results download Full result sets saved to laptops Off for sensitive workspaces settings enable-results-downloading
4 SQL results download Same, from the SQL editor and dashboards Off for sensitive workspaces settings sql-results-download
5 Results table clipboard Copy-paste of tabular data Off where download is off settings enable-notebook-table-clipboard
6 Notebook export Code and embedded output leave the workspace Off if code is in Git anyway settings enable-export-notebook
7 Upload data UIs Unmanaged files land in the workspace Decide per workspace enableUploadDataUis
8 Web terminal Shell on the driver Off unless an operator team needs it enableWebTerminal
9 DBFS file browser Browsing legacy DBFS root data Off enableDbfsFileBrowser
10 Legacy DBFS / legacy access Mounts and DBFS root bypass Unity Catalog Disable once migrated settings disable-legacy-dbfs, disable-legacy-access
11 IP access lists UI and API reachable from anywhere Enabled with an allow list enableIpAccessLists
12 Verbose audit logs Notebook commands not audited On enableVerboseAuditLogs

Tokens (items 1 and 2)

Set a maximum lifetime for new tokens and list the old ones that exceed it:

databricks workspace-conf set-status --json '{"maxTokenLifetimeDays": "90"}' --profile prod

# Who holds tokens, and since when
databricks token-management list --output json --profile prod \
  | jq -r '.[] | [.created_by_username, .comment, (.creation_time/1000|todate), (if .expiry_time == -1 then "never" else (.expiry_time/1000|todate) end)] | @tsv'

The lifetime limit applies to new tokens. Tokens that never expire keep working until you revoke them with databricks token-management delete <token-id>. Move automation to OAuth service principals before you revoke anything.

Restrict workspace admins so admin rights can't be used to impersonate service principals:

databricks settings restrict-workspace-admins update --profile prod \
  --json '{"restrict_workspace_admins": {"status": "RESTRICT_TOKENS_AND_JOB_RUN_AS"}}'

Data download and export (items 3 to 6)

databricks settings enable-results-downloading patch-enable-results-downloading --profile prod \
  --json '{"allow_missing": true, "setting": {"enabled": false}}'

databricks settings enable-export-notebook patch-enable-export-notebook --profile prod \
  --json '{"allow_missing": true, "setting": {"enabled": false}}'

For the SQL results download and table clipboard settings, run databricks settings sql-results-download --help and databricks settings enable-notebook-table-clipboard --help to get the exact subcommand names for your CLI build, then apply the same pattern.

Tip

Turning off downloads doesn't stop people with SELECT from writing a table to a volume and downloading it from there. Pair these settings with Unity Catalog grants on volumes and external locations, or the control is cosmetic.

Legacy surfaces (items 7 to 10)

databricks workspace-conf set-status --profile prod \
  --json '{"enableWebTerminal": "false", "enableDbfsFileBrowser": "false"}'

Caution

Disabling legacy DBFS or legacy access stops mounts, DBFS root reads and Hive metastore access paths that older jobs still use. Before you change it, search job and notebook code for dbfs:/mnt, /dbfs/ and hive_metastore., and check system.access.audit for recent DBFS activity. Run databricks settings disable-legacy-dbfs --help for the update syntax.

Network and audit (items 11 and 12)

databricks workspace-conf set-status --json '{"enableVerboseAuditLogs": "true"}' --profile prod

Enable IP access lists only after you have created an allow list that includes your own address and every CI/CD and integration source.

Step 3: confirm who changed what

Every workspace-conf change is audited. Query the audit system table to see toggles over the last 30 days:

SELECT event_time,
       user_identity.email AS changed_by,
       action_name,
       request_params
FROM system.access.audit
WHERE service_name = 'workspace'
  AND action_name = 'workspaceConfEdit'
  AND event_date >= current_date() - INTERVAL 30 DAYS
ORDER BY event_time DESC;

request_params contains the key and the new value (workspaceConfKeys, workspaceConfValues). Settings API changes may be logged under a different service or action name depending on the release. If they don't show up here, filter the same table on the time of a known change and read service_name and action_name from the result.

Step 4: keep it in code

Manual toggles drift. Pin the workspace-conf keys in Terraform so a reapply restores them:

resource "databricks_workspace_conf" "hardening" {
  custom_config = {
    "enableTokensConfig"       = "true"
    "maxTokenLifetimeDays"     = "90"
    "enableIpAccessLists"      = "true"
    "enableResultsDownloading" = "false"
    "enableExportNotebook"     = "false"
    "enableWebTerminal"        = "false"
    "enableDbfsFileBrowser"    = "false"
    "enableVerboseAuditLogs"   = "true"
  }
}

The Terraform provider also has resources for some Settings API objects. Check the provider documentation for your version before you manage the same setting from both CLI scripts and Terraform.

Symptom, cause, fix after hardening

User report Setting responsible Fix
"Download button is gone" Results download off Expected; offer an approved export path (volume plus grants)
"Can't export my notebook" Notebook export off Use the Git folder; code should be in Git
CI pipeline gets 403 creating a token Token permissions or max lifetime Use an OAuth service principal; request a shorter lifetime
Old job fails on dbfs:/mnt/... Legacy DBFS disabled Move to a Unity Catalog volume or external location
Admin can't set a job to run as a service principal Restrict workspace admins Grant the admin the service principal user role on that service principal

Prevent it next time

  • Apply the same baseline to every new workspace from Terraform, not from the UI.
  • Diff the Step 1 output against the baseline monthly, or alert on workspaceConfEdit events.
  • Review token-management list each quarter and revoke tokens with no owner or no expiry.
  • Record every exception (for example, web terminal for the platform team) with an owner and a review date.