CertLumen

Databricks Data Engineer Associate · Section 7 · 15% of the exam

Understand Unity Catalog ABAC policies to centrally control row-level filtering and column masking for sensitive data.

One of the objectives of the Databricks Certified Data Engineer Associate exam, in the section “Governance and Security”. Here is what it covers, the points to remember and a question to try.

What it covers

Attribute-based access control (ABAC) attaches row filter and column mask policies to a catalog, schema or table and applies them automatically to every table and column whose governed tags match. This lesson covers governed tags, the exact CREATE POLICY syntax, evaluation rules, requirements and when ABAC beats table-level filters and masks.

Points to remember

  • ABAC = governed tags + policies attached to a catalog, schema or table (metastore in Beta); policies apply automatically to current and future matching tables.
  • Governed tags are account-level, have allowed values, inherit from catalog and schema to tables but never to columns; applying one needs ASSIGN on the tag and APPLY TAG on the object.
  • Column mask policy: COLUMN MASK fn TO … [EXCEPT …] FOR TABLES [WHEN …] MATCH COLUMNS cond AS alias ON COLUMN alias [USING COLUMNS (…)].
  • Row filter policy: ROW FILTER fn TO … [EXCEPT …] FOR TABLES [WHEN …] [MATCH COLUMNS …] [USING COLUMNS (…)].
  • WHEN checks table tags (including inherited); MATCH COLUMNS checks column tags only.

Try a question

A governance team wants every column tagged pii = ssn in any table of the hr catalog, including tables created in the future, to be masked for all users except the hr_admins group. The masking UDF hr.gov.mask_ssn(ssn STRING) already exists. Which statement achieves this?

  1. ACREATE POLICY mask_ssn ON CATALOG hr COLUMN MASK hr.gov.mask_ssn TO account users EXCEPT hr_admins FOR TABLES MATCH COLUMNS has_tag_value('pii', 'ssn') AS ssn_col ON COLUMN ssn_col
  2. BALTER CATALOG hr SET MASK hr.gov.mask_ssn ON COLUMNS WITH TAG pii = 'ssn' EXCEPT hr_admins
  3. CCREATE POLICY mask_ssn ON CATALOG hr COLUMN MASK hr.gov.mask_ssn TO hr_admins FOR TABLES WHEN has_tag_value('pii', 'ssn')
  4. DCREATE POLICY mask_ssn ON CATALOG hr ROW FILTER hr.gov.mask_ssn TO account users EXCEPT hr_admins FOR TABLES MATCH COLUMNS has_tag_value('pii', 'ssn') AS ssn_col USING COLUMNS (ssn_col)
Show the answer

A. A column mask policy names the UDF, the principals it applies to (TO) and those exempt (EXCEPT), targets FOR TABLES, identifies columns with MATCH COLUMNS on column tags, and binds the matched column with ON COLUMN. Attached to the catalog, it covers current and future tables whose columns carry the tag.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson ABAC Policies & Governed Tags teaches this objective (about 45 minutes), and 9 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

← Previous objective · All 29 objectives