Masking Policies
This section describes how to manage masking policies.
Background
In business activities, some enterprise departments need to analyze data for operations. In this case, data must be accessible to these departments even if it is sensitive. Therefore, to meet this requirement and prevent data leakage, data masking is required.
Masking Algorithms
| Algorithm | Description | Scenario | Example | Original | Masked |
|---|---|---|---|---|---|
| Mask | Replace some characters in an attribute with special characters. Example: * | Used to anonymize structured and unstructured data, such as identifiers and quasi-identifiers. | Mask the last four numbers. | 18012345678 | 1801234**** |
| Cut | Discard the last few numbers of an attribute to ensure data fuzziness. | Used to anonymize structured and unstructured data, such as identifiers and quasi-identifiers. | Cut the last four numbers. | 18012345678 | 1801234 |
| Hash | Convert data by using hash functions such as password salting and keys. | Used to anonymize structured and unstructured data. | HMAC-SHA256 hash | 460031234567890 | A34329AE133C48C |
Data Security provides 15 built-in masking algorithms for users to select. Before selecting an algorithm, you can test its function to ensure that you have selected a proper algorithm.
| Name | Type | Description |
|---|---|---|
| HMAC-SHA256 | Hash | Use the HMAC-SHA256 algorithm for hash processing. |
| SHA-256 | Hash | Use the SHA-256 algorithm for hash processing. |
| SHA-1 | Hash | Use the SHA-1 algorithm for hash processing. |
| MD5 | Hash | Use the MD5 algorithm for hash processing. |
| Value Truncation | Cut | Truncate the last x numbers of an attribute. |
| Date Truncation | Cut | Truncate a specified date. |
| ID Mask | Mask | Mask an ID card number. |
| Bank Card No. Mask | Mask | Mask a bank card number. |
| Email Mask | Mask | Mask email information. |
| Mobile Equipment Identity Mask | Mask | Mask the device code, such as IMEI, MEDI, and ESN. |
| IPv6 Mask | Mask | Mask an IPv6 address. |
| IPv4 Mask | Mask | Mask an IPv4 address. |
| MAC Address Mask | Mask | Mask an MAC address. |
| Phone No. Mask | Mask | Mask a phone number. |
| Date Type Mask | Mask | Mask a specified date format, such as ISO, EUR, and USA. |
| Mask from X to Y | Mask | Mask character X to character Y of a character string. |
| Retain from X to Y | Mask | Retain character X to character Y of a character string. |
| Mask of first N and Last M | Mask | Mask the first N and last M characters of a character string. |
| Retain First N and Last M | Mask | Retain the first N and last M characters of a character string. |
Common Methods
| Method | Description |
|---|---|
| Redact | Letters are replaced with x, and numbers are replaced with n. |
| Partial mask: show last 4 | Only the last four characters are displayed. Other characters are replaced with x. |
| Partial mask: show last 4 | Only the first four characters are displayed. Other characters are replaced with x. |
| Hash | The original value is replaced with the hash value. |
| Nullify | The original value is replaced with NULL. |
| Unmasked (retain original value) | The value is not masked. |
| Date: show only year | Only the year part of the date string is displayed, and the month and date are set to 01/01 by default. |
Prerequisites
Sensitive data identification rules have been created. For details, see Identification Rules.
Creating a Data Masking Policy
- Log in to the DGC console, select an instance, and click Access on it.
- Click the Workspaces tab. In the workspace list, find the required workspace. In the Quick Entry column, choose Data Security to access the management console.
- Choose from the left navigation bar, and click Create in the upper part of the displayed page. Figure 1 Creating a data masking policy
- In the displayed dialog box, enter the policy information. For details, see Table 4.
Table 4 Parameters Parameter
Description
Policy Name
The name of the policy to be created. Policy names can include only letters, numbers, and underscores (_) and cannot exceed 64 characters.
Description
A description of the policy to be created, which cannot exceed 255 characters.
Status
If the status switch is turned on, the policy is available. If the status switch is turned off, the policy cannot be used.
Recognition Rule
Select a rule from the drop-down list. Rules that have been used are unavailable.
- After all settings are complete, click OK. Figure 2 Creating a data masking policy
Editing a Masking Policy
- Log in to the DGC console, select an instance, and click Access on it.
- Click the Workspaces tab. In the workspace list, find the required workspace. In the Quick Entry column, choose Data Security to access the management console.
- Choose from the left navigation bar.
- On the displayed page, select a policy and click Edit to the right of it in the Operation column.
Masking policies referenced by static masking tasks cannot be edited.
Figure 3 Editing a masking policy
Enabling a Masking Policy
- Log in to the DGC console, select an instance, and click Access on it.
- Click the Workspaces tab. In the workspace list, find the required workspace. In the Quick Entry column, choose Data Security to access the management console.
- Choose from the left navigation bar.
- On the displayed page, select a policy and turn on
in the Status column. Figure 4 Enabling a masking policy
Disabling a Masking Policy
- Log in to the DGC console, select an instance, and click Access on it.
- Click the Workspaces tab. In the workspace list, find the required workspace. In the Quick Entry column, choose Data Security to access the management console.
- Choose from the left navigation bar.
- On the displayed page, select a policy and turn off
in the Status column. Masking policies referenced by static masking tasks cannot be disabled.
Figure 5 Disabling a masking policy
Deleting a Data Masking Policy
- Log in to the DGC console, select an instance, and click Access on it.
- Click the Workspaces tab. In the workspace list, find the required workspace. In the Quick Entry column, choose Data Security to access the management console.
- Choose from the left navigation bar.
- Select the masking policies you want to delete and click Delete above the policy list. Masking policies must be disabled before being deleted.Figure 6 Deleting a data masking policy
- Policies referenced by masking tasks cannot be deleted.
- The deletion operation cannot be recovered. Exercise caution when performing this operation.
Last Article: Introduction
Next Article: Static Masking Polices
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.