Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@ account
├── service principal
└── metastore
└── catalog
└── schema
```

A metastore exposes its privileges as entitlements (`CREATE_CATALOG`,
Expand Down Expand Up @@ -284,9 +285,9 @@ or `databricks-exclude-workspaces`.

## Unity Catalog provisioning

A metastore or catalog privilege can be granted to and revoked from a user,
group or service principal. The `owner` entitlement is read-only: granting or
revoking it fails with an `InvalidArgument` error.
A metastore, catalog or schema privilege can be granted to and revoked from a
user, group or service principal. The `owner` entitlement is read-only: granting
or revoking it fails with an `InvalidArgument` error.

If a catalog becomes unreachable, provisioning must distinguish deletion from
a workspace binding or visibility change. Requests can fail with
Expand All @@ -310,6 +311,15 @@ cover other catalogs. A non-owner using `MANAGE` also needs `USE_CATALOG` for
catalog discovery. An incomplete grants list fails the sync rather than
removing grants the connector cannot see.

For a schema's full grants list, and to grant or revoke a schema privilege, the
service principal must own the metastore, the catalog or the schema, hold
`MANAGE` on the schema or on the catalog above it, or have Admin assigned
directly on the workspace whose admins group owns the catalog. Listing the
schemas is a weaker requirement: `USE_SCHEMA` and `ALL_PRIVILEGES` on the
catalog each return every schema, and neither reads their privileges. A service
principal holding only one of them syncs its schemas and then fails on their
grants.

The connector requests the `all-apis` OAuth scope. Each resource type declares
the scopes, roles and privileges it needs, so `./baton-databricks capabilities`
reports them per type.
Expand Down
85 changes: 85 additions & 0 deletions baton_capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,91 @@
]
}
},
{
"resourceType": {
"id": "schema",
"displayName": "Schema",
"traits": [
"TRAIT_APP"
],
"annotations": [
{
"@type": "type.googleapis.com/c1.connector.v2.OptInRequired"
},
{
"@type": "type.googleapis.com/c1.connector.v2.CapabilityPermissions",
"permissions": [
{
"permission": "unity-catalog"
},
{
"permission": "scim"
},
{
"permission": "access-management"
},
{
"permission": "provisioning"
},
{
"permission": "Account admin"
},
{
"permission": "Workspace admin"
},
{
"permission": "USE_CATALOG"
},
{
"permission": "USE_SCHEMA"
},
{
"permission": "MANAGE"
}
]
},
{
"@type": "type.googleapis.com/c1.connector.v2.SkipEntitlements"
}
]
},
"capabilities": [
"CAPABILITY_SYNC",
"CAPABILITY_PROVISION"
],
"permissions": {
"permissions": [
{
"permission": "unity-catalog"
},
{
"permission": "scim"
},
{
"permission": "access-management"
},
{
"permission": "provisioning"
},
{
"permission": "Account admin"
},
{
"permission": "Workspace admin"
},
{
"permission": "USE_CATALOG"
},
{
"permission": "USE_SCHEMA"
},
{
"permission": "MANAGE"
}
]
},
"optInRequired": true
},
{
"resourceType": {
"id": "service_principal",
Expand Down
38 changes: 33 additions & 5 deletions docs/connector.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ sidebarTitle: "Databricks"
| Groups | <Icon icon="square-check" iconType="solid" color="#c937ae"/> | <Icon icon="square-check" iconType="solid" color="#c937ae"/> |
| Metastores | <Icon icon="square-check" iconType="solid" color="#c937ae"/> | <Icon icon="square-check" iconType="solid" color="#c937ae"/> |
| Roles | <Icon icon="square-check" iconType="solid" color="#c937ae"/> | <Icon icon="square-check" iconType="solid" color="#c937ae"/> |
| Schemas | <Icon icon="square-check" iconType="solid" color="#c937ae"/> | <Icon icon="square-check" iconType="solid" color="#c937ae"/> |
| Service principals | <Icon icon="square-check" iconType="solid" color="#c937ae"/> | <Icon icon="square-check" iconType="solid" color="#c937ae"/> |
| Users | <Icon icon="square-check" iconType="solid" color="#c937ae"/> | <Icon icon="square-check" iconType="solid" color="#c937ae"/> |
| Workspaces | <Icon icon="square-check" iconType="solid" color="#c937ae"/> | <Icon icon="square-check" iconType="solid" color="#c937ae"/> |
Expand All @@ -29,19 +30,19 @@ Revoking the workspace **member** entitlement removes the principal's entire wor

[This connector syncs non-human identities](/product/admin/nhi) and displays them on the **Identities overview** dashboard.

## Metastore and catalog access in C1
## Metastore, catalog and schema access in C1

The connector syncs Databricks [Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog/manage-privileges/privileges)
metastores and the catalogs in them as C1 resources. Each privilege Databricks
metastores, the catalogs in them, and the schemas in those catalogs as C1 resources. Each privilege Databricks
records on one of them (`CREATE_CATALOG` on a metastore, `USE_CATALOG` or
`SELECT` on a catalog, and so on) becomes an entitlement in C1, so you can
`SELECT` on a catalog, `USE_SCHEMA` on a schema, and so on) becomes an entitlement in C1, so you can
review who holds it, request it, and revoke it for users, groups and service
principals. A grant held by a group is expandable so C1 can resolve the
group's members as holders. Ownership is shown as a read-only `owner`
entitlement — it cannot be granted or revoked through C1.

<Note>
The Metastores and Catalogs resource types are turned off by default. Turn on the ones you want from the connector's configuration page in C1. Catalogs sync under their metastore, so turn on Metastores as well as Catalogs; turning on Catalogs alone syncs nothing. Both use the same OAuth credentials; no additional configuration fields are needed.
The Metastores, Catalogs and Schemas resource types are turned off by default. Turn on the ones you want from the connector's configuration page in C1. Catalogs sync under their metastore and schemas under their catalog, so turn on every level above the one you want; turning on Catalogs alone, or Schemas without Catalogs, syncs nothing. They all use the same OAuth credentials; no additional configuration fields are needed.
</Note>

<Note>
Expand All @@ -50,7 +51,8 @@ The Metastores and Catalogs resource types are turned off by default. Turn on th
- Ownership is shown but cannot be provisioned. An owner that is not a Databricks account identity, such as a system account or a workspace admins group, is not shown at all.
- **MANAGE** and **ALL_PRIVILEGES** are not offered on a metastore, because Databricks rejects both at that level.
- A catalog is synced when any running workspace in scope attached to its metastore lists it, and the same catalog name is kept once per metastore. A catalog that only excluded workspaces can reach is not synced.
- The built-in `system` catalog is never synced, and neither is any other catalog Databricks marks as a system catalog, whoever owns it.
- The built-in `system` catalog is never synced, and neither is any other catalog Databricks marks as a system catalog, whoever owns it. Their schemas are not synced either.
- `information_schema` is skipped in every catalog.
- If a catalog becomes unreachable, access requests can fail until the connector can distinguish deletion from a binding or visibility change. Catalog ownership or **MANAGE** alone cannot prove deletion; that check requires the **Metastore Admin**.
- Unity Catalog tags are not synced.
</Note>
Expand Down Expand Up @@ -210,6 +212,32 @@ The connector asks every running workspace in scope attached to the metastore, s
If the service principal cannot list catalogs at all through one of those workspaces, the connector cannot tell which catalogs are there, so the sync fails naming the metastore and that workspace instead of removing the catalogs it could not list. Give the service principal **Admin** on that workspace, or leave that workspace out with **Workspaces** or **Exclude Workspaces**.
</Warning>

### Let the service principal list schemas and read their privileges

Skip this section if you are not syncing schemas, or if the service principal is the **Metastore Admin** or owns the catalog.

Grant **MANAGE** on each catalog whose schemas you want synced, on top of the **USE CATALOG** from the previous section. **MANAGE** covers both halves: it lists every schema in the catalog and it reads who holds what on each one.

**USE SCHEMA** and **ALL PRIVILEGES** are not substitutes: either one lists every schema, and then the sync fails on their grants.

Workspace **Admin** replaces all of this only when the catalog is owned by that workspace's admins group (`_workspace_admins_<workspace>_<workspace id>`) and the service principal is a direct Admin of that workspace.

<Steps>
<Step>
In the workspace, open **Catalog Explorer** and open the catalog.
</Step>
<Step>
Select **Permissions**, then click **Grant**.
</Step>
<Step>
Select the service principal, check **MANAGE**, and confirm.
</Step>
</Steps>

<Warning>
A catalog whose schemas cannot all be listed fails the sync, and so does a schema whose privilege list cannot be proved complete, named in the error.
</Warning>

**Done.** Here's the set of credentials you'll need when setting up the connector:

- Account ID
Expand Down
8 changes: 6 additions & 2 deletions docs/docs-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,14 @@ While developing the connector, please fill out this form. This information is n
- **Ownership is read-only.** It is shown and cannot be granted or revoked. An owner that is not an account identity (`System user`, `_workspace_admins_…`) is not shown.
- **No `MANAGE` or `ALL_PRIVILEGES` on a metastore.** Databricks rejects both, so they are not offered.
- **Read through one running workspace.** Privileges are not served on the account plane. The connector reads each metastore through the first running workspace in scope where it can see every privilege. With no running workspace in scope, the metastore is not synced and ConductorOne removes it. A workspace that is still provisioning fails the sync until it is `RUNNING`. An unreadable assignment list fails the sync and ConductorOne keeps the metastore.
- **`workspaces` scopes metastores.** An allowlist that names no workspace on the account fails at credential validation, before any sync.
- **`workspaces` scopes metastores.** An allowlist in which every name is either missing from the account or listed in `databricks-exclude-workspaces` fails at credential validation, before any sync, with one error that names both causes.
- **Catalogs are opt-in.** The resource type is off until it is turned on from the connector's configuration page in C1.
- **Catalog discovery visits every attached workspace in scope.** The connector asks each running workspace attached to the metastore, including for `ISOLATED` catalogs bound to only some workspaces. Each catalog name is kept once per metastore. A catalog bound only to workspaces the sync excludes is not listed, and C1 removes it with its grants.
- **A catalog is keyed by its name.** `CatalogInfo` exposes no immutable catalog id (only `name` and the derived `full_name`), so the resource id is `<metastore id>::<name>`. The update API accepts `new_name`, so an owner can rename a catalog; a rename re-keys the resource and its grants.
- **System catalogs are excluded regardless of ownership.** The built-in `system` catalog and any catalog with `CatalogType == "SYSTEM_CATALOG"` are excluded, including `samples` when it has that type.
- **Seeing a catalog needs more than `MANAGE`.** The list holds the catalogs the service principal owns or holds `USE_CATALOG` on, or every catalog when it is the metastore admin. `MANAGE` alone reads a catalog's privileges but does not make it appear.
- **Not synced yet:** schemas, tables, volumes, functions, registered models, external locations, storage credentials, connections, shares, recipients, and tags.
- **Schemas are opt-in and hang from a catalog.** The resource type is off until it is turned on in C1, and it syncs nothing unless Catalogs and Metastores are on as well.
- **A schema is keyed by its full name.** `SchemaInfo` does carry an immutable `schema_id`, but no endpoint accepts it: `GET` and `PATCH` on a schema both address it as `catalog.schema`, so keying on the id would mean listing the catalog's schemas on every read and write just to recover that name. The parent catalog has no immutable id at all, so a catalog rename re-keys the schema either way. The resource id is `<metastore id>::<catalog>.<schema>`, and a schema rename re-keys the resource and its grants, as it does for a catalog.
- **`information_schema` is skipped in every catalog.** Databricks creates it read-only in every catalog and its privileges cannot be granted, so it would sync entitlements no one can hold or request.
- **Listing schemas is weaker than reading their privileges.** `USE_SCHEMA` and `ALL_PRIVILEGES` on the catalog each make the listing complete. Neither reads a schema's privileges, because Databricks leaves `MANAGE` out of `ALL_PRIVILEGES`: that read needs ownership of the metastore, the catalog or the schema, `MANAGE` on the schema or the catalog, or direct workspace Admin where the admins group owns the catalog.
- **Not synced yet:** tables, volumes, functions, registered models, external locations, storage credentials, connections, shares, recipients, and tags.
Loading
Loading