Domain 1 β€” Module 5 of 8 63%
5 of 26 overall
Domain 1: Implement and Manage an Analytics Solution Free ⏱ ~14 min read

Data Security: Control Who Sees What

Implement row-level, column-level, object-level, and file-level access controls plus dynamic data masking to protect sensitive data in lakehouses and warehouses.

What is data-level security?

Simple explanation

Imagine a spreadsheet where different people see different rows and columns.

The sales manager sees all regions. A regional manager sees only their region’s data. The finance team sees revenue columns but not customer phone numbers. An intern sees everything except salary data β€” and salaries appear as β€œXXXX” instead of real numbers.

That’s data-level security. Even when someone has access to a table, you control which rows they see (RLS), which columns they see (CLS), and whether sensitive values are masked (DDM).

Row-Level Security (RLS)

RLS filters table rows based on who is querying. It’s implemented differently in lakehouses, warehouses, and semantic models.

RLS in warehouses

You create a security policy using T-SQL:

  1. Create a predicate function β€” returns 1 for rows the user can see
  2. Create a security policy β€” binds the function to a table
  3. Test β€” query the table as different users to verify filtering

The function typically checks SESSION_USER() or a role mapping table.

RLS in semantic models (Power BI)

You define roles in the model with DAX filter expressions:

  • Role β€œEurope Sales” β†’ [Region] = "Europe"
  • Role β€œAsia Sales” β†’ [Region] = "Asia"

Users assigned to a role see only matching rows in reports.

Scenario: Ibrahim's regional RLS

Nexus Financial has trading desks in London, New York, Singapore, and Sydney. Traders must see only their own desk’s data. Ibrahim implements RLS on the FactTrades warehouse table:

  1. A mapping table links each user to their trading desk region
  2. A filter predicate checks: does the querying user’s desk match the row’s region?
  3. When a London trader queries, they see only London trades β€” even though the table contains all regions

The compliance team gets a role with no filter (they see everything for audit purposes).

Column-Level Security (CLS)

CLS restricts which columns a user can query. Unlike RLS (which filters rows), CLS hides entire columns.

WhereHow
WarehouseGRANT SELECT ON table(column1, column2) TO user β€” only named columns are accessible
Semantic modelObject-Level Security hides columns from report consumers
Exam tip: RLS + CLS together

RLS and CLS can be combined. A query might filter rows (only your region’s data) AND restrict columns (you can see order amounts but not customer SSN). The exam tests whether you understand that these are independent β€” applying RLS does not automatically apply CLS, and vice versa.

Dynamic Data Masking (DDM)

DDM shows obfuscated values instead of real data, without changing the underlying stored data. It’s a warehouse feature using T-SQL.

Masking functions

FunctionWhat It DoesExample
DefaultFull mask β€” shows 0 for numbers, XXXX for strings, 01-01-1900 for datesSSN: XXX-XX-XXXX
EmailShows first letter and domaina***@contoso.com
RandomRandom number within a specified rangeSalary: 47382 (random, not real)
Partial (custom string)Shows prefix and suffix, masks middlePhone: (04) XXXX-XX89

Who can see unmasked data?

  • db_owner and users with UNMASK permission see real values
  • Everyone else sees masked values
  • Masking is applied at query time β€” the stored data is unchanged
Three layers of data-level security β€” often used together
FeatureRLSCLSDDM
What it controlsWhich rows a user seesWhich columns a user can queryWhat values a user sees (obfuscated vs real)
Data changed?No β€” rows are filtered at query timeNo β€” columns are hidden from the queryNo β€” values are masked at query time
Where supportedWarehouse, semantic model, lakehouse (via views)Warehouse (GRANT), semantic model (OLS)Warehouse (T-SQL)
ImplementationSecurity policy + predicate functionColumn-level GRANT/DENYALTER COLUMN with masking function
Typical use caseRegional data isolation, multi-tenant dataHide PII columns from analystsShow partial data (last 4 digits of SSN)

Folder and file-level access in OneLake

Lakehouse data lives in OneLake in two sections:

  • Tables/ β€” Delta tables managed by Spark/SQL
  • Files/ β€” unstructured files (CSVs, images, Parquet files)

OneLake security lets you set read permissions on specific folders within a lakehouse. This is useful when different teams need access to different datasets within the same lakehouse.

Access LevelWhat It Controls
Folder-levelGrant/deny read access to specific folders in Files/ or Tables/
InheritanceSubfolder permissions inherit from parent unless explicitly overridden
Workspace role interactionWorkspace Admins and Members bypass OneLake folder security; Contributors and Viewers are subject to it
Scenario: Anika's folder isolation

ShopStream’s lakehouse has folders for different data domains: /Files/customer-data/, /Files/product-data/, /Files/marketing-data/. The recommendation team needs product data but must NOT see customer PII.

Anika configures OneLake folder security: the recommendation team’s security group has read access to /Files/product-data/ only. When they browse OneLake, they see only the product folder β€” customer and marketing folders are invisible.


Question

What is the difference between RLS and DDM?

Click or press Enter to reveal answer

Answer

RLS filters WHICH rows a user can see (entire rows are hidden). DDM controls HOW values appear (the row is visible, but sensitive column values are obfuscated). RLS hides data completely; DDM shows data in a masked form.

Click to flip back

Question

Who can see unmasked data when DDM is applied?

Click or press Enter to reveal answer

Answer

Users with the UNMASK permission or db_owner role see real values. Everyone else sees masked values. Masking is applied at query time β€” the stored data is unchanged.

Click to flip back

Question

Do workspace Admins and Members bypass OneLake folder security?

Click or press Enter to reveal answer

Answer

Yes. Workspace Admins and Members bypass OneLake folder-level security. Only Contributors and Viewers are subject to folder access restrictions.

Click to flip back


Knowledge Check

A Fabric warehouse contains a table with employee salaries. HR should see real values, but managers should see masked values (random numbers within a range). Which feature should you implement?

Knowledge Check

Ibrahim configures OneLake folder security on a lakehouse. A user with the Contributor role cannot see the `/Files/trading-data/` folder. A user with the Member role CAN see it despite having no explicit folder permission. Why?

Next up: Governance: Labels, Endorsement & Audit β€” apply sensitivity labels, endorse trusted items, and track everything with audit logs.