Remediation
From Azure Portalβ
Enable diagnostic logging for Azure Databricksβ
-
Navigate to your Azure Databricks workspace.
-
In the left-hand menu, select
Monitoring>Diagnostic settings. -
Click
+ Add diagnostic setting. -
Under
Category details, select the log categories you wish to capture, such as AuditLogs, Clusters, Notebooks, and Jobs. -
Choose a destination for the logs:
Log Analytics workspace: For advanced querying and monitoring.Storage account: For long-term retention.Event Hub: For integration with third-party systems.
-
Provide a
Namefor the diagnostic setting. -
Click
Save.
Implement log retention policiesβ
- Navigate to your Log Analytics workspace.
- Under
General, selectUsage and estimated costs. - Click
Data Retention. - Adjust the retention period slider to the desired number of days (up to 730 days).
- Click
OK.
Monitor logs for anomaliesβ
- Navigate to
Azure Monitor. - Select
Alerts>+ New alert rule. - Under
Scope, specify the Databricks resource. - Define
Conditionbased on log queries that identify anomalies (e.g. unauthorized access attempts). - Configure
Actionsto notify stakeholders or trigger automated responses. - Provide an Alert rule
nameanddescription. - Click
Create alert rule.
From Azure CLIβ
Enable diagnostic logging for Azure Databricks:
az monitor diagnostic-settings create --name "DatabricksLogging" --resource <databricks-resource-id> --logs '[{"category": "AuditLogs", "enabled": true}, {"category": "Clusters", "enabled": true}, {"category": "Notebooks", "enabled": true}, {"category": "Jobs", "enabled": true}]' --workspace <log-analytics-id>
Implement log retention policies:
az monitor log-analytics workspace update --resource-group <resource-group> --name <log-analytics-name> --retention-time 365
Monitor logs for anomalies:
az monitor activity-log alert create --name "DatabricksAnomalyAlert" --resource-group <resource-group> --scopes <databricks-resource-id> --condition "contains 'UnauthorizedAccess'"