This article will explain how to create a substitution mask and what types of generators are using to replace original data with masked one.
Database masking tool offers two types of masking data:
To create a new substitution mask, under the Home tab, click the Manage button:
The Manage masks window will be opened, by default the Substitution radio button is checked:
By clicking the New button on the Manage masks window:
The Create substitution mask window will be opened. This window contains two radio buttons in the level sections:
In the Name text box enter a name for a new substitution mask and optional the brief description for a new substitution mask can be entered in the Description field:
From the Type drop-down list in the Create substitution mask window can be chosen the different types of generators, which will be used for mask SQL Server data:
If the Predefined generator is selected form the type-drop-down list, it will offer the numerous generators which contain data from the different area of the life: Art, Auto industry, etc. For more information, see the How to mask SQL Server data with the predefined generator article.
The Use original generator uses the data from the selected column (original data) in masking, as its name suggests. By using this generator, the database developer will have the opportunity to mask SQL Server data with original mixed data by the checked the shuffle check-box:
In the following example, it will be shown how the Use original generator feature will mask data:
With this generator, the data from the selected column will be masked with randomly chosen symbols. The Random generator will be used one or more characters for replacing the data from the selected column ( the number of characters is not related to the number of characters in the original data):
In this case, a specific value or null value is used to mask SQL Server data.
A regular expression generator makes data based on the given sequences and that values will be used for replacing original data. In the Create substitution mask window bellow the Type drop-down list (where is chosen the regular expression generator ) will appear:
Insert – in this section, the three sequences can be used to define the regular expression:
When the SQL Script generator is used, the original data will be masked with data that is made by using an SQL script. More information about this can be found in the How to mask data in SQL databases using the substitution rule type with the SQL script generator article.
The external source generator will masked original data by using data from Excel, CSV, JSON, XML files. The explanation about how to use external data sources can be found in How to mask sensitive SQL Server data with external data sources article.
When the substitution generator for masking data is created, the next step is to apply the mask to the selected columns. In the Create substitution mask window, click on the Apply button:
The Apply to columns window will be shown. From the Available section, select the columns that want to be masked and click the right blue arrow to move selected columns to the Applied section on which the newly created substitution mask will be applied. Click on the OK button to close the Apply to columns window and confirm the changes:
On the Create substitution mask window, click the OK button to create a new substitution mask, which will appear in the Manage mask window: