Auditing User Access in Databricks with System Tables: From Basics to Advanced


๐Ÿ” Auditing User Access in Databricks with System Tables: From Basics to Advanced

Managing and auditing user access is a critical part of maintaining a secure and compliant data platform. With the rise of multi-tenant workspaces and collaborative environments, Databricks’ Unity Catalog combined with system tables provides a powerful and scalable way to track and audit user activities and access.

In this blog, weโ€™ll walk through the end-to-end process of auditing user access in Databricks, starting from the basics and advancing into more granular and complex techniques using system tables.


๐Ÿ“˜ Table of Contents

  1. Introduction to Unity Catalog & System Tables
  2. Key System Schemas for Auditing
  3. Getting Started: Viewing Grants and Permissions
  4. Tracking Access Patterns and Activity
  5. Advanced Auditing with Join Scenarios
  6. Visualizing Audit Data
  7. Security Best Practices for Access Audits
  8. Conclusion

1. ๐Ÿง  Introduction to Unity Catalog & System Tables

Unity Catalog is Databricksโ€™ unified governance solution for data and AI assets. It enables centralized access control, auditing, and lineage tracking across all Databricks workspaces.

To support auditing, system tables were introduced. These are built-in tables automatically populated by Databricks and can be queried like regular tables using SQL.

Why System Tables Matter:

  • Centralized logging of user actions
  • SQL-based access to audit data
  • Ready integration with BI tools
  • Real-time monitoring capabilities

2. ๐Ÿ—ƒ๏ธ Key System Schemas for Auditing

Schema NamePurpose
system.accessTracks access events, successful and failed
system.computeLogs cluster and compute usage events
system.billingTracks usage and cost details
system.information_schemaShows grants, users, and privileges

3. ๐Ÿงพ Getting Started: Viewing Grants and Permissions

Start with the information_schema.table_privileges table to understand who has access to what.

๐Ÿ” Example 1: List all table-level privileges

SELECT *
FROM system.information_schema.table_privileges
WHERE grantee LIKE '%@%';  -- filters for users

๐Ÿ” Example 2: View privileges granted to groups

SELECT *
FROM system.information_schema.table_privileges
WHERE grantee_type = 'GROUP';

๐Ÿ” Example 3: Check privileges for a specific schema or user

SELECT *
FROM system.information_schema.schema_privileges
WHERE grantee = 'analyst_group';

These tables show:

  • Object names
  • Privilege types (SELECT, MODIFY, etc.)
  • Grantor/grantee details

4. ๐Ÿ“Š Tracking Access Patterns and Activity

Use the system.access.audit table for detailed logs on access events. This table logs actions such as read/write access, permission changes, and login attempts.

๐Ÿ” Example 4: Track who accessed which table

SELECT user_identity.email, object_name, action_name, event_time
FROM system.access.audit
WHERE action_name = 'SELECT'
  AND object_type = 'TABLE'
  AND event_time >= current_date() - INTERVAL 7 days
ORDER BY event_time DESC;

๐Ÿ” Example 5: Detect failed access attempts

SELECT *
FROM system.access.audit
WHERE status != 'SUCCESS'
ORDER BY event_time DESC;

5. ๐Ÿ”ฌ Advanced Auditing with Join Scenarios

You can join multiple system tables to enrich your access audit reports.

๐Ÿ” Example 6: Join access logs with cluster metadata

SELECT a.user_identity.email, a.action_name, a.object_name, c.cluster_id, c.cluster_name
FROM system.access.audit a
JOIN system.compute.clusters c
  ON a.request_params:cluster_id = c.cluster_id
WHERE a.event_time >= current_date() - INTERVAL 30 days;

๐Ÿ” Example 7: Map user actions to workspace names

If you manage multiple workspaces, you can tag audit entries with workspace identifiers via metadata or custom tagging (using custom_tags on clusters or jobs).


6. ๐Ÿ“ˆ Visualizing Audit Data

Databricks system tables can be connected to Power BI, Tableau, or Databricks SQL Dashboards for visual insights.

Dashboard Ideas:

  • Weekly user access heatmaps
  • Top 10 most accessed datasets
  • Anomalous access detection (e.g., SELECTs on rarely used tables)
  • Failed access attempt trends

7. ๐Ÿ” Security Best Practices for Access Audits

  • Enable Unity Catalog across all workspaces to centralize control
  • Use Groups over individual users for easier privilege management
  • Set up alerts on unusual activity (e.g., many failed attempts)
  • Regularly review information_schema grants for overprovisioned access
  • Use column-level lineage to understand downstream impacts of data reads

8. โœ… Conclusion

Auditing user access in Databricks has never been easier thanks to system tables and Unity Catalog. Whether you’re doing a quick compliance check or building a full-fledged monitoring solution, these tools offer deep insights with simple SQL.

By following the steps outlined aboveโ€”from basic queries to complex joins and dashboardsโ€”you can build a robust and automated access auditing framework.


๐Ÿ”— Resources


Related Posts

Z-ORDER in Databricks: Magic or Myth?

When it helps, when it hurts, how to pick columns, and what KPIs to measure. Introduction: Why the Hype Around Z-ORDER? If youโ€™ve spent time in Databricks,…

Read More

Taming Small Files in Delta Lake

Optimal file sizes, compaction strategies, and how to keep your Delta tables lightning-fast Why Small Files Are a Big Problem Delta Lake is powerful, but it inherits…

Read More

Databrick Serverless compute plane networking

Hereโ€™s a simple line-by-line summary of the Serverless compute plane networking (08/04/2025): General idea Serverless egress control (outbound connections) Network Connectivity Configuration (NCC) What NCC enables: Extra…

Read More

Databrick Serverless compute limitations

Hereโ€™s a simple, line-by-line summary of the Serverless compute limitations (09/29/2025): General limitations Streaming limitations Machine learning limitations Notebook limitations Job limitations Compute-specific limitations Caching limitations Hive…

Read More

Best practices for Databrick serverless compute

Best practices for serverless compute Big picture Before you migrate Ingesting data (getting data in) Querying external data (without moving it) Spark configurations Watch your costs Quick…

Read More

Databrick Serverless compute release

Hereโ€™s a simple line-by-line summary of the important points from the Serverless Compute release notes (09/24/2025): Perfect ๐Ÿ‘ Hereโ€™s a one-page cheat sheet table for the Serverless…

Read More
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x