Table: databricks_settings_token - Query Databricks Settings Tokens using SQL
Databricks Settings Tokens are a part of the Databricks service that allows users to manage and control access to the Databricks environment. These tokens are used for authentication and can be scoped to provide specific permissions, allowing for granular control over access and actions within the environment. They are crucial for maintaining security and managing user access within the Databricks platform.
Table Usage Guide
The databricks_settings_token
table provides insights into Settings Tokens within Databricks. As a DevOps engineer or security analyst, explore token-specific details through this table, including permissions, lifespan, and associated metadata. Utilize it to uncover information about tokens, such as those with extensive permissions or nearing expiry, aiding in maintaining security and managing user access within the Databricks platform.
Examples
Basic info
Explore the creation and expiration details of tokens in your Databricks settings to identify who created them and when, providing a comprehensive view of token activity for account management and security purposes.
select token_id, comment, created_by_username, creation_time, expiry_time, account_idfrom databricks_settings_token;
select token_id, comment, created_by_username, creation_time, expiry_time, account_idfrom databricks_settings_token;
List tokens created in the last 30 days
Discover the segments that have been recently created within the last 30 days. This can provide insights into the users' activity and help track any unusual or suspicious behavior.
select token_id, comment, created_by_username, creation_time, expiry_time, account_idfrom databricks_settings_tokenwhere creation_time >= now() - interval '30' day;
select token_id, comment, created_by_username, creation_time, expiry_time, account_idfrom databricks_settings_tokenwhere creation_time >= datetime('now', '-30 day');
List all tokens expiring in the next 7 days
Identify tokens that are set to expire within the upcoming week. This is useful for proactively managing access permissions and avoiding unexpected disruptions.
select token_id, comment, created_by_username, creation_time, expiry_time, account_idfrom databricks_settings_tokenwhere expiry_time > now() and expiry_time < now() + interval '7' day;
select token_id, comment, created_by_username, creation_time, expiry_time, account_idfrom databricks_settings_tokenwhere expiry_time > datetime('now') and expiry_time < datetime('now', '+7 day');
Get number of days each token is valid for
Analyze the validity duration of each token in your Databricks settings to prioritize renewal or removal actions. This helps optimize resource usage and enhance security by preventing the misuse of expired tokens.
select token_id, comment, expiry_time - now() as days_remaining, account_idfrom databricks_settings_tokenorder by days_remaining desc;
select token_id, comment, julianday(expiry_time) - julianday('now') as days_remaining, account_idfrom databricks_settings_tokenorder by days_remaining desc;
List the owner in order of the number of tokens
Analyze the settings to understand the allocation of tokens among owners. This can help in identifying the users who have been assigned the most tokens, enabling better management and distribution of resources.
select owner_id, created_by_username, count(*) as token_countfrom databricks_settings_tokengroup by owner_id, created_by_usernameorder by token_count desc;
select owner_id, created_by_username, count(*) as token_countfrom databricks_settings_tokengroup by owner_id, created_by_usernameorder by token_count desc;
Schema for databricks_settings_token
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form, e.g. connection_name. | |
account_id | text | The Databricks Account ID in which the resource is located. | |
comment | text | Comment that describes the purpose of the token, specified by the token creator. | |
created_by_id | bigint | User id of the user that created the token. | |
created_by_username | text | Username of the user that created the token. | |
creation_time | timestamp with time zone | Timestamp when the token was created. | |
expiry_time | timestamp with time zone | Timestamp when the token expires. | |
owner_id | bigint | User id of the user that owns the token. | |
title | text | The title of the resource. | |
token_id | text | ID of the token. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- databricks
You can pass the configuration to the command with the --config
argument:
steampipe_export_databricks --config '<your_config>' databricks_settings_token