SOL-C01 · Question #246
You have a Snowflake table named CUSTOMER DATA' with columns CUSTOMER ID', NAME, 'CITY, and 'TRANSACTION DATE. You need to implement a data masking policy that masks the 'NAME column for all users…
The correct answer is A. Create a masking policy for the `NAME' column using a CASE statement that checks the D. Create masking policy using the 'TRANSFORM' function to mask the 'NAME' column, and create a. Option A describes the correct Snowflake native approach: a Dynamic Data Masking policy using a CASE statement with CURRENT_ROLE() to conditionally return the real value for ACCOUNTADMIN and a masked value for others, combined with a Row Access Policy that joins on a mapping…
Question
You have a Snowflake table named CUSTOMER DATA' with columns CUSTOMER ID', NAME, 'CITY, and 'TRANSACTION DATE. You need to implement a data masking policy that masks the 'NAME column for all users except those with the 'ACCOUNTADMIN' role. Additionally, you want to implement a row-level security policy that filters the data based on the CITY column, allowing users with the 'CITY MANAGER role to only see data for their assigned city. How would you implement these policies?
Options
- ACreate a masking policy for the `NAME' column using a CASE statement that checks the
- BCreate a view on top of the 'CUSTOMER_DATA' table and implement the masking and row-level
- CCreate a masking policy using regular expressions to filter the data. Create a stored procedure to
- DCreate masking policy using the 'TRANSFORM' function to mask the 'NAME' column, and create a
- ECreate a stored procedure with 'EXECUTE AS OWNER to filter the data based on the 'CITY
How the community answered
(42 responses)- A64% (27)
- B21% (9)
- C10% (4)
- E5% (2)
Explanation
Option A describes the correct Snowflake native approach: a Dynamic Data Masking policy using a CASE statement with CURRENT_ROLE() to conditionally return the real value for ACCOUNTADMIN and a masked value for others, combined with a Row Access Policy that joins on a mapping table to enforce city-level filtering for the CITY_MANAGER role. Option D describes an equivalent valid implementation using Snowflake's TRANSFORM approach in masking policy syntax. Both A and D represent legitimate Snowflake policy patterns. Option B (views for masking/RLS) works but is not the recommended pattern and lacks centralized policy management. Option C (regex in masking + stored procedures for RLS) is non-standard. Option E (stored procedures with EXECUTE AS OWNER) bypasses proper policy enforcement.
Topics
Community Discussion
No community discussion yet for this question.