Databricks personal access token lifetime is unspecified

Limit Databricks personal access tokens to the time needed for their purpose.

Description

Set lifetime_seconds on databricks_token to the time the task needs. If omitted, the workspace or platform maximum applies.

Potential impact

An exposed token carries the issuing user’s permissions until it expires or is revoked.

Remediation

For planned rotation, issue a replacement before expiry, update the systems that use it and test their connections. Revoke exposed tokens. A lifetime setting does not distribute replacement credentials.

Examples

The example uses 8640000 seconds, or 100 days. Choose a duration within the workspace limit and configure the databricks.created_workspace provider.

Before

hcl
resource "databricks_token" "example" {
  provider = databricks.created_workspace
  comment  = "Terraform Provisioning"
}

After

hcl
resource "databricks_token" "example" {
  provider         = databricks.created_workspace
  comment          = "Terraform Provisioning"
  lifetime_seconds = 8640000
}

References