Home / Databricks on Azure

Databricks on AzureRunbookAdvanced

Sev1: a sensitive Unity Catalog table was exposed to all users or shared with the wrong Delta Sharing recipient

A PII or finance table was granted to account users or added to the wrong share. Revoke access first, then use audit and lineage system tables to work out who read the data and what to report.

Deepak Bhardwaj6 min read

Applies toAzure Databricks Unity Catalog, Delta Sharing (Databricks-to-Databricks and open sharing), system tables system.access.audit and system.access.table_lineage

Symptoms

Someone reports one of these:

  • SHOW GRANTS on a PII, payroll or customer table lists account users, users or a large group that should not be there.
  • A table or schema holding sensitive data was added to a Delta Share, or a share was granted to the wrong recipient (another business unit, a vendor, a test recipient with an open-sharing token).
  • A row filter or column mask was dropped, so a broad group now sees raw values.

Treat this as a security incident. The order matters: contain first, investigate second. Every minute of open access can mean more reads.

Caution

Do not drop the table, the share or the recipient to "remove" exposure. Dropping destroys the configuration you need for the investigation, and dropping a table can break lineage history. Revoke privileges instead, and keep the objects.

1. Contain (first 10 minutes)

Revoke the broad grant at the level where it was given. Check the catalog and schema, not just the table:

SHOW GRANTS ON TABLE hr.payroll.salaries;
SHOW GRANTS ON SCHEMA hr.payroll;
SHOW GRANTS ON CATALOG hr;

REVOKE SELECT ON TABLE hr.payroll.salaries FROM `account users`;
REVOKE USE SCHEMA, SELECT ON SCHEMA hr.payroll FROM `account users`;

For Delta Sharing, remove the recipient's access to the share, then remove the table from the share if it should never have been there:

SHOW GRANTS ON SHARE finance_partner_share;
REVOKE SELECT ON SHARE finance_partner_share FROM RECIPIENT vendor_x;

SHOW ALL IN SHARE finance_partner_share;
ALTER SHARE finance_partner_share REMOVE TABLE hr.payroll.salaries;

For an open-sharing recipient (token-based), also rotate or expire its token so a downloaded credential file stops working. Do this in Catalog > Delta Sharing > Recipients > recipient > Rotate token, setting the existing token to expire immediately.

If a mask or filter was dropped, put it back before you restore any access:

ALTER TABLE hr.payroll.salaries ALTER COLUMN national_id SET MASK governance.masks.mask_national_id;
ALTER TABLE hr.payroll.salaries SET ROW FILTER governance.filters.hr_region_filter ON (region);

Then stop whatever made the change. If a Terraform pipeline or a script granted it, pause that pipeline now so the next run doesn't put the grant back.

2. Confirm scope (who could see what, since when)

Find when the grant was added and by whom:

SELECT event_time, user_identity.email, action_name,
       request_params.securable_type, request_params.securable_full_name, request_params.changes
FROM system.access.audit
WHERE service_name = 'unityCatalog'
  AND action_name = 'updatePermissions'
  AND event_time > now() - INTERVAL 30 DAYS
  AND request_params.securable_full_name IN ('hr', 'hr.payroll', 'hr.payroll.salaries')
ORDER BY event_time;

For shares, look for share and recipient changes in the same window:

SELECT event_time, user_identity.email, action_name, request_params
FROM system.access.audit
WHERE service_name = 'unityCatalog'
  AND (action_name ILIKE '%share%' OR action_name ILIKE '%recipient%')
  AND event_time > now() - INTERVAL 30 DAYS
ORDER BY event_time;

The exposure window runs from the first grant event to your revoke in step 1.

3. Find who actually read the data

Use lineage for reads by queries, notebooks and jobs:

SELECT event_time, created_by, entity_type, entity_id, source_type, target_table_full_name
FROM system.access.table_lineage
WHERE source_table_full_name = 'hr.payroll.salaries'
  AND event_time BETWEEN '2026-11-10T08:00:00' AND '2026-11-13T11:30:00'
ORDER BY event_time;

Rows with a target_table_full_name mean the data was copied somewhere. Those copies need the same cleanup and grant review.

Cross-check with audit events that mention the table. Parameter names differ by action, so search the whole parameter map:

SELECT event_time, user_identity.email, service_name, action_name, source_ip_address
FROM system.access.audit
WHERE event_time BETWEEN '2026-11-10T08:00:00' AND '2026-11-13T11:30:00'
  AND to_json(request_params) ILIKE '%hr.payroll.salaries%'
ORDER BY event_time;

For Delta Sharing recipients, look for recipient-side query events in the audit log. Action names for share reads vary by sharing type and release, so filter by the share or recipient name in request_params the same way. Exclude the people who were supposed to have access, and the result is your list of unexpected readers.

Finding Next action
No reads by unexpected principals Document it. A near miss is still worth a short report.
Reads by internal users Ask managers to confirm, and check for exports or copies (lineage targets, downloads).
Data copied into other tables Restrict or delete those copies. Review their grants.
Reads by an external recipient Escalate to privacy/legal now. Regulatory notice deadlines may apply.

Warning

System tables can lag behind real time. Re-run the queries after a few hours before you close the scope assessment. Lineage does not capture every access path, so record that limitation in the incident report.

4. Restore correct access

Grant back only to the intended groups, at the narrowest level:

GRANT USE CATALOG ON CATALOG hr TO `hr-analysts`;
GRANT USE SCHEMA ON SCHEMA hr.payroll TO `hr-analysts`;
GRANT SELECT ON TABLE hr.payroll.salaries TO `hr-analysts`;
SHOW GRANTS ON TABLE hr.payroll.salaries;

Test as a user who should not have access (or use a test account in a broad group) and confirm SELECT fails with PERMISSION_DENIED.

5. Verify containment

  • SHOW GRANTS at catalog, schema and table level shows no broad groups.
  • SHOW ALL IN SHARE no longer lists the table. The wrong recipient has no grant on the share.
  • Masks and row filters show in DESCRIBE TABLE EXTENDED hr.payroll.salaries.
  • The automation that made the change is fixed or disabled.

Communicate

Keep the first message factual and internal (security, data owner, privacy):

"At HH:MM we found that hr.payroll.salaries was readable by [all account users / recipient X] from [start] to [revoke time]. Access was revoked at HH:MM. We are reviewing audit and lineage data to identify reads and will update by HH:MM." Do not tell affected individuals or regulators anything until privacy/legal has reviewed the scope.

Prevent it next time

  • Never grant on catalogs or schemas to account users. Add a scheduled SQL alert that queries system.information_schema.table_privileges and schema_privileges for grants to broad groups on tagged sensitive objects.
  • Tag sensitive tables (ALTER TABLE ... SET TAGS ('pii' = 'true')) and use ABAC policies or masks so a wrong grant still shows masked values.
  • Require a second approver for share and recipient changes. Keep a small owner group on each share.
  • Alert on updatePermissions events for sensitive catalogs, and on share and recipient changes.
  • Run grant changes through Terraform with plan review, and fail plans that add broad principals to tagged objects.