Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ baton resources
- Roles
- Metastores
- Catalogs (under their metastore)
- Schemas (under their catalog)
- Tables (under their schema)
- Volumes (under their schema)

The connector fetches all resources from the account and every workspace the
service principal can access. To limit the scope, pass a comma-separated list of
Expand All @@ -95,9 +98,14 @@ other metastores and their grants from ConductorOne. Catalogs must also be
visible through a listed workspace. A list that names no workspace on the
account is rejected during credential validation, before any sync runs.

Metastores and catalogs are opt-in: each resource type stays off until enabled
for the connector in ConductorOne. Catalog sync uses the existing OAuth
credentials and configuration fields.
Metastores, catalogs, schemas, tables, and volumes are Unity Catalog securables
and are opt-in: each type stays off until it is enabled for the connector in
ConductorOne. They use the existing OAuth credentials and configuration fields.

The opt-in is a ConductorOne setting, so it does not apply to the CLI. A local
run with no selection syncs every type, and it fails on a service principal that
cannot list every table and volume. Pass `--sync-resource-types` to limit it, for
example `--sync-resource-types account,user,group,metastore,catalog,schema`.

## Authentication

Expand Down Expand Up @@ -238,6 +246,8 @@ account
└── metastore
└── catalog
└── schema
├── table
└── volume
```

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

## Unity Catalog provisioning

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.
A privilege on a metastore, catalog, schema, table or volume 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
If a securable becomes unreachable, provisioning must distinguish deletion from
a workspace binding or visibility change. Requests can fail with
`FailedPrecondition` when deletion cannot be proved.

Expand Down Expand Up @@ -320,6 +330,17 @@ 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.

For a table's or a volume's full grants list, and to grant or revoke one of
their privileges, the service principal must own the metastore, the catalog, the
schema or the object itself, hold `MANAGE` on the object, its schema or its
catalog, or have Admin assigned directly on the workspace whose admins group
owns the catalog. Listing them is a separate right, and a stricter one than
listing the schemas: ownership of the metastore, the catalog or the schema, that
same Admin standing, or `ALL_PRIVILEGES` on the catalog. `USE_SCHEMA` and
`MANAGE` return every schema and neither returns every table or volume, so a
service principal holding only one of them syncs the schemas and then fails on
their children.

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
149 changes: 149 additions & 0 deletions baton_capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,79 @@
]
}
},
{
"resourceType": {
"id": "table",
"displayName": "Table",
"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"
}
]
}
]
},
"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"
}
]
},
"optInRequired": true
},
{
"resourceType": {
"id": "user",
Expand Down Expand Up @@ -424,6 +497,82 @@
]
}
},
{
"resourceType": {
"id": "volume",
"displayName": "Volume",
"annotations": [
{
"@type": "type.googleapis.com/c1.connector.v2.OptInRequired"
},
{
"@type": "type.googleapis.com/c1.connector.v2.SkipEntitlements"
},
{
"@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"
}
]
}
]
},
"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"
}
]
},
"optInRequired": true
},
{
"resourceType": {
"id": "workspace",
Expand Down
16 changes: 10 additions & 6 deletions docs/connector.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ sidebarTitle: "Databricks"
| 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"/> |
| Tables | <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"/> |
| Volumes | <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"/> |

The Databricks connector supports [automatic account provisioning and deprovisioning](/product/admin/account-provisioning).
Expand All @@ -30,25 +32,25 @@ 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, catalog and schema access in C1
## Metastore, catalog, schema, table and volume access in C1

The connector syncs Databricks [Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog/manage-privileges/privileges)
metastores, the catalogs in them, and the schemas in those catalogs as C1 resources. Each privilege Databricks
metastores, the catalogs in them, the schemas in those catalogs, and the tables and volumes in those schemas as C1 resources. Each privilege Databricks
records on one of them (`CREATE_CATALOG` on a metastore, `USE_CATALOG` or
`SELECT` on a catalog, `USE_SCHEMA` on a schema, and so on) becomes an entitlement in C1, so you can
`SELECT` on a catalog, `USE_SCHEMA` on a schema, `SELECT` on a table, `READ_VOLUME` on a volume, 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.
entitlement — it cannot be granted or revoked through C1. Views, materialized views, metric views and streaming tables are tables; `table_type` picks which privileges can be requested. `ALL_PRIVILEGES` on a view, and `MODIFY` on a streaming table, are shown when they already exist and cannot be requested.

<Note>
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.
The Metastores, Catalogs, Schemas, Tables and Volumes resource types are turned off by default. Turn on the ones you want from the connector's configuration page in C1. Each level syncs under its parent securable, so turn on every level above the one you want; turning on Catalogs alone, or Tables without Schemas, syncs nothing. They all use the same OAuth credentials; no additional configuration fields are needed.
</Note>

<Note>
**Notes on Unity Catalog access in C1:**

- 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.
- Ownership is shown but cannot be provisioned. An owner that is not an account identity, such as `System user`, is not shown. A workspace admins group is shown when it resolves as an account group.
- **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. Their schemas are not synced either.
Expand Down Expand Up @@ -238,6 +240,8 @@ Workspace **Admin** replaces all of this only when the catalog is owned by that
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>

Listing every table or volume needs more than **USE SCHEMA** or **MANAGE**. The service principal must own the metastore, the catalog, or the schema, be a direct Admin when the workspace admins group owns the catalog, or hold **ALL PRIVILEGES** on the catalog. Otherwise the sync fails.

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

- Account ID
Expand Down
12 changes: 8 additions & 4 deletions docs/docs-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ While developing the connector, please fill out this form. This information is n

> The connector syncs the Databricks account, workspaces, users, groups, service principals, and roles.
>
> It also syncs Unity Catalog metastores and their catalogs. Both resource types are opt-in — each stays off until enabled per resource type in C1.
> It also syncs Unity Catalog metastores, catalogs, schemas, tables, and volumes. Those resource types are opt-in — each stays off until enabled per resource type in C1.

2. Can the connector provision any resources? If so, which ones?

> Yes:
>
> - **User accounts**: create and delete account users.
> - **Entitlements**: grant and revoke role and membership assignments on accounts, workspaces, groups, service principals, and roles.
> - **Unity Catalog privileges**: grant and revoke a metastore or catalog privilege for a user, group or service principal. The `owner` entitlement is read-only and cannot be granted or revoked.
> - **Unity Catalog privileges**: grant and revoke a privilege on a metastore, catalog, schema, table, or volume for a user, group or service principal. The `owner` entitlement is read-only and cannot be granted or revoked.

## Connector credentials

Expand Down Expand Up @@ -57,7 +57,7 @@ While developing the connector, please fill out this form. This information is n

- **Direct grants only.** Databricks inherits privileges downward. The connector reports the assignments stored on the object. The inheritance endpoint does not return principal IDs.
- **Full grants visibility is required.** Metastore ownership or direct workspace Admin permits metastore reads. Catalog reads require one of the catalog permissions listed above; workspace Admin applies only when that workspace's admins group owns the catalog. Admin inherited through a group does not count. The sync fails instead of reporting a partial list, so C1 keeps the grants it already has.
- **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.
- **Ownership is read-only.** It is shown and cannot be granted or revoked. An owner that does not resolve to an account identity, such as `System user`, is not shown. A workspace admins group is shown when it resolves as an account group.
- **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 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.
Expand All @@ -70,4 +70,8 @@ While developing the connector, please fill out this form. This information is n
- **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.
- **Tables and volumes are opt-in and hang from a schema.** Each is off until it is turned on in C1, and syncs nothing unless Schemas, Catalogs and Metastores are on as well.
- **A table and a volume are keyed by their full name.** Neither exposes an immutable id, so the resource id extends the schema key: `<metastore id>::<catalog>.<schema>.<name>`. A rename re-keys the resource and its grants, as it does for a catalog and a schema.
- **One `table` securable covers more than tables.** Views, materialized views, metric views and streaming tables are all `table`. `table_type` picks the privilege set, so a table's entitlements are built per instance. `ALL_PRIVILEGES` on a view, `MODIFY` on a streaming table, and `REFRESH` on a type whose grants API refuses it are reported when already held and cannot be requested.
- **Listing a schema's tables or volumes is stricter than listing its schemas.** `USE_SCHEMA` and `ALL_PRIVILEGES` on the catalog each list every schema; only `ALL_PRIVILEGES` lists every table and volume, alongside ownership of the metastore, the catalog or the schema, or direct workspace Admin where the admins group owns the catalog. Reading one table's or one volume's privileges needs ownership of the metastore, the catalog, the schema or the object itself, or `MANAGE` on the object, its schema or its catalog.
- **Not synced yet:** functions, registered models, external locations, storage credentials, connections, shares, recipients, and tags.
1 change: 0 additions & 1 deletion pkg/connector/catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ var errCatalogGone = errors.New("catalog no longer exists")

type catalogBuilder struct {
securableOps
// workspaces is the configured allowlist, empty when none was given.
workspaces map[string]struct{}
}

Expand Down
4 changes: 3 additions & 1 deletion pkg/connector/connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ func (d *Databricks) ResourceSyncers(_ context.Context) []connectorbuilder.Resou
newMetastoreBuilder(d.client, d.clientID, workspaces, principals),
newCatalogBuilder(d.client, d.clientID, workspaces, principals),
newSchemaBuilder(d.client, d.clientID, workspaces, principals),
newTableBuilder(d.client, d.clientID, workspaces, principals),
newVolumeBuilder(d.client, d.clientID, workspaces, principals),
Comment thread
mateoHernandez123 marked this conversation as resolved.
Resolved
}
}

Expand Down Expand Up @@ -76,7 +78,7 @@ func (d *Databricks) Metadata(_ context.Context) (*v2.ConnectorMetadata, error)
return &v2.ConnectorMetadata{
DisplayName: "Databricks",
Description: "Connector syncing Databricks workspaces, users, groups, service principals and roles to Baton, " +
"along with Unity Catalog data assets — metastores, catalogs and schemas — and the privileges granted on them",
"along with Unity Catalog data assets — metastores, catalogs, schemas, tables and volumes — and the privileges granted on them",
AccountCreationSchema: &v2.ConnectorAccountCreationSchema{
FieldMap: map[string]*v2.ConnectorAccountCreationSchema_Field{
"email": {
Expand Down
Loading
Loading