Databricks Unity Catalog Query Audit Logs
Native query audit for Databricks Unity Catalog captures user data access within Unity Catalog and presents them in a universal format as Immuta audit logs. Multiple access options are supported for audit:
Cluster queries with the following supported languages: SQL, Scala, Python, and R.
SQL warehouse queries
Immuta audits the activity of all Unity Catalog users and tables regardless of whether they are registered in Immuta.
Requirements
A Databricks deployment with system tables capabilities
Store audit logs
By default Databricks Unity Catalog audit logs expire after 90 days. Export the universal audit model (UAM) logs to S3 or ADLS Gen2, and store audit logs outside of Immuta in order to retain the audit logs long-term.
Audit frequency
Immuta collects audit records at the frequency configured when enabling the integration, which is between 1 and 24 hours. The frequency is a global setting based on integration type, so organizations with multiple Unity Catalog integrations will have the same audit frequency for all of them. The more frequent the audit records are ingested, the more current the audit records; however, there could be performance and cost impacts from the frequent jobs. Immuta will start a Databricks cluster to complete the audit ingest job if one is not already running.
To manually prompt the native query audit, click Load Audit Events on the Immuta audit page.
Audit scope
Immuta audits all data sources and users in Unity Catalog. An administrator can configure the integration to just ingest specific workspaces when enabling the integration.
Audit schema
Each audit message from the Immuta platform will be a one-line JSON object containing the properties listed below.
Property | Description | Example |
---|---|---|
action | The action associated with the audit log. |
|
actor.type | The Immuta user type of the actor who made the query. When the actor is not registered with Immuta, the |
|
actor.id | The Immuta user ID of the actor who made the query. When the actor is not registered with Immuta, the |
|
actor.name | The Immuta name of the user who made the query. When the user is not registered with Immuta, the |
|
actor.identityProvider | The IAM the user is registered in. |
|
actor.profileId | The profile ID of the user who made the query. When the user is not registered with Immuta, this field will be omitted. |
|
sessionId | The session ID of the user who performed the action. |
|
requestId | The API request ID that triggered the action, if applicable. |
|
actionStatus | Indicates whether or not the user was granted access to the data. Possible values are |
|
actionStatusReason | When available, the reason from Unity Catalog that the user’s query was denied. |
|
eventTimestamp | The time the query occurred. |
|
id | The unique ID of the audit record. |
|
tenantId | The Immuta SaaS tenant ID. |
|
userAgent | Client information of the user who made the query. | - |
targetType | The type of targets affected by the query; this value will always be |
|
targets | A list of the targets affected by the query. | See the example below |
auditPayload.type | The type of audit record; this value will always be: |
|
auditPayload.queryId | The unique ID of the query. If the query joins multiple tables, each table will appear as a separate log, but all will have the same query ID. |
|
auditPayload.query | The command text of the query that was run in the integration. Immuta truncates the query text to the first 2048 characters. |
|
auditPayload.startTime | The date and time the query started in UTC. |
|
auditPayload.duration | The time the query took in seconds. |
|
auditPayload.errorCode | The |
|
auditPayload.technologyContext.type | The technology the query was made in. |
|
auditPayload.technologyContext.clusterId | The Unity Catalog cluster ID. |
|
auditPayload.technologyContext.workspaceId | The Unity Catalog workspace ID. |
|
auditPayload.technologyContext.service | Where in Unity Catalog the query was made. Possible values are |
|
auditPayload.technologyContext.warehouseId | The Unity Catalog warehouse ID. |
|
auditPayload.technologyContext.notebookId | The Unity Catalog notebook ID. |
|
auditPayload.technologyContext.account.id | The actor’s Unity Catalog account ID |
|
auditPayload.technologyContext.account.username | The actor’s Unity Catalog username. |
|
auditPayload.technologyContext.host | The Unity Catalog host. |
|
auditPayload.technologyContext.clientIp | The IP address of the Spark cluster the request is coming from. |
|
auditPayload.objectsAccessed | The Unity Catalog objects accessed. |
|
auditPayload.securityProfile.sensitivity.score | The sensitivity score of the query. Classification must be configured for this field. |
|
auditPayload.version | The version of the audit event schema. |
|
receivedTimestamp | The timestamp of when the audit event was received and stored by Immuta. |
|
Example audit record
Limitations
Enrichment of audit logs with Immuta entitlements information is not supported. While you will see these entitlements in the Databricks Spark audit logs, the following will not be in the native query audit for Unity Catalog:
Immuta policies information
User attributes
Groups
Immuta determines unauthorized events based on error messages within Unity Catalog records. When the error messages contain expected language, unauthorized events will be available for native query audit for Unity Catalog. In other cases, it is not possible to determine the cause of an error.
Audit for cluster queries do not support
UNAUTHORIZED
status. If a cluster query is unauthorized, it will showFAILURE
.Data source information will be provided when available:
For some queries, Databricks Unity Catalog does not report the target data source for the data access operation. In these cases the activity is audited, yet the audit record in Immuta will not include the target data source information.
Data source information is not available for unauthorized queries and events.
Column information from the query is not currently supported.
Immuta audit records include unregistered data sources and users; however, activity from them will not appear in any governance reports.
Last updated