Databricks Voices content is authored and published by Databricks employees that want to share their own individual learnings and Databricks knowledge. This content supplements the official Databricks product documentation found in other sections of this site.
White paper · Databricks on AWS
Protecting Databricks from stolen credentials without a VPN
A plain-language guide to layered defenses for teams that can’t yet require trusted-network access to their workspaces
Who this is for
Teams responsible for a Databricks deployment who can’t put every user and integration behind a corporate VPN, and who need practical ways to reduce the damage a stolen token can do.
How this guide is organized
-
The risk, why the usual fix is hard, the four layers of defense, and where to start. Everyone should read this part.
-
Each option’s owner, steps, how to check it worked, and what it doesn’t cover. For the people making the changes.
-
Commands, queries, the API scope review list, and an acceptance test checklist.
Adapted from the technical paper Reducing Databricks Credential Theft Risk Without a Corporate VPN (November 6, 2026). Product availability, tiers, and preview status are as of that date. Confirm current requirements in the linked documentation before making changes.
Part 1: Overview
What the risk is, why the usual fix is hard, and how four layers of controls reduce the risk when you can’t use it.
The risk: a stolen credential
A Databricks credential, such as a personal access token (PAT), works like a password for the Databricks APIs. Credentials leak from infected laptops, code repositories, build logs, and third-party tools. None of these routes requires a weakness in Databricks itself.
A stolen credential is dangerous when three things are true:
-
It still works. It hasn’t expired or been revoked.
-
It has useful permissions. It can read data, run code, or retrieve other secrets.
-
It works from anywhere. Databricks accepts it from the attacker’s own network.
PATs are a common example. Someone may complete multifactor authentication (MFA) once to create a token, but after that the token works on its own, with no further sign-in. Shorter lifetimes and narrower permissions address the first two conditions. Only a check on where the request comes from addresses the third.
The preferred fix, and why it’s often out of reach
The strongest control is context-based ingress control (CBI). CBI adds a second check when a request arrives: who is calling, from where, and what kind of request it is. If CBI only accepts requests from a trusted network, such as a corporate VPN, a stolen token presented from an attacker’s network is refused even though the token itself is valid.
Many organizations can’t require that today. Employees connect from home on changing residential IP addresses. Contractors use their own equipment. BI tools and partners connect from infrastructure the organization doesn’t control. A corporate VPN may exist for other applications without carrying Databricks traffic. Moving all of that onto a VPN means client rollout, routing and DNS changes, capacity planning, help-desk support, and partner coordination. That is an organizational project, not a Databricks setting.
Good to know
CBI itself doesn’t require a VPN. The obstacle is requiring a trusted network for all existing access at once. You can often apply CBI to a narrower slice first: production workloads, admin API calls, a few service principals, or one sensitive workspace. Layer B covers these patterns.
Check eligibility
Workspace CBI currently requires the Enterprise tier on AWS and GCP. Premium and AWS GovCloud support is expected by early 2027. Other controls have their own prerequisites.
Four layers of defense
If you can’t block untrusted networks outright, you can still make a stolen credential less useful. The controls in this guide fall into four layers. Each one acts at a different step of an attack, so they reinforce each other rather than overlap.
Figure 1. Where each layer interrupts an attack that uses a stolen credential.
Attack stage | Corresponding layer |
|---|---|
Step 1: A credential leaks | Layer A: Fewer, weaker credentials |
Step 2: It’s used from outside | Layer B: Narrower public access |
Step 3: It reaches your data | Layer C: Smaller blast radius |
Layer D: Detect, respond, maintain.
Notice misuse, shut off the affected access, and keep the other layers from drifting.
Layer A · Fewer, weaker credentials
Start here
Reduce how many reusable credentials exist, how long they last, and what they can call.
Layer B · Narrower public access
Pick what fits
Use CBI selectively so requests from the open internet can do less, without moving everyone onto a VPN.
Layer C · Smaller blast radius
Assume some credentials will be misused, and limit what they can reach.
Layer D · Detect, respond, maintain
Start here
Spot misuse, shut off the affected access, and keep controls from drifting over time.
Where to start
-
Start with A and D
Whatever your network plan, these apply to everyone and need no CBI.
-
Pick the B patterns that fit
They’re alternatives, not a checklist. Skip B if CBI isn’t available.
-
Use C for what matters most
Keep sensitive data and production away from broadly accessible workspaces.
To find the options most relevant to you, match your situation below.
If this describes your situation | Look at |
|---|---|
There are many personal access tokens, and some are old or have no clear owner | |
Pipelines or scheduled jobs outside Databricks store a Databricks token | |
People work in the browser from home and rarely need command-line or SQL tools on their laptops | |
People or tools need some remote API or SQL access, such as BI tools | B2: Only needed API types |
A hosted partner such as Power BI, Tableau Cloud, or dbt Cloud connects to Databricks | |
Engineers need occasional access to production | |
Sensitive data sits in the same workspace everyone uses | |
Notebooks or jobs hold passwords or keys for other systems | |
Many people have workspace admin rights | |
CBI isn’t available on your plan or region |
All options at a glance
A · Fewer, weaker credentials
Option | What it does | CBI |
|---|---|---|
People sign in with strong MFA, and their tools use short-lived OAuth instead of stored tokens | No | |
Pipelines prove who they are through their own platform, so no Databricks secret is stored in them | No | |
Only approved identities can use tokens, new tokens expire quickly, and old ones are revoked | No | |
Each token or secret can use only the API families it needs | No |
B · Narrower public access
Option | What it does | CBI |
|---|---|---|
Anyone can use the web interface from anywhere; programmatic access is limited to approved identities and sources | Yes | |
Remote callers can reach only the API families a workflow uses | Yes | |
A named partner platform gets access without opening API access to everyone | Yes | |
Sensitive access is off by default and granted for a set window when approved | Optional |
C · Smaller blast radius
Option | What it does | CBI |
|---|---|---|
Crown-jewel data and production jobs live in a separate, tighter workspace, with data bound to it | No | |
Each identity sees only the data it needs, and sensitive values are masked | No | |
Fewer identities can read passwords and keys for other systems | No | |
Code running in Databricks can only connect to approved destinations | No | |
Standing admin access is limited to people and automation that genuinely need it | No | |
Credentials pasted into notebook code are found, rotated, and moved to governed storage | No |
D · Detect, respond, maintain
Option | What it does | CBI |
|---|---|---|
Audit logs reveal unusual activity, and a tested process shuts off the affected access | No | |
Governance Hub checks every workspace daily against security best practices and ranks what to fix | No | |
Playbooks for a leaked credential or wider compromise are written and rehearsed | Optional |
A practical rollout order
A suggested sequence. Each step adds protection on its own, so you don’t need to finish them all before any of them help.
Know what you have
Name owners. Inventory credentials, public clients, sensitive data, and production identities. Confirm audit access and a recovery path.
Remove avoidable credentials
Pilot OAuth for people and keyless automation. Restrict who can use PATs, set a short maximum lifetime, and revoke the old ones.
Narrow authority
Apply credential scopes, cut unnecessary admins and data grants, reduce who can read stored secrets, and scan notebooks for embedded ones.
Apply the public-access pattern that fits
Pilot browser-only access, a short API allow list, or a partner exception. Don’t wait for a company-wide VPN project to finish.
Separate high-impact environments
Isolate sensitive catalogs and production identities, then add the strongest inbound and outbound restrictions available.
Test, respond, and maintain
Measure how long containment takes, review exceptions, and retest after every material change.
What these options can’t do
Together, these controls reduce the value and reach of a stolen credential. They don’t reproduce every protection of a trusted network boundary. Keep the remaining exposure written down, and keep moving toward stronger trusted-source restrictions where the business can support them.
-
Detection and response take time. Logs arrive with a delay, and deciding to act takes time too.
-
Allowing broad IP ranges isn’t a VPN. Residential provider ranges admit unrelated people and still miss roaming users.
-
Block lists only stop known sources. If you’re under attack and have a list of malicious addresses, attackers can rotate networks quickly and automatically. Block, but also revoke compromised credentials.
Key terms
-
Personal access token (PAT)
A long string that works like a password for Databricks APIs. Whoever holds it can act as its owner until it expires or is revoked.
-
OAuth
A sign-in method that issues short-lived tokens. U2M is for people signing in through a browser; M2M is for service principals.
-
Service principal
A non-human identity used by jobs, pipelines, and integrations.
-
SSO and MFA
Single sign-on through your identity provider, and a second sign-in factor such as a security key.
-
Workload identity federation
Lets an outside system, such as GitHub Actions, prove its identity to Databricks without a stored Databricks secret.
-
Context-based ingress control (CBI)
A Databricks network policy that accepts or refuses a request based on who is calling, from where, and what kind of request it is.
-
API scope
A named family of Databricks APIs, such as
sqlorsecrets, used to limit what a credential or caller can do. -
Dry-run mode
A policy setting that records what would be blocked without blocking it.
-
Workspace
A Databricks environment where people run notebooks, jobs, and queries.
-
Unity Catalog
The Databricks governance layer for data permissions, masking, workspace bindings, and governed secrets.
-
Egress
Outbound connections from Databricks compute to other systems.
-
System tables
Databricks-managed tables of audit and network events that you can query.
Part 2: The options in detail
Owners, steps, checks, and limits for each option. Commands and queries are collected in Part 3.
How each option is laid out
-
Summary and Why
What the option is and the risk it reduces. For everyone.
-
Steps
What the owner does, in order. For the person making the change.
-
Check it worked
A test that should succeed and one that should fail.
-
What it doesn’t cover
The exposure that remains. Worth reading before deciding the option is enough.
Before you change anything
-
Name the owners
Assign a workspace administrator, an identity owner, a data owner, and an incident-response owner. An account administrator manages CBI and serverless network policies.
-
Confirm eligibility
Check the tier, region, preview status, runtime, and Unity Catalog requirements for each control in its linked documentation. Don’t assume every control is included in every deployment.
-
List who connects
For each identity, record its business owner, workspace, client, required operations, source, and credential type. Include JDBC and ODBC, scheduled jobs, developer tools, model clients, partners, and rarely used recovery procedures. Use audit history as input, but don’t automatically approve everything that appears in a log.
-
Test safely
Use a non-production workspace and test identities you own. Record the configuration and a rollback plan before each change. Keep a tested admin recovery path that doesn’t depend on the user or credential you’re changing. Never paste token values into a notebook, query result, ticket, or shared document.
-
Test both ways
For every control, test something that should work and something that should fail. A setting being accepted proves only that it was saved, not that every access path is covered. Schedule disruptive production steps with the affected owners.
A · Fewer, weaker credentials
Layer A · No CBI needed · Start here
Every reusable credential is something that can be stolen. This layer reduces how many exist, how long they work, and what they can call.
A1: Strong sign-in and OAuth for people
People sign in through your identity provider with strong MFA, and their tools use OAuth instead of a stored personal access token.
Who: Identity administrator, workspace administrator
Needs CBI: No
Why it helps
With OAuth user-to-machine (U2M) authorization, the Databricks CLI and other supported tools get short-lived tokens through a browser sign-in. There’s no long-lived personal token to distribute for everyday interactive work.
Steps
-
Set up account single sign-on (SSO) with your identity provider using SAML or OIDC.
Use Test SSO before turning it on, and confirm your emergency-access procedure.
-
Require phishing-resistant MFA in the identity provider where supported, along with your normal device and sign-in policies.
These don’t replace restrictions on tokens that already exist.
-
Move one pilot user’s tools to OAuth.
For the CLI, sign in with a named profile through the browser (R1).
-
Make sure the tool isn’t still picking up an old stored PAT.
Once OAuth works, revoke the replaced PAT and delete local copies.
-
Repeat group by group, then restrict PAT use for people as described in A3.
A normal sign-in and a typical tool operation succeed. The retired PAT fails.
MFA doesn’t re-prompt for every API call made with a PAT or OAuth token. Browser sessions and locally stored OAuth material still need endpoint protection, and a compromised laptop can expose live sessions.
Documentation: Configure SSO · Authorize user access with OAuth
A2: Keyless automation with workload identity federation
Pipelines and jobs that run outside Databricks prove their identity through their own platform, so no Databricks secret is stored in them.
Who: Automation owner, account administrator
Needs CBI: No
Why it helps
The workload exchanges a token from its own identity provider, such as Okta, for Databricks access. There is no persistent Databricks credential in the pipeline to steal. Each workload gets its own service principal with only the permissions it needs.
Steps
-
Create or select a dedicated service principal.
Assign it only to the workspaces it needs, and grant only the job, compute, and data permissions it uses.
-
In the account console, go to User management → Service principals → the principal → Credentials & secrets → Federation policies.
Create a policy for the workload’s identity provider.
-
Set the issuer, audience, and exact workload subject, limited to the intended repository, environment, or equivalent boundary.
Check the provider’s actual claim values rather than copying another workload’s.
-
Configure the workload’s Databricks CLI or SDK to use federation (GitHub Actions settings in R2).
-
Run a harmless identity check and a representative job.
Confirm an unauthorized workload can’t sign in, then revoke the old Databricks credential.
If federation isn’t supported: use service-principal OAuth machine-to-machine (M2M) authorization instead. Generate a scoped OAuth secret, keep it in the workload’s secret manager, and configure the client ID, secret, and host through unified authentication. This still leaves a reusable secret to protect and rotate.
The real job runs. A workload with a different subject, such as another repository, is refused. The revoked credential fails.
Federation can’t protect a workload whose own trusted runtime has been compromised. GitHub subject formats can include immutable numeric IDs, so match the actual subject rather than assuming the older name-only format.
Documentation: Configure a federation policy · GitHub Actions federation · Service principal OAuth
A3: Restrict and expire personal access tokens
Where PATs are still needed, make each one an exception: approved identities only, a short lifetime, and a named owner.
Who: Account admin (inventory), workspace admin (settings), integration owners (migration)
Requires: Premium or above
Needs CBI: No
Why it helps
Fewer tokens and shorter lifetimes mean less to steal and a shorter window if one is stolen. A one-day or seven-day maximum is a useful starting point to evaluate. It isn’t a platform default or a guarantee against fast misuse, so choose a limit your integrations can sustain.
Steps
-
In the account console, open Security → Token report.
Note each token’s owner, workspace, expiry, and last use. Start with tokens whose owners are inactive, that never expire, or that have no current business owner.
-
If nothing still needs PATs, turn off Personal Access Tokens in workspace Settings → Advanced, after compatibility testing.
-
If some integrations still need them, use the Permissions control next to Personal Access Tokens.
Remove broad CAN USE grants, including any inherited through the users group. Grant use only to an approved exception group or specific service principals. Workspace admins keep their token-management rights.
-
-
Set a maximum lifetime for new tokens (command in R3).
-
Replace and explicitly revoke older tokens.
The new maximum doesn’t shorten tokens that already exist.
Creating a token longer than the maximum fails. An unapproved non-admin can’t create one. A revoked token can’t authenticate. Check partner compatibility before disabling PATs.
Turning off PATs or removing permission to use them doesn’t delete existing tokens. If the setting is restored, unexpired tokens work again. Revoke tokens explicitly.
Documentation: Monitor and revoke PATs · Manage PAT permissions
A4: Limit what each credential can call
Give each token or OAuth secret access only to the API families, or scopes, that its job requires.
Who: Credential owner, workspace administrator
Needs CBI: No
Why it helps
A token limited to the sql scope can’t manage secrets or clusters. Scopes work alongside the identity’s data permissions and don’t replace them: that same token can still query every table its owner can read.
Steps
-
Map the integration’s endpoints to their published API scopes, including rare maintenance and recovery operations.
-
For a PAT, go to Settings → Developer → Access tokens → Manage, and choose the required scopes when creating or updating the token.
-
For OAuth M2M, choose scopes when generating the service principal’s OAuth secret.
Existing secrets can’t be edited, so create a scoped replacement and retire the original after testing.
-
-
Don’t give routine integration credentials the
authenticationscope unless they truly manage credentials.That scope allows creating tokens with other scopes.
-
Test a required operation and an unrelated API family.
Allow time for updated PAT scopes to take effect.
For remaining long-lived PATs, consider auto-scoping (preview). Databricks watches how an eligible token is used for 30 days, then applies the scopes it inferred, once. Only tokens with lifetimes over 30 days qualify, and the token keeps full access during observation. Exercise rarely used paths and review the inferred scopes before enforcement. Don’t lengthen a short-lived token just to qualify. Setup details in R4.
The required call succeeds. A call to an unrelated API family is refused.
Scopes don’t limit which data the owner can read. When using the PAT API, an empty scopes list grants access to all APIs, not none.
Documentation: Scoped PATs and auto-scoping · Scoped OAuth secrets · API scope reference
B · Narrower public access
Layer B · Needs CBI · Pick what fits
These patterns use CBI selectively. They don’t require everyone to be on a VPN, but they do require CBI eligibility. Each is a deliberate trade-off between useful access and exposure. Skip this layer if CBI isn’t available to you.
The four patterns are alternatives. Choose the ones that match how people and tools actually connect.
Pattern | Suits | Stays open | Gets restricted |
|---|---|---|---|
Browser-based users working from home | The web interface, for everyone | Programmatic access, except approved automation | |
Teams that need some remote API or SQL access | The API families on the list | All other API families | |
Hosted partner tools such as Power BI | The named partner platform | Everyone else on the public internet | |
Occasional production support or remote work | Nothing by default | Everything, until an approved window |
Shared setup for every B pattern
Done once by an account administrator, then adjusted for each pattern.
-
Go to Security → Networking → Context-based ingress & egress control.
Create a dedicated policy rather than editing the default policy that covers every unassigned workspace. If you replace an assigned policy, keep its existing egress restrictions and other required ingress settings.
-
On the policy’s Ingress tab, choose Restrict access based on request context for the relevant source type.
Add the allow rules for your pattern and select dry-run mode.
-
Attach the policy to a pilot workspace through its Network Policy setting.
-
Review dry-run results across a normal business cycle with owner-run tests (query in R5).
Then enforce, and repeat both the allowed and blocked tests.
How CBI rules behave
Restricted mode blocks anything no allow rule permits. One broad allow rule can undo the omissions you intended, so review the complete rule set.
Explicit deny rules take precedence. API scope selections belong in allow rules, not deny rules.
Creating, editing, or attaching a policy typically takes 10 to 15 minutes to take effect, and enforcement may be inconsistent during that window.
Private, cross-workspace, Apps runtime, Lakebase runtime, and account-level access are separate paths that a workspace policy doesn’t automatically cover. Account-level CBI is Beta and uses its own policy.
Existing IP access lists can further restrict a request that the policy allows. Network logs don’t arrive immediately.
Documentation: Manage workspace ingress policies · Network event tables · Account ingress policies
B1: Browser yes, remote APIs no
Anyone can use the Databricks web interface from anywhere. Programmatic access through the CLI, JDBC, ODBC, or the API is limited to approved identities and sources.
Who: Account administrator, affected client owners
Needs CBI: Yes
Why it helps
This suits people who work in the browser from home but don’t need direct programmatic access from their laptops. A stolen token presented from an attacker’s machine can’t call the APIs, while browser access stays open.
Steps
-
Follow the shared setup and list every client that needs direct API access.
-
Add a public allow rule for Workspace UI · All users · All public IPs.
-
Add API allow rules only for required service principals or selected identities.
Prefer fixed runner egress addresses, a trusted network, or an approved partner source. Narrow the API scopes where practical.
-
Don’t add a general public API allow rule for all users.
Check inherited policy assignments and other rules for exceptions that reopen that access.
-
Pilot, review dry-run results, enforce, and have each client owner test a real workflow.
Example allow rule | Identity | Source | Access |
|---|---|---|---|
Human browser access | All users | All public IPs | Workspace UI |
Approved automation | Selected service principal | Approved runner egress | Required API scopes |
From a home network you control, browser access works and human CLI, JDBC, and ODBC access is blocked. Approved automation works when tested separately.
Users can still run code and read data in the browser within their permissions, and a stolen browser session remains a risk. If an integration has no stable source, a service-principal rule from public IPs is an identity exception, not a network boundary. A service principal doesn’t prove no human is operating it, so restrict who can manage and use it.
Documentation: CBI access types and identities · Service principal authorization
B2: Allow only the API types you need
When remote API access is required, allow the specific API families the workflow uses and nothing else.
Who: Account administrator, application owners
Needs CBI: Yes
Why it helps
A short “allow only these” list, such as IN sql, is easier to reason about than an “everything except” list that keeps growing. Use an exclusion list only when a positive list isn’t workable yet.
Steps
-
Pick a pilot workflow and map its endpoints to the API scope reference.
-
Keep browser access as a separate rule if needed.
Add an API allow rule for the intended identities and public sources, using IN with only the required scopes.
-
Add a separate, narrower allow rule for admins or automation that genuinely need excluded operations from an approved source.
If there’s no safe path, resolve that dependency before blocking it.
-
Check every other allow rule for overlapping unrestricted API access, then pilot and enforce.
Families to consider restricting are listed in R6.
Test specific endpoints, including model inference and JDBC/ODBC where relevant. An excluded family fails and the intended alternative still works.
Blocking one API family doesn’t necessarily block the same outcome through the browser, jobs, SQL, or another allowed API. CBI scope rules classify the request; they don’t reject a token because it carries broad scopes.
Documentation: Configure ingress rules · API scopes · Unity Catalog secrets
B3: Narrow partner exceptions
Let a specific SaaS partner connect without opening API access to the whole internet.
Who: Account administrator, partner integration owner
Needs CBI: Yes
Why it helps
A third-party integration shouldn’t force general public API access for everyone. For supported partners, CBI maintains the partner’s source definition, so you don’t have to copy and update a large, changing list of addresses.
Steps
-
Identify the actual connection path.
A desktop client, a customer-managed gateway, and the partner’s hosted service can each originate from different places.
-
Check whether the hosted product is listed under Partner Platforms.
Current examples include Power BI, Tableau Cloud, and dbt Cloud. Some other integrations are matched by managed OAuth application instead of an IP list.
-
Create an allow rule with the required access type, the integration’s identity where supported, and the specific Partner Platforms source.
Select only the partner regions you need.
-
Keep the integration’s data permissions and credential scopes limited to what it needs.
-
Test a scheduled refresh from the hosted service, then confirm an unrelated public source isn’t covered by the exception.
If the partner isn’t supported: get its authoritative egress ranges, or use a dedicated runner you control. If neither is possible, record a time-limited exception for the selected identity, with a named owner and the remaining risk.
The partner’s real scheduled refresh succeeds. A request from another public source is blocked.
A partner IP range doesn’t prove a request belongs to your tenant of that partner, so authentication and permissions still matter. It covers the partner’s hosted SaaS service only, not desktop versions such as Power BI Desktop running on a user’s machine.
Documentation: Allow partner platforms
B4: Temporary access on request
Keep sensitive access off by default, and grant a narrow exception for a set window when it’s approved.
Who: Access-management owner, account administrator, production owner
Needs CBI: Optional
Why it helps
Standing access is replaced by short, approved windows for needs like production support or occasional remote work. There’s no built-in expiry timer for CBI rules, so this requires a workflow you operate to schedule and confirm removal.
Steps
-
Define what is normally unavailable: a production role, a sensitive catalog, or remote API access for a named identity.
Record the approver and the maximum window.
-
With CBI: use a policy dedicated to the affected workspaces.
On approval, add the smallest selected-identity allow rule with the necessary source and access type.
-
Without CBI: grant membership in a narrowly privileged production group through your access-management workflow.
Don’t grant broad admin access as a shortcut.
-
-
Record the expiry outside the policy and schedule removal through an approved workflow.
For API automation, read the current policy and keep all unrelated ingress and egress settings when submitting a full update.
-
At expiry, remove the rule or membership, confirm access is gone, and alert the owner if cleanup fails.
Keep a separate, tested recovery process.
The same identity fails before approval, succeeds for the approved operation during the window, and fails again after removal.
Granting and removing both take time, an estimated 10 to 15 minutes, through CBI propagation and group synchronization. This makes it unsuitable as an instant emergency stop or a minute-by-minute boundary. Schedule cleanup early enough for the required end time and verify it.
Documentation: Update a network policy · Manage workspace ingress policies · Unity Catalog privilege management
C · Smaller blast radius
Layer C · No CBI needed
These controls assume some credentials or browser sessions will still be misused. They limit the data, execution rights, and downstream credentials that a misused identity can reach.
C1: Separate sensitive data and production
Keep crown-jewel data and production jobs in a separate workspace with tighter access, and bind that data so it can only be reached from there.
Who: Data platform owner, catalog owner, workspace administrator
Needs CBI: No, for data bindings
Why it helps
Some customers need to share a subset of their data with partners or other external entities. Separating that data into dedicated workspaces lets the broadly accessible workspace hold only what those users need, while crown-jewel data and production stay somewhere tighter. If the sensitive workspace is small, fewer people need a trusted access path to reach it. A new workspace alone isn’t enough: catalogs attached to the same metastore can be reached from other workspaces unless bindings restrict them.
Steps
-
Identify the sensitive catalogs and the production jobs, credentials, models, and identities that can reach them.
Define a separate catalog containing only data approved for the broadly accessible workspace.
-
In Catalog Explorer, open each sensitive catalog’s Workspaces tab.
Clear All workspaces have access and assign only the approved protected workspaces. Use read-only binding where that’s the intended access.
-
Review workspace bindings and permissions for external locations, storage credentials, and service credentials too.
-
Run routine production work as dedicated service principals.
Remove unnecessary human production access, job-management rights, and the ability to use production principals. Use B4 for approved exceptions.
-
Publish only approved, minimized outputs into the broadly accessible catalog.
Review shares, connections, jobs, and other indirect routes that could expose protected data.
A test user with a table grant still can’t read the table from the unbound workspace. The production job works from the approved workspace. A broadly accessible workspace can’t trigger a privileged production job or identity.
Bindings only control access through Databricks. Anyone with direct cloud-storage credentials can still reach the underlying files, and a job that’s allowed to read the data can still copy it somewhere less protected. Bind catalogs and external locations separately; one doesn’t cover the other.
Documentation: Workspace catalog binding · External location isolation
C2: Least privilege and masking
Limit what each identity can read and change, and mask sensitive values for people who need the dataset but not every field.
Who: Data owner, Unity Catalog administrator
Needs CBI: No
Why it helps
Even after a stolen credential is accepted, it can only reach what its owner is allowed to reach. Separating ordinary analysis from data administration and production ownership keeps that small. Row filters and column masks let people use a dataset without seeing all of its sensitive values.
Steps
-
In Catalog Explorer, review Permissions on sensitive catalogs, schemas, and tables.
Include inherited grants and group membership, not only direct table grants.
-
Replace unnecessarily broad access with role-specific account groups.
Grant the required USE CATALOG, USE SCHEMA, and table permissions without unrelated ownership or write privileges.
-
Create and test a masking or filtering function on non-production data (example in R7).
To apply the same rule across many tables, use governed-tag attribute-based access control (ABAC) policies.
-
Apply the policy and confirm ordinary readers see the masked or filtered result.
Test the authorized exception group separately.
-
Restrict who can change the policy or add members to the exception group.
Review job, warehouse, model, and service-principal permissions alongside table grants.
An ordinary reader gets masked or filtered results. A member of the exception group sees the full values. Check the documented compute and privilege requirements before applying a mask.
Masking doesn’t protect values from a compromised identity that is permitted to see them. A broadly privileged policy administrator may be able to remove a table-level policy.
Documentation: Manage Unity Catalog privileges · Apply filters and masks · Policy approaches
C3: Lock down stored secrets
Reduce the passwords and keys for other systems that live in Databricks, and the number of identities that can read them.
Who: Application owner, secret owner
Needs CBI: No
Why it helps
A misused Databricks identity becomes a route into other systems if it can retrieve their credentials. Workspace admins can read any value stored with the traditional Secrets API, so a compromised workspace admin puts every secret in the workspace at risk. Unity Catalog secrets, on the other hand, allow granular governance: you grant READ SECRET to specific identities, and only they can retrieve the value.
Steps
-
Find downstream credentials in code, notebooks, job configuration, logs, and workspace secret scopes.
Where the target system supports it, use a workload or service identity instead.
-
Create a Unity Catalog secret in Catalog Explorer: open the intended schema, then Create → Secret.
The creator needs USE CATALOG on the catalog, and USE SCHEMA and CREATE SECRET on the schema. Choose an approved catalog and schema, not a broadly shared default.
-
Grant READ SECRET only to identities that must retrieve the value, and review inherited catalog and schema privileges.
Use reference-based consumption where the integration supports it.
-
Update a pilot job to retrieve the secret without printing it (R8).
This requires Databricks Runtime 17.3 LTS or above, or serverless environment version 4 or above.
-
Test the job and remove old copies.
Rotate the underlying credential if earlier exposure is suspected.
The pilot job retrieves the secret and runs. An ordinary analyst can’t retrieve it.
Secrets that are still read from traditional workspace secret scopes. Moving to Unity Catalog secrets is a code change, not a setting: every notebook and job that retrieves a secret must be updated to read it from its new catalog and schema location. Until that’s done, those secrets remain readable by any workspace admin.
Documentation: Secrets in Unity Catalog
C4: Restrict outbound connections
Limit where code running in Databricks can connect and send data.
Who: Account administrator (serverless), network owner (classic compute)
Needs CBI: No
Why it helps
If a misused identity can run a notebook or job, outbound restrictions limit where that code can send data. This covers transfers made by compute, not data returned to a client that’s already authorized.
Steps
-
List the required destinations for the pilot workload: storage, package repositories, APIs, models, and other external services.
-
Serverless: on a dedicated network policy’s Egress tab, choose Restricted access to specific destinations and add the required domains and storage at the narrowest practical scope.
Keep existing ingress settings, then assign the policy to the pilot workspace through Workspaces → Network Policy.
Choose All products when the test includes external models or Model Context Protocol (MCP) calls, because product-specific dry-run doesn’t cover every outbound path.
-
Classic compute: use the supported customer-managed VPC architecture with an egress firewall or proxy.
Keep required Databricks service connectivity rather than improvising a blanket block.
-
-
Review outbound events, test required workloads, and enforce.
Confirm a harmless connection to an unapproved destination you control fails.
Required workloads run. A connection to an unapproved destination you control fails.
Serverless and classic compute use different controls, each with its own limitations. Serverless domain filtering can admit other domains that share an IP address. Egress control doesn’t stop data leaving through an allowed SQL query result, so pair it with C1 and C2.
Documentation: Serverless egress policies · Customer-managed VPC egress
C5: Reduce the number of workspace admins
Keep standing workspace admin access to the people and automation that genuinely need it.
Who: Account administrator, workspace access-management owner
Needs CBI: No
Why it helps
A stolen admin credential carries far more authority than a routine analyst credential. Admins can change settings, manage users, and read traditional workspace secrets (C3). Removing unnecessary admin access shrinks that exposure without requiring a VPN.
Steps
-
List the workspace admins in every in-scope workspace: users, service principals, and members of the admins group, including access inherited through other groups.
Record an owner and business reason for each.
-
Find admins who only need admin rights for routine work, such as running jobs, using compute, or querying data.
Give them the narrower permissions those tasks need instead.
-
Before removing anyone, confirm a tested admin recovery path.
Where practical, give administrators a separate identity for admin work, and use a time-limited approval for occasional admin tasks instead of permanent membership (B4).
-
For a directly assigned user, go to Settings → Identity and access → Users → Manage, select the user, and clear Admin access under Entitlements. For access through a group, change the group membership or role. Recheck what access remains afterward.
-
Record the approved admin list.
Governance Hub (D2) flags over-privileged admins; review new admin assignments and remove expired exceptions.
A pilot user whose admin access was removed can still do their daily work, but an admin-only action fails. The recovery admin can still operate. Check service-principal workloads separately before changing their access.
Workspace admin rights and Unity Catalog privileges are separate. Review catalog ownership, metastore privileges, and other powerful data grants under C2. Fewer admins doesn’t revoke credentials that are already exposed.
Documentation: Manage workspace users · Databricks administration roles
C6: Scan notebooks for exposed secrets
Find passwords, keys, and tokens pasted directly into notebook code before an attacker using a stolen credential can collect them.
Who: Platform security owner, notebook owners, credential owners
Needs CBI: No
Why it helps
People sometimes paste credentials straight into notebooks for convenience. Anyone who can read the notebook, including someone using a stolen token, can collect them. Regular scanning finds these so they can be rotated and moved into governed storage (C3). This uses a scanner your team runs, such as the open-source tool Gitleaks.
Steps
-
Decide which workspaces and notebook folders are in scope, including user folders, shared folders, and Git-managed notebooks.
Give the scanning identity only the read and export access it needs, and record any folders it can’t reach.
-
Export the notebooks as source code into a temporary, access-controlled location (R10).
Treat the exports as sensitive, since they may contain live credentials.
-
Run the scanner over the exported files with redaction turned on, so findings show where a secret is without printing its value.
Add rules for credential formats specific to your organization.
-
Schedule recurring workspace scans, and also scan Git-managed notebook changes during code review or CI.
A Git scan alone misses notebooks that live only in the workspace.
-
Send each finding to the notebook owner and the credential owner.
Rotate or revoke the exposed credential at the system that issued it, then replace the embedded value with a governed secret (C3). Deleting the notebook text isn’t the same as revoking the credential.
-
Keep scan reports access-controlled, never copy secret values into tickets or logs, and delete temporary exports on a set schedule.
Plant a fake, non-working test pattern in a disposable notebook. The scheduled scan finds it, reports its location without showing the value, and stops finding it once removed. A notebook the scanner can’t access is reported as a coverage gap, not counted as clean.
Source exports cover current code only, not notebook outputs or revision history. Scanners can miss custom or encoded secrets. A clean scan doesn’t prove no credential was ever exposed.
Documentation: Workspace list API · Workspace export API · Notebook export formats · Gitleaks
D · Detect, respond, maintain
Layer D · No CBI needed · Start here
Some misuse will get through. This layer finds it, shuts off the affected access, and keeps the other layers from drifting. Detection happens after activity has occurred; Databricks system tables aren’t a real-time prevention mechanism.
D1: Detect and contain misuse
Use audit data to spot unexpected activity, and have a tested way to shut off the affected access.
Who: Security operations, incident-response owner
Needs CBI: No, for credential response
Why it helps
Prevention won’t catch everything. Knowing what normal looks like, and having a rehearsed response, shortens the time a stolen credential stays useful once misuse starts.
Steps
-
Give a narrowly authorized security principal access to
system.access.auditin each relevant region.Add
inbound_networkandoutbound_networkwhere available. -
Establish a baseline of expected identities, source addresses, clients, and activity.
Look for new sources combined with sensitive actions, credential changes, or unusual data access. A new IP address alone is weak evidence for a roaming user.
-
Schedule a query with an overlapping lookback window and de-duplicate processed events by
event_id.Keep the first version alert-only (starter query in R9).
-
Define the approved response for confirmed misuse: revoke the affected PAT, disable or restrict the principal, revoke relevant OAuth credentials or grants, and rotate exposed downstream credentials.
Test each response on the affected access path.
-
Automate only narrowly justified actions, with audit records, rate limits, failure alerts, and a recovery procedure.
Don’t start with an unattended rule that closes the whole workspace.
Optional network response: after confirming the source and the lockout risk, add a targeted CBI IP deny rule, or an IP block-list entry where that’s the deployed control. Revoke the credential or disable the user as well, because blocking one source doesn’t stop use from another.
Generate approved test activity from a known source and from a new source you control. Only the new combination is flagged. Measure the delay from the event to visibility, alert, and completed containment.
Audit and network records can take up to an hour to arrive, and they may land in batches rather than one at a time. Use a lookback window of at least a couple of hours, overlapping each run, so late records are still caught, and de-duplicate by event_id. Plan your response time around that delay; a quiet hour doesn’t mean nothing happened.
Documentation: Audit schema · System table limitations · Network event availability · Token revocation · IP access lists
D2: Monitor security posture in Governance Hub
Use the Security page in Governance Hub to see, every day, which of your workspaces are drifting from Databricks security best practices, and what to fix first.
Who: Account administrator
Status: Private Preview
Needs CBI: No
Why it helps
Controls drift: a new workspace appears, someone creates a long-lived token, or an exception never gets removed. The Security page evaluates every workspace daily against controls based on Databricks security best practices, ranks the findings by severity, and links each failure to remediation guidance. Several of its checks map directly to the options in this guide.
A selection of the checks. See the security controls reference for the full list.
What it checks | Category | Related |
|---|---|---|
SSO, risky personal access tokens, stale service principal secrets, emergency access | Identity & Access | |
Over-privileged admins and identity lifecycle | Identity & Access | |
Context-based ingress, IP access controls, and private connectivity | Network Security | |
Serverless egress controls | Network Security | |
Notebook, query result, and file export controls | Data Protection | |
Global init scripts, cluster libraries, and Git repository controls | Platform Hygiene |
Steps
-
In the account console, open Previews and turn on both Governance Hub and Governance Hub: Security Posture Management.
If the second isn’t listed, ask your account team to enroll you.
-
Wait for the first evaluation.
Initial results can take up to a day to appear.
-
Open Governance Hub → Security.
Start with Workspaces that need attention and the high-severity findings.
-
Select a failing control to see the affected workspaces, when it started failing, and why.
For long-lived tokens, this shows token IDs, owners, and expiry dates. Follow the linked remediation guidance.
-
Tune controls to your policies.
Adjust severity, set thresholds such as the maximum service principal secret lifetime, and disable controls that don’t apply, such as in a sandbox workspace. Review the page on a regular schedule.
Findings appear for every workspace in scope. After you remediate a failing control, it shows as passing on the next daily evaluation.
Results update daily, so this is for catching drift, not for detecting an active attack (see D1). A passing control means a setting is in place; still test that it blocks what you expect. Disabled controls are still scanned for history but don’t show as passing or failing.
Documentation: Governance Hub security overview · Security controls reference
D3: Prepare for incidents
Write and rehearse playbooks for two cases: an isolated incident affecting Databricks, and a wider internal compromise that hasn’t reached Databricks yet.
For investigation and containment procedures, see A Security Responder's Guide to Databricks.
Who: Incident commander, security operations, account administrator, application owners
Needs CBI: Optional, for network response
Why it helps
Decisions made in advance are faster and safer than decisions made mid-incident. The two scenarios call for different triggers and different scales of response.
-
Scenario 1 · An isolated incident affecting Databricks
A leaked PAT, an exposed OAuth secret, or a misused identity. The scope is usually known, so the response can be targeted: revoke the affected credentials, disable or restrict the identity, and rotate any downstream secrets it could reach.
-
Scenario 2 · A wider internal compromise that hasn’t reached Databricks yet
Laptops, identity systems, repositories, or secret stores are exposed, and you can’t yet tell which Databricks credentials are affected. This can justify precautionary restrictions before any Databricks misuse is confirmed, up to broad revocation or prepared ingress restrictions.
Steps
-
Write a playbook for each case.
Define the evidence that triggers targeted containment and the conditions that justify a broader shutdown. Name who can approve disruption and who owns restoration.
-
Keep an inventory of workspaces, PATs, service principals, OAuth secrets and grants, federation policies, stored downstream secrets, and dependent workloads.
Record credential identifiers and owners, never secret values.
-
Maintain a tested admin recovery path from a clean device that doesn’t depend on the compromised identity or network.
Pre-authorize the emergency access and outage decisions needed to use it.
-
Rehearse in a pilot workspace with test identities and non-sensitive data.
Measure the time until access actually fails, including existing credentials and sessions, not only a fresh sign-in.
-
Preserve audit evidence and configuration snapshots during containment, without delaying urgent action.
Define which workloads must stop, how owners prove credential replacement, and the checks required before restoring access.
Containment measures to prepare
Listed roughly from least to most disruptive. Most incidents need more than one.
-
Restrict interactive sign-in
Helps when most access depends on people signing in. Apply the approved identity-provider and Databricks identity restrictions, then test the affected paths.
Blocking new sign-ins doesn’t stop existing browser sessions, PATs, OAuth tokens, or service-principal access. Revoking OAuth consent doesn’t invalidate existing tokens, and refresh tokens can stay usable until they expire.
-
Revoke reusable credentials
For a limited incident, revoke the exposed PATs and replace the affected OAuth secrets. If an attacker may hold many credentials, the incident commander can authorize revoking all PATs and deleting all service-principal OAuth secrets within a declared scope. Expect many job and integration failures. The account Token report revokes PATs across workspaces.
Disabling PATs doesn’t delete them. Deleting an OAuth secret may not stop tokens already issued, so deactivate affected service principals and verify. Account-level deactivation covers every workspace; workspace-level covers only that one. Remove the cause of compromise before issuing replacements.
-
Rotate downstream credentials
If an attacker could retrieve a database password, cloud key, or other secret, rotate it at the system that issued it. Deleting the Databricks copy doesn’t invalidate a copy the attacker already has.
Where ownership is unclear, an organization may deliberately delete affected stored secrets to force owners through rotation. This is a disruptive emergency measure: authorize it explicitly, keep non-secret ownership records, and never restore old values just to make failed jobs succeed. Running workloads and cached copies may continue.
-
Apply prepared ingress restrictions
An incident can justify rapidly deploying CBI. Prepare a restrictive emergency policy, the required trusted sources, and a recovery path in advance. Limit the affected identities, workspaces, and access types where evidence allows.
Changes take 10 to 15 minutes to take effect. Pair them with credential and identity measures rather than waiting for propagation.
In an approved exercise covering both cases, the intended access fails, essential recovery access works, owners complete rotation, and restored workloads use new credentials. Record containment and recovery times.
A successful setting change or a failing job doesn’t, by itself, prove that an attacker has lost access.
Documentation: PAT revocation · Service principal deactivation · Service principal OAuth · OAuth consent and token limitations · Secret management · Ingress policy changes
Part 3: Reference
Commands, queries, and checklists referenced in Part 2. Replace placeholder values in angle brackets, and run examples in a non-production workspace first.
R1: Sign in to the CLI with OAuth
Used in A1
Completes a browser sign-in for a named profile, then confirms which identity the CLI is using.
databricks auth login --host <workspace-url> --profile human-oauth
databricks current-user me --profile human-oauth
R2: GitHub Actions federation settings
Used in A2
The workflow must be permitted to request an identity token, and the Databricks CLI or SDK reads its authentication settings from the environment. This is a fragment; follow the provider guide for the complete workflow.
permissions:
id-token: write
env:
DATABRICKS_AUTH_TYPE: github-oidc
DATABRICKS_HOST: <workspace-url>
DATABRICKS_CLIENT_ID: <service-principal-client-id>
R3: Set a seven-day maximum lifetime for new PATs
Used in A3
Run as an authenticated workspace administrator. Existing tokens keep their original expiry.
databricks workspace-conf set-status --profile workspace-admin \
--json '{"maxTokenLifetimeDays":"7"}'
R4: Turn on PAT auto-scoping (preview)
Used in A4
-
An administrator enables the auto-scoping preview on the account console or the workspace Previews page.
Existing eligible long-lived tokens begin observation when it’s enabled.
-
When creating a new eligible token, turn on Auto-scope tokens.
-
Review status under Access tokens → Manage.
For an existing all-APIs token, inspect
backfill_scopesin the token API response to see its inferred scopes.
R5: Review recent CBI network events
Used in Layer B setup
Lists inbound network events for the pilot workspace over the last two hours. Logs don’t arrive immediately, so allow for delay.
SELECT *
FROM system.access.inbound_network
WHERE workspace_id = '<workspace-id>'
AND event_time >= current_timestamp() - INTERVAL 2 HOURS
ORDER BY event_time DESC;
R6: API families to consider restricting
Used in B2
Candidates for review, not a universal block list. Use exact scope identifiers.
Scope or family | Why restrict it | Main trade-off |
|---|---|---|
| Workspace secret APIs | Secret administration and some integrations |
| Credential management | Token and OAuth secret maintenance |
| Configuration and startup code changes | Administrative and platform workflows |
| Direct cluster command APIs | Developer and operational tooling |
| Endpoint administration or inference | Applications and model clients |
| Data governance, identities, permissions, or network administration | Broad legitimate governance workflows |
| Direct query access | BI and remote SQL workflows |
settings isn’t an umbrella for every administrative API, and accounts isn’t a shortcut for protecting the separate account surface. Unity Catalog secrets use unity-catalog, not secrets.
R7: Example column mask
Used in C2
For an initial test on a SQL warehouse and a non-production table with a string national_id column. Create the example catalog, schema, and pii_readers group first. The policy administrator needs CREATE FUNCTION on the policy schema, the required parent usage privileges, and EXECUTE on the function. Applying a mask to an existing table requires ownership, or both MANAGE and SELECT.
CREATE FUNCTION demo_security.policy.mask_national_id(value STRING)
RETURN IF(is_account_group_member('pii_readers'),
value, 'REDACTED');
ALTER TABLE demo_data.analytics.people
ALTER COLUMN national_id
SET MASK demo_security.policy.mask_national_id;
R8: Read a Unity Catalog secret in a job
Used in C3
Retrieves the value without printing it. Requires Databricks Runtime 17.3 LTS or above, or serverless environment version 4 or above.
api_key = dbutils.secrets.get(
catalog="prod_security",
schema="integrations",
key="partner_api"
)
R9: Starter query: new source and identity combinations
Used in D1
Lists recent activity where an identity appears from a source address it hasn’t used in the previous 30 complete days. It’s a triage signal, not a production detector or proof of compromise. Replace the workspace ID. The query uses an email or subject name when present.
WITH events AS (
SELECT event_time, event_date,
coalesce(user_identity.email,
user_identity.subject_name) AS principal,
source_ip_address, service_name, action_name, event_id
FROM system.access.audit
WHERE workspace_id = '<workspace-id>'
AND event_date >= date_sub(current_date(), 30)
),
known_sources AS (
SELECT DISTINCT principal, source_ip_address
FROM events
WHERE event_date < current_date()
)
SELECT recent.event_time, recent.principal, recent.source_ip_address,
recent.service_name, recent.action_name, recent.event_id
FROM events AS recent
LEFT ANTI JOIN known_sources AS known
ON recent.principal = known.principal
AND recent.source_ip_address = known.source_ip_address
WHERE recent.event_date >= date_sub(current_date(), 1)
AND recent.event_time >= current_timestamp() - INTERVAL 2 HOURS
AND recent.principal IS NOT NULL
AND recent.source_ip_address IS NOT NULL
ORDER BY recent.event_time DESC;
For delegated workloads, correlate identity_metadata.run_by and run_as rather than assuming the initiating and executing identities are the same.
R10: Export and scan notebooks
Used in C6
-
Use the Workspace API
listoperation to walk directories recursively. -
Export each notebook with the
exportoperation and formatSOURCE, then decode the returned content into an access-controlled temporary location. -
Run Gitleaks in directory mode with redaction enabled:
Bashgitleaks dir /secure/notebook-export --redact
R11: Acceptance tests
Run these after rollout and after material changes. For each, record the test identity, source, workspace, operation, time, result, and policy snapshot or version. Use test assets you own and non-sensitive data.
Test | Expected result | Option |
|---|---|---|
A normal user signs in and does required work | The approved workflow succeeds | |
A retired PAT is presented to the intended workspace | Authentication fails | |
An unapproved person tries public API access | The API call fails after policy propagation | |
An excluded API family is called | The selected operation fails and the intended alternative still works | |
An approved partner or automation runs its real workload | Required access succeeds without broader access | |
A temporary exception reaches its end | Access fails and cleanup is recorded | |
A sensitive catalog is queried from an unbound workspace | The query fails even when the test user has a table grant | |
A known test event enters the detection workflow | Time to visibility, alert, decision, and containment is measured |