Implementing Data Masking for Azure SQL Database | DP-200 Exam | Microsoft

Implementing Data Masking for Azure SQL Database

Question

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.

After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.

You have an Azure SQL database named DB1 that contains a table named Table1. Table1 has a field named Customer_ID that is varchar(22).

You need to implement masking for the Customer_ID field to meet the following requirements:

-> The first two prefix characters must be exposed.

-> The last four suffix characters must be exposed.

-> All other characters must be masked.

Solution: You implement data masking and use a credit card function mask.

Does this meet the goal?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

B

Must use Custom Text data masking, which exposes the first and last characters and adds a custom padding string in the middle.

https://docs.microsoft.com/en-us/azure/sql-database/sql-database-dynamic-data-masking-get-started

The proposed solution uses the credit card function mask to mask the Customer_ID field in the Table1 table of the Azure SQL database. The credit card function mask replaces all but the last four characters of a string with asterisks (*). However, this function mask does not meet the requirements stated in the scenario, which are:

  • The first two prefix characters must be exposed.
  • The last four suffix characters must be exposed.
  • All other characters must be masked.

The credit card function mask only exposes the last four suffix characters, but it does not expose the first two prefix characters, nor does it mask all other characters.

To meet the requirements, a custom function mask can be created using the substring function to extract the first two and last four characters of the Customer_ID field, and the replicate function to create asterisks to replace the remaining characters. The custom function mask would look like this:

XXX-XXXX-XXXX-XXX-XX-XXXX

Where X represents an asterisk, and the hyphens represent the extracted characters. This mask will expose the first two and last four characters of the Customer_ID field and mask all other characters.

Therefore, the answer is B. No, the proposed solution does not meet the requirements stated in the scenario. A custom function mask needs to be created to meet the stated requirements.