What are masking policies and row access policies in Snowflake, and how do they help handle sensitive data?

Quick Overview

Explain what Snowflake masking policies and row access policies do and how they protect sensitive data at query time. It tests column-level and row-level security design, role-based policy logic, entitlement mapping tables and the governance pitfalls of these features.

What are masking policies and row access policies in Snowflake, and how do they help handle sensitive data?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

What are masking policies and row access policies in Snowflake, and how do they help handle sensitive data? ```hint Two different questions Separate the two things a policy can decide: which values of a column a user should see, and which rows should exist for that user at all. Then ask what a policy can check about the person running the query. ``` ### What a Strong Answer Covers - What each policy type controls (column values or whole rows) and when it is evaluated. - How the policy body makes its decision, using the session's roles or a mapping table. - How each policy is created and attached, with a short example. - Why central policies applied at query time are easier to govern than data copies or per-audience views. - Practical limits and pitfalls, such as role hierarchy checks, one policy per column or table, and hashing as a masking choice. ### Follow-up Questions - How would you let analysts join on customer email without ever seeing the address? - How would you apply the same masking rule to hundreds of PII columns across many schemas? - How would you test that a new row access policy hides the right rows before rolling it out? - How do these policies compare with secure views for restricting access?

Overview: Explain what Snowflake masking policies and row access policies do and how they protect sensitive data at query time. It tests column-level and row-level security design, role-based policy logic, entitlement mapping tables and the governance pitfalls of these features.

General logo
General
Nov 24, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

What are masking policies and row access policies in Snowflake, and how do they help handle sensitive data?

What a Strong Answer Covers Guidance

  • What each policy type controls (column values or whole rows) and when it is evaluated.
  • How the policy body makes its decision, using the session's roles or a mapping table.
  • How each policy is created and attached, with a short example.
  • Why central policies applied at query time are easier to govern than data copies or per-audience views.
  • Practical limits and pitfalls, such as role hierarchy checks, one policy per column or table, and hashing as a masking choice.

Follow-up Questions Guidance

  • How would you let analysts join on customer email without ever seeing the address?
  • How would you apply the same masking rule to hundreds of PII columns across many schemas?
  • How would you test that a new row access policy hides the right rows before rolling it out?
  • How do these policies compare with secure views for restricting access?