Configure sensitive data masking rules
You can configure sensitive data masking to prevent sensitive data from appearing in audit logs, which helps avoid data leaks during log queries. You can mask sensitive data, such as national ID numbers or bank card numbers, by replacing them with asterisks (*).
Usage notes
When you enable sensitive data masking rules, Database Audit matches data against the rules and applies data masking. This process can affect the performance of query statements. You can enable a maximum of 20 sensitive data masking rules.
Procedure
-
Log on to the Database Audit system. For more information, see Log in to Database Audit Service.
-
In the left-side navigation pane, choose .
Above the list of sensitive data masking rules, select filter criteria such as Name and Status, and click Query to view the built-in masking rules.
Database Audit provides built-in masking rules. Check if these rules meet your data masking requirements.
If the built-in rules do not meet your requirements, on the Sensitive Data Masking page, click Add.
In the Add Sensitive Data Masking Rule panel, configure the rule's parameters, and then click Save.
Parameter
Description
Name
The name of the sensitive data masking rule.
Regular Expression
The regular expression for identifying and masking sensitive data. You can refer to the regular expressions of the built-in rules for examples.
Masked Result
The format of the masked data after the rule is applied.
Description
The description of the sensitive data masking rule.
Test Content
Enter the sensitive data in the Test Content box and click Test to preview the masked result.
After you add a rule, it appears in the list of sensitive data masking rules.
Select a rule, and then click Enable or Disable above the list.
Related operations
You can test built-in sensitive data masking rules. You cannot modify their Name, Regular Expression, Masked Result, or Description.
You can modify and delete custom sensitive data masking rules. To modify a custom rule, click Modify in the Actions column of the rule. In the Modify Sensitive Data Masking Rule panel, update the information and click Save.