Databricks - Data Engineer Associate Study Guide

    7: Governance and Security

    This chapter closes the loop on the Databricks Data Intelligence Platform by turning Unity Catalog into the single governance surface for the lakehouse. It walks through managed and external tables, the GRANT, REVOKE, and DENY model across the security hierarchy, column masks and row filters as SQL UDFs attached to tables, and ABAC policies that apply masking and filtering centrally by tag.

    Learning Objectives

    By the end of this chapter, you will be able to:

    • Differentiate between managed and external tables in Unity Catalog and perform basic operations (create, modify, delete, and convert between them).
    • Configure access controls via UI and SQL by applying GRANT, REVOKE, and DENY privileges to principals (users, groups, service principals) at the appropriate levels of the security hierarchy.
    • Understand column-level masking and row-level security to restrict data visibility by user group.
    • Understand Unity Catalog ABAC policies to centrally control row-level filtering and column masking for sensitive data.

    Executive Summary

    • Managed tables live in Unity Catalog-controlled storage and follow drop-equals-delete semantics, while external tables point at customer-owned paths under an external location and survive a DROP TABLE as files on object storage.
    • Privileges flow down the metastore, catalog, schema, securable hierarchy: GRANT extends access, REVOKE rolls it back, and DENY blocks it even when an inherited grant would otherwise allow it.
    • Column masks and row filters are SQL UDFs attached to a table; they run on every read and typically branch on is_account_group_member() so visibility varies by who issued the query.
    • ABAC policies define one mask or row filter once and apply it to every column or table that carries a matching tag, replacing the per-table attachment pattern.

    Assumptions

    • Unity Catalog is enabled at the account level with a metastore attached to the workspace, as described in Chapter 1.
    • The reader has owner or sufficient privileges to create schemas, tables, functions, and policies, and to grant privileges in the workspace.
    • All examples assume the catalog fin_lakehouse, the schemas bronze, silver, and gold, and the customer and transaction tables built in earlier chapters.
    • Group names follow the convention grp_<role>_<env> (for example grp_analyst_prod, grp_pii_reader_prod) and are managed at the account level, then assigned into the workspace.

    Sections in this chapter

    1. Free
    2. Free with account
    3. Free with account
    4. Free with account
    5. Free with account