Prepstellar

DP-700 · Access Control and Data Masking

28 cards

OneLake Row, Column, and Folder Security

Swipe, scroll or use ← →
  1. Three controls inside one role

    Sharing a whole lakehouse is often too coarse. One table belongs to finance, one column holds salaries, and one group of rows belongs to a single region. A OneLake security role can solve the three problems, because within a role you can refine access at three levels of granularity.

    Control What it limits Where it works
    Object-level security (OLS) Which tables or folders the role can access Tables, schemas, and folders
    Column-level security (CLS) Which columns of a table the role can access Tables
    Row-level security (RLS) Which rows of a table the role can access Tables
    1 / 28
  2. Three controls inside one role

    Inside one role the three controls apply together, so OneLake takes their intersection. A member receives only the access allowed by the object, row, and column settings of that role.

    You set them in one place. Open the item, select Manage OneLake security, and open a role. The tables and folders added to the role are its object-level security. To restrict a table further, select more options next to the table and choose Row security or Column security.

    One condition comes from the role itself. You can apply row-level security and column-level security only to roles that grant Read permission. Creating roles and choosing their permissions and members is the subject of the lesson on OneLake security roles. That lesson also covers the DefaultReader role and the time a change takes to apply. This lesson is about the three controls.

    2 / 28
  3. Quick check

    One role grants the Orders table, hides its Discount column, and has a row rule for the West region. A user belongs to this role and to no other. What does the user read in Orders?

    1. AThe West rows, without the Discount column

      Right. Inside one role the object, row, and column settings apply together, so the user gets their intersection.

    2. BEvery row, and the Discount column only for the West rows

      The two rules are not alternatives. Inside one role they apply together: the row rule removes the other regions and the column rule removes Discount in every row.

    3. CEvery row and column, because the table grant is wider than the two rules

      A table grant does not cancel the rules of its own role. OneLake resolves a role as the intersection of its object, row, and column settings.

    3 / 28

  4. Tables, schemas, and folders as objects

    Object-level security answers the first question: which objects exist for this role. Table-level and folder-level security, also called object-level security, lets you grant access to specific tables or folders in a data item.

    One mechanism covers a lot, because of how OneLake stores data. Delta Parquet tables in OneLake are represented as folders, so you can secure tables the same way you secure folders. Schemas are also folders, so you can secure them the same way. With object-level security you create permissions for both structured and unstructured data at the folder level.

    Object What it is in OneLake Secured with
    Delta Parquet table A folder Object-level security
    Schema A folder Object-level security
    Directory of files under Files/ A folder Object-level security

    Row and column rules need a table. Object-level security is the control that also reaches files.

    4 / 28
  5. Tables, schemas, and folders as objects

    Not every folder is a table. For OneLake security and the query engines, a folder is a valid table only when it meets three conditions:

    • The folder exists in the Tables/ directory of the item. In a schema-enabled item, the folder must also be in a valid schema folder.
    • The folder contains a _delta_log folder with the JSON files for the table metadata.
    • The folder does not contain any child shortcuts.

    This matters when you add rules. If you configure RLS or CLS on a table, OneLake denies access when the table's folder does not meet these conditions. Without RLS or CLS, OneLake treats a folder that does not meet the conditions as a folder and applies folder-level security.

    5 / 28
  6. Tables, schemas, and folders as objects

    What does a user see of an object that no role grants? For users with no access to a table, the data is never exposed. Names are a different matter. OneLake security does not guarantee that the metadata for a table is not accessible, and certain error messages and experiences might show column names.

    The SQL analytics endpoint has its own behavior here. The SQL analytics endpoint always returns all schema names in object metadata, regardless of the user's table-level permissions. Tables for which the user has no permission are filtered out and do not appear in the listing. As a result, users may see schemas that contain no visible tables. An empty schema in the object explorer is therefore not a security error.

    6 / 28
  7. Quick check

    A folder under `Tables/` holds Parquet files but has no `_delta_log` folder. A role includes it and adds a row rule on it. What do the members of the role get?

    1. AThe files of the folder, because the row rule is skipped

      Skipping the rule is what happens without RLS or CLS: then OneLake treats it as a plain folder. With a rule configured, OneLake denies access.

    2. BNo access, because OneLake denies it

      Right. A folder without `_delta_log` is not a valid table, and OneLake denies access when RLS or CLS is configured on such a folder.

    3. CThe allowed rows, but only from a Spark notebook

      No engine can filter rows here, because the folder is not a valid table. OneLake denies access when a rule is configured on it.

    7 / 28

  8. Folder grants: inheritance and traversal

    A grant on a folder affects the hierarchy in two directions, and they do different things.

    Inheritance goes down. Permissions granted on a folder apply downward to its files and subfolders.

    Traversal and listing go up. When users have permission on a child item, OneLake security lets them list and traverse its parent folders, so they can navigate to the data they can access. Traversal does not grant access to sibling files or folders.

    Take a lakehouse where Files/folder1 contains file11.txt and subfolder11, and Files/folder2 contains file21.txt. A role grants Read on subfolder11.

    Path Result for a member of the role
    subfolder11 and everything below it Readable, through inheritance
    Files and folder1 Can be traversed to reach subfolder11
    file11.txt Not visible, because it is a sibling of subfolder11
    Tables Not visible, because it is a sibling of Files

    A second role that grants Read on folder2 lets its members read file21.txt and traverse Files, but they cannot see folder1 or any of its children.

    8 / 28
  9. Quick check

    A role grants Read on `Files/Reports/2026` and on nothing else. Why can a member open `Files/Reports` in the explorer?

    1. ABecause every role grants the `Files` directory by default

      No role grants `Files` by default. The member reaches `Reports` because traversal opens the parent folders of the granted folder.

    2. BBecause inheritance extends a grant to the parent folders

      Inheritance goes down, to the files and subfolders of the granted folder. The path up is opened by traversal.

    3. CBecause traversal lets members list the parents of a granted folder

      Right. With permission on a child item, a user can list and traverse its parent folders, without getting access to sibling files or folders.

    9 / 28

  10. Keep your progress in the app

    That’s 3 of 10 quick checks. In the app they stay answered, and every lesson remembers where you left off.

    Opens in your browser. Nothing to install.

    Start studying

    On your phone, with the same account

    Get it on Google Play Download on the App Store
    Keep reading here
  11. Column-level security: an allow list

    Column-level security protects the sensitive column of a table that the role is allowed to read. Column-level security grants access to selected columns in a table instead of the full table. Data in columns that you remove from the allowed list is not visible to users.

    By default, users have access to all columns. To restrict a column, open Column security on the table in the role and set the column permission to Hide. At least one column must remain in the list of allowed columns. You can define column-level security for any Delta Parquet table.

    Values and names are treated differently. The name of a secured column might be visible in certain experiences, but the data values never appear. In the SQL analytics endpoint, users might see columns in Object Explorer or sys.columns even when column-level security prevents them from reading those columns. This behavior is by design.

    10 / 28
  12. Column-level security: an allow list

    A query that asks for every column meets a problem: some of those columns are hidden. The engines solve it in different ways.

    Engine Result of SELECT * when some columns are hidden
    Spark notebooks The query succeeds and shows only the allowed columns.
    SQL analytics endpoint The query returns an error and blocks access to the columns the user cannot access.
    Semantic models The query returns an error and blocks access to the columns the user cannot access.

    So the same role looks tolerant in a notebook and strict in the SQL analytics endpoint. The rule is the same in both. Only the handling of the request for every column differs.

    11 / 28
  13. Column-level security: an allow list

    The allow list is tied to column names. In the SQL analytics endpoint, renaming or removing an allowed column invalidates the security rule, and the rule then denies all access to the table until the original column naming is restored.

    If the new name has to stay, the rule is what you change. Update or remove the affected roles, in the lakehouse where the role was created. Waiting does not help: when a policy is invalid, metadata sync is blocked by design until the rule is corrected in the OneLake security panel. A SQL GRANT does not help either: in user identity mode, where the endpoint enforces OneLake roles, you cannot define RLS, CLS, or OLS directly using T-SQL.

    12 / 28
  14. Quick check

    An admin wants the members of a role to read no column of the Payroll table, and tries to hide every column in Column security. Why does this fail?

    1. ABecause hidden columns still show their values in Spark notebooks

      Hidden columns never show their values. In a Spark notebook a `SELECT *` succeeds and shows only the allowed columns.

    2. BBecause at least one column must remain in the allowed list

      Right. Column security cannot hide a whole table, because at least one column must remain in the list of allowed columns.

    3. CBecause column rules can be defined only on folders under `Files/`

      It is the opposite. Column-level security is defined on Delta Parquet tables, and a folder of files has no columns.

    13 / 28

  15. Row-level security: a rule that filters rows

    Row-level security is for a table that everybody in the role may read, but not completely. You define roles that contain rules for filtering rows of data for members of the role. When a member of an RLS role queries the data, OneLake evaluates the RLS rules and returns only the allowed rows.

    Rows are a concept relevant only to tabular data, so you cannot define RLS for non-table folders or unstructured data. You define RLS rules in a role that grants access to table data in Delta Parquet format.

    Which engines can filter a table with these rules, and when OneLake blocks the read, is covered in the lesson on OneLake security enforcement.

    14 / 28
  16. Quick check

    A role must give a group access to the invoices of only one customer. The invoices exist as a Delta Parquet table and also as PDF files in a folder under `Files/`. Where can a row rule do this?

    1. AOn the folder of PDF files, once it is added to the role

      A folder of PDF files has no rows. It can be granted or left out as an object, but RLS cannot be defined for non-table folders or unstructured data.

    2. BOn both, because tables and folders are secured the same way

      Tables and folders are secured the same way at object level only. Row rules need tabular data, so the folder of files cannot have one.

    3. COn the Delta Parquet table, because rows exist only in tabular data

      Right. RLS rules are defined in a role that grants access to table data in Delta Parquet format, and never on unstructured data.

    15 / 28

  17. Writing the row rule

    To write the rule, open the role details page, select more options next to the table, and select Row security. In the code editor, type the SQL statement that defines which rows users can see, and select Save.

    RLS rules use SQL syntax to specify the rows that a user can see. The syntax takes the form of a SQL SELECT statement with the RLS rules defined in the WHERE clause:

    SELECT * FROM Sales WHERE Amount > 50000 AND State='CA'
    

    Every rule starts with SELECT * FROM and the table name. The conditions come after WHERE. A member of a role with this rule sees the rows of Sales in which Amount is greater than 50000 and State is CA. A row with an Amount of exactly 50000 is not greater than 50000, so it stays hidden.

    Part of the rule What to write
    Schema name If the item supports schemas, you must include the schema name before the table name.
    Table name It must exactly match the name of the table, or the rule shows no rows.
    Conditions One or more Boolean statements separated by AND or OR.

    Each Boolean statement has a column name, an operator, and a static value or set of values to evaluate against.

    16 / 28
  18. Writing the row rule

    RLS rules support only a subset of SQL.

    Operators and keywords Use
    =, <>, >, >=, <, <= Compare a column with a value
    IN, NOT Compare a column with a set of values
    AND, OR Combine two statements
    IS NULL, IS BLANK Find rows with no value

    AND needs both statements to be true. OR needs one of them to be true.

    Three more facts decide how a rule behaves.

    • Row-level security evaluates string data as case insensitive.
    • The maximum number of characters in a row-level security rule is 1000.
    • RLS roles do not support dynamic and multitable queries.

    As a best practice, avoid vague or overly complex RLS expressions. Strongly typed expressions with integer or string lookups that use the equals operator are the most secure and the easiest to understand.

    17 / 28
  19. Quick check

    A lakehouse with schemas has the table Orders in the schema sales. Which row rule shows the members of a role only the rows of the West region?

    1. A`SELECT * FROM Orders WHERE Region = 'West'`

      The schema is missing. If the item supports schemas, the rule must include the schema name before the table name.

    2. B`SELECT * FROM sales.Orders WHERE Region = 'West'`

      Right. The rule is a `SELECT * FROM` statement with the schema and the table, and the condition goes in the `WHERE` clause.

    3. C`SELECT Region FROM sales.Orders WHERE Region = 'West'`

      A row rule always starts with `SELECT * FROM`. Choosing columns is the job of column-level security, not of the row rule.

    18 / 28

  20. When a rule stops matching its table

    A rule is written for one table and must keep matching it. The table shows what happens when it does not.

    Problem Result
    A CLS or RLS rule references a column that is not in the table The query fails and returns no data.
    The RLS statement has syntax errors that prevent it from being evaluated Access to the table might be blocked.
    A column used in a row rule is deleted or renamed, and the SQL analytics endpoint enforces OneLake roles The endpoint database enters an error state until the policy is fixed.
    A table is renamed The role loses its association with the table.

    Two of these rows need a comment. To correct a rule that references a deleted or renamed column, update or remove the affected roles, or restore the missing column, and make the update in the lakehouse where the role was created.

    A rename is the dangerous case. OneLake security roles are tied to the table name. Renaming a table breaks the association, and policies do not migrate automatically, which can result in unintended data exposure until policies are reapplied.

    19 / 28
  21. Quick check

    A column used in a row rule is deleted from its table, and the SQL analytics endpoint enforces OneLake roles. What happens at the endpoint?

    1. AThe endpoint database enters an error state until the policy is fixed

      Right. A row rule that references a deleted or renamed column puts the endpoint database in an error state until the policy is fixed.

    2. BThe rule is skipped, and members read every row of the table

      A broken rule never opens the table. The endpoint reports the error and stays in an error state until the role is corrected or the column is restored.

    3. CThe column comes back with empty values, so the rule keeps working

      Nothing restores the column for you. Someone has to update or remove the affected roles, or restore the missing column.

    20 / 28

  22. When a user has several roles

    A user can belong to multiple OneLake security roles, and then the question is how the roles meet. OneLake first resolves each role independently. After resolving each role, OneLake combines the roles by using a union, or least-restrictive, model. If one role grants access to TableA and another grants access to TableB, a user who belongs to both roles can access both tables.

    There is no deny to stop this. OneLake security supports only Grant roles, and you cannot deny access that is granted through a different role or permission model. Taking a table out of one role closes nothing while another role still grants it.

    When several roles grant the same table, the rules combine as follows.

    Rules How they combine across roles
    Row rules With an OR operator. Rules that allow city = 'Redmond' and city = 'New York' return the rows of both cities.
    Column rules, in general As a union. Removing access to a column does not deny access to that column if another role grants access to it.
    Column rules, in the SQL analytics endpoint As an intersection. If any role hides a column, the endpoint blocks access to that column.
    21 / 28
  23. When a user has several roles

    The lesson on OneLake security enforcement covers the evaluation of several roles in full, also through shortcuts. For the design of row and column rules, one consequence matters here. Because roles add up, rules that depend on each other must not be separated. Keep RLS and CLS rules that must apply together in the same role.

    Row-level and column-level security can be used together to restrict user access to a table, but the two policies have to be applied using a single OneLake security role. OneLake security does not support the combination of two or more roles where one contains RLS rules and another contains CLS rules. Users that try to access tables that are part of an unsupported role combination receive query errors.

    The same limit appears with column lists. OneLake does not support a role combination in which two roles allow a different set of columns for a table and either role also applies RLS to that table.

    Design Result
    Row rule and hidden columns in one role Supported: the member gets the allowed rows without the hidden columns
    Row rule in one role, hidden columns in another role Not supported: query errors on the table
    22 / 28
  24. Quick check

    A user is in Role A, which grants the Returns table, and in Role B, which does not include it. Can the user read Returns?

    1. ANo, because a role that leaves out a table denies it

      Leaving a table out of a role is not a deny. OneLake security has only Grant roles, so the grant from Role A stays valid.

    2. BYes, because roles combine as a union and no role can deny

      Right. OneLake combines roles with a union model, and you cannot deny access that is granted through a different role.

    3. CNo, because roles with different tables cancel each other

      Roles do not cancel each other. Access granted by any role becomes part of what the user can access.

    23 / 28

  25. Who the rules do not restrict

    Before you test a rule, check who you are in the workspace. OneLake security roles use a grant model, and you cannot deny access that is granted through a different role or permission model. For that reason, these controls do not restrict access for users in the Admin, Member, and Contributor roles at the workspace level. The roles are for users in the Viewer workspace role or with Read permission on the item.

    So an Admin who runs a notebook on a table with a row rule sees every row. That result says nothing about what a Viewer in the role will see.

    24 / 28
  26. Who the rules do not restrict

    The rule has exceptions in the SQL analytics endpoint, and one of them is frequent. It needs the endpoint in user identity mode, the mode in which OneLake roles decide access to tables. When row-level security is configured in user identity mode, the defined security rules are enforced for all users, including those in Admin, Member, and Contributor roles.

    Situation Are Admin, Member, and Contributor restricted?
    General rule for OneLake security roles No
    Row-level security, read through a SQL analytics endpoint in user identity mode Yes, the row rules are enforced for all users
    Shortcut-backed tables in the SQL analytics endpoint Enforcement can still deny access in specific cases

    So a Contributor who is a member of a role with a row rule can see all the rows of the table in a notebook and fewer rows of the same table in the SQL analytics endpoint. Both results are correct.

    25 / 28
  27. Quick check

    A workspace Member is added to a role that hides the Salary column of a table. The Member reads the table in a Spark notebook. What appears?

    1. AThe table without Salary, because the role hides it for its members

      The role hides Salary only for users it restricts. These controls do not restrict the Admin, Member, and Contributor workspace roles.

    2. BAn error, because a Member cannot be in a role with column rules

      Nothing fails. The membership has no effect here, because the Member already has access through the workspace role.

    3. CThe table with Salary, because the role does not restrict a Member

      Right. OneLake security roles grant access and cannot deny it, so a workspace Member still reads every column.

    26 / 28

  28. Key takeaways

    • A folder grant inherits downward, and traversal opens only the path to it. Members can traverse the parent folders, but sibling files and folders stay out of reach.
    • A request for every column depends on the engine. With hidden columns, Spark notebooks return the allowed columns, and the SQL analytics endpoint and semantic models return an error.
    • A row rule is a SELECT * FROM statement with the conditions in the WHERE clause. AND needs both conditions, and a greater-than condition leaves out the value itself.
    • A rule that does not match its table fails closed. A rule that references a missing column makes the query fail with no data.
    • A renamed allowed column blocks the table in the SQL analytics endpoint until the role is updated in the lakehouse where it was created.
    • The SQL analytics endpoint lists every schema name and hides only the tables that the user cannot read.
    • A renamed table loses its rules. Roles are tied to the table name, and data can be exposed until the policies are reapplied.
    • Column lists of several roles combine as a union, except in the SQL analytics endpoint, which intersects them. Row and column rules that go together belong in one role.
    • Admin, Member, and Contributor are not restricted, except by row rules read through a SQL analytics endpoint in user identity mode.
    27 / 28
  29. Quick check

    Which statement about OneLake security roles is correct?

    1. AA role can deny a table that another role grants to the same user

      OneLake security supports only Grant roles. A role cannot deny access that another role grants.

    2. BA row rule on a folder of files filters the files that members can open

      Rows exist only in tabular data, so RLS cannot be defined for non-table folders or unstructured data.

    3. CRow rules of several roles on one table combine with an OR operator

      Right. When multiple roles grant access to the same table, row-level security rules combine with an OR operator.

    28 / 28

  30. 10 quick checks · then the test

    In the app, finishing the quick checks opens this lesson’s 10-question test, and the ones you miss come back exactly when you’re about to forget them.

    Take this lesson’s test → Next lesson: Warehouse SQL Granular Security

    Opens in your browser. Nothing to install.

    Start studying

    On your phone, with the same account

    Get it on Google Play Download on the App Store

The whole course, on your computer and your phone

Lessons you can read, audio you can listen to on the way to work, and practice that remembers what you got wrong.

Opens in your browser. Nothing to install.

Start studying

On your phone, with the same account

Get it on Google Play Download on the App Store

“This app is the ‘One Lake’ for preparing the certification exams. Really worth it.”

Abdelhak Y. Google Play review