Description
Export the log categories you need from a Premium Azure Databricks workspace through diagnostic settings. For account-level events and other events unavailable through diagnostic settings, query system.access.audit from a Unity Catalog-enabled workspace with permission to read the table.
Potential impact
Without these records, it is difficult to trace who changed a cluster or ran a job. The records themselves can contain sensitive data.
Remediation
Check supported categories and existing collection paths, then select a destination such as Log Analytics, a storage account or Event Hubs. If you select jobs as shown, run a test job and find its record at the destination. Restrict read access and set retention for the logs.
Examples
The excerpts reference an existing resource group and Log Analytics workspace.
Before
resource "azurerm_databricks_workspace" "example" {
name = "secure-databricks-ws"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
sku = "premium"
}
After
resource "azurerm_monitor_diagnostic_setting" "example" {
name = "databricks-diagnostic-logs"
target_resource_id = azurerm_databricks_workspace.example.id
log_analytics_workspace_id = azurerm_log_analytics_workspace.example.id
enabled_log {
category = "accounts"
}
enabled_log {
category = "Filesystem"
}
enabled_log {
category = "clusters"
}
enabled_log {
category = "notebook"
}
enabled_log {
category = "jobs"
}
}
resource "azurerm_databricks_workspace" "example" {
name = "secure-databricks-ws"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
sku = "premium"
}
The second excerpt sends five categories to Log Analytics, covering authentication, file operations, clusters, notebooks and jobs.