Sub topic 12
Limiting catalogs to specific workspaces
This chapter assumes you know the Unity Catalog object hierarchy (metastore, catalog, schema, table), how GRANT and REVOKE work, and the difference between account-level and workspace-level administration. It covers workspace bindings: a way to restrict which workspaces can see a catalog, independent of the privileges granted on it.
Why privileges alone are not enough
A Unity Catalog metastore is shared by every workspace attached to it. If a principal holds SELECT on a table, that principal can query the table from any attached workspace. In many organizations that is too broad.
Consider these cases:
- Production data should only be reachable from the production workspace, so that an analyst experimenting in a development workspace cannot read it.
- Regulated data, such as payment or health records, should be queried only from a locked-down workspace with tighter network and compute controls.
- A catalog holding sandbox data should not clutter the catalog list in production.
Workspace bindings address these cases. A binding ties a catalog to a set of workspaces. Only those workspaces can use the catalog, whatever privileges users hold.
How workspace bindings work
By default, a catalog is open to all workspaces attached to the metastore. Access is then decided only by privileges.
When you restrict a catalog to specific workspaces, Unity Catalog adds a second check. Two conditions must both be true for a request to succeed:
- The workspace the request comes from is bound to the catalog.
- The principal holds the required privileges through grants, inheritance, or ownership.
A workspace binding never grants access. It only narrows where access can happen. A user with every privilege on a catalog still cannot use it from a workspace that is not bound.
The two checks are independent. You can think of the binding as a door into a building and privileges as keys to individual rooms. Both must work.
Catalog types and binding
Bindings apply to catalogs, and the catalog's own settings determine how they behave.
| Catalog kind | Default scope | Can be restricted? |
|---|---|---|
| Standard catalog you create | All workspaces in the metastore | Yes |
| Catalog created for a workspace at setup | Bound to that workspace | Yes |
| Catalog created from a Delta Sharing share | All workspaces in the metastore | Yes |
| Foreign catalog (federation) | All workspaces in the metastore | Yes |
Exact defaults can vary with your account's age and settings. Check the catalog's Workspaces tab in Catalog Explorer to see what applies to yours.
Bindings can also carry an access level. A workspace can be bound with read-write access or read-only access. A read-only binding blocks writes to the catalog from that workspace, even for principals who hold MODIFY. This is useful when production data should be readable from a development workspace but never changed there.
Configuring a binding
You need to be a metastore admin or the owner of the catalog to change its bindings. Metastore admins and catalog owners do this in Catalog Explorer.
- Open Catalog in the workspace.
- Select the catalog and open the Workspaces tab.
- Clear All workspaces have access, or choose the option that restricts access to selected workspaces.
- Select Assign to workspaces, then choose the workspaces to bind.
- Choose the access level for each workspace if the option is offered, then save.
You can also manage bindings through the Databricks REST API and the Databricks CLI. The workspace-bindings endpoints take a catalog name and a list of workspace IDs to add or remove. Check the current API reference for the exact request shape, because the endpoints have changed across versions.
Effect on the metastore view
After restriction, the catalog disappears from lists such as Catalog Explorer, SHOW CATALOGS, and the catalog picker in unbound workspaces. The same user in a bound workspace still sees it. This is useful as a guard against accidents, because users cannot select data they cannot see.
Checking what a workspace can see
Run these in a notebook or the SQL editor in a given workspace to see how binding affects results:
SHOW CATALOGS;A catalog bound only to another workspace will not be listed. If a catalog you expect is missing, there are two common causes. Either you lack a privilege on it, or the workspace is not bound to it. Compare the output from a bound workspace with the output from an unbound one, to separate the two.
You can confirm privileges independently of bindings:
SHOW GRANTS ON CATALOG main;The grants are stored in the metastore and do not change when you change a binding. That separation is why a binding can be removed and re-added without losing any permissions.
Interaction with other controls
Bindings are one layer. They sit alongside several other controls and interact with them in specific ways.
Storage credentials and external locations
Storage credentials and external locations can also be bound to specific workspaces. This matters because a catalog's data often lives in an external location. If you bind a catalog to the production workspace but leave the external location open to every workspace, a user in a development workspace may still read the underlying files directly through the location, if they hold privileges on it. When you restrict a catalog, review the external locations that back it and restrict them the same way.
Row filters and column masks
Filters and masks apply after the binding check. A workspace that is not bound never reaches the table, so the filter is never evaluated. Within a bound workspace, filters and masks still apply as normal. Bindings do not replace them. A binding limits where data is reachable, while filters and masks limit what each user sees inside that place.
Ownership and admin roles
Owners and metastore admins are also subject to bindings. Being the owner of a catalog does not let you use it from an unbound workspace. It does let you change the binding, though, so an owner can bind the current workspace and then use the catalog. Treat the right to edit bindings as sensitive, since it lets someone widen where a catalog is reachable.
Common errors and gotchas
- Catalog not found in a workspace. The error often reads as if the catalog does not exist. Before you debug privileges, check the workspace binding.
- Binding set but privileges missing. Binding a workspace gives nobody access. Users still need
USE CATALOGand the usual lower-level privileges. - Read-only binding and failed writes. A write fails from a read-only bound workspace even for a table owner. The fix is a read-write binding, or doing the write from a different workspace.
- Jobs running in the wrong workspace. A scheduled job runs in the workspace that owns it. If you move a job to a workspace that is not bound, it fails on the first catalog reference.
- Forgetting the system catalogs. Bindings apply to the catalogs you manage. Do not restrict a catalog that every workspace needs, such as one holding shared reference data, unless you have listed all consumers.
- Locking yourself out. If you unbind the only workspace you have access to, you lose the ability to edit the binding from there. A metastore admin can still fix it from a workspace that is bound, or through the API.
When to use bindings
Use bindings when the workspace itself is a security boundary, for example when workspaces map to environments (dev, test, prod) or to regulatory zones. In those designs, bind each environment's catalogs to the matching workspace and give developers read-only bindings to production where reads are needed.
Skip them when every workspace has the same trust level. Extra bindings add maintenance cost, since each new workspace needs updating, and they can confuse users who cannot see a catalog. Group-based privileges handle most access needs.
Exercise
A user holds SELECT on prod.sales.orders and queries it from a development workspace. The prod catalog is bound only to the production workspace. What happens, and what two things would you check if the same user also cannot query it from the production workspace?
Show answer
The query fails, and the catalog does not appear in the development workspace, because the workspace is not bound. The privilege does not help, since both the binding and the privilege must pass. In the production workspace, check that the user also holds USE CATALOG on prod and USE SCHEMA on prod.sales, because SELECT alone is not enough. Also check whether the binding is read-only, which would only block writes and not reads.
Exercise
Your team wants analysts in a development workspace to read production data but never change it. Which binding setting do you use, and why is it not sufficient to simply withhold MODIFY from them?
Show answer
Bind the production catalog to the development workspace with read-only access. Withholding MODIFY protects only the principals you configured. A new grant, an owner, or a group with broader rights could still write from that workspace. A read-only binding blocks writes at the workspace level whatever the privileges are.