Databricks Data Engineer Professional Question 208
Single answerA company wants to ensure that sensitive customer information, such as Social Security Numbers (SSNs), is masked for non-privileged users while allowing privileged users to view the data in its original form. You are tasked with implementing a solution using Databricks. Which approach should you take to achieve this requirement?
- A
Create a dynamic view that checks the user's role and applies masking logic for non-privileged users.
- B
Store the masked and unmasked versions of the data in separate tables and allow users to query the appropriate table based on their role.
- C
Use column-level encryption for sensitive data and provide decryption keys to privileged users.
- D
Create a static view that permanently masks sensitive data for all users.
Show answer and explanation
Correct answer: A
Explanation
Dynamic views in Databricks allow you to define logic that dynamically applies data masking or transformations based on the user's role or privileges. This is the most efficient and secure way to implement role-based data masking, as it eliminates the need for managing multiple datasets and ensures that access control is handled within the query logic itself.
- A. Correct.
This is the correct approach. Dynamic views in Databricks allow you to implement role-based access control by dynamically masking sensitive data based on the user's role or privileges.
- B. Incorrect.
This approach is inefficient and prone to errors, as it requires maintaining two separate datasets and managing access to the correct dataset, which adds complexity.
- C. Incorrect.
While column-level encryption can secure sensitive data, it does not provide dynamic masking capabilities based on user roles and is not directly supported as a masking solution in Databricks views.
- D. Incorrect.
A static view would apply the same masking logic to all users, which does not meet the requirement of showing unmasked data to privileged users.