Configuring Privacy Data Protection Rules
To mask sensitive information in entered SQL statements, you can enable the function of masking privacy data and configure masking rules to prevent sensitive information leakage.
Prerequisites
- The database audit instance is in the Running state.
- For details about how to enable database audit, see Enable Database Audit.
Constraints and Limitations
Only user-defined rules can be edited and deleted. Default rules can only be enabled and disabled.
Managing Privacy Data Protection Rules
- Log in to the DBSS console.
- Click
in the upper left corner on the displayed page and select a region. - In the navigation tree on the left, choose Rules.
- In the Instance drop-down list, select an instance.
- Click the Privacy Data Protection tab.
Viewing Privacy Data Protection Rules
| Parameter | Description |
|---|---|
| Store Result Set | You are advised to disable it. After this function is disabled, database audit will not store the result sets of user SQL statements. Do not enable this function if you want to prepare for PCI DSS/PCI 3DS CSS certification. NOTE: The result set storage supports only the database audit in agent mode. |
| Mask Privacy Data | You are advised to enable it. After this function is enabled, you can configure masking rules to prevent privacy data leakage. |
| Rule Name | Rule name. |
| Rule Type | Rule type.
|
| Regular Expression | Regular expression that specifies the sensitive data pattern |
| Substitution Value | Value used to replace sensitive data specified by the regular expression |
| Status | Status of a rule.
|
Disabling a Privacy Data Protection Rule
- In the Operation column of a rule, click Disable. Figure 2 Disabling a masking rule
- In the displayed dialog box, click OK.
A disabled rule cannot be used.
Editing a Privacy Data Protection Rule
Default rules cannot be edited. Only custom rules can be edited.
- In the Operation column of a rule, click Edit. Figure 3 Editing a custom masking rule
- In the displayed dialog box, modify the rule information and click OK.
Deleting a Privacy Data Protection Rule
- In the Operation column of a rule, click Delete. Figure 4 Deleting a masking rule
- In the displayed dialog box, enter DELETE and click OK.
After the rule is deleted, if you need to configure privacy protection for the instance, add a privacy data protection rule again.
Adding a Custom Privacy Data Rule
- Enable or disable Store Result Set and Mask Privacy Data.
- Store Result Set
You are advised to disable it. After this function is disabled, database audit will not store the result sets of user SQL statements.
Do not enable this function if you want to prepare for PCI DSS/PCI 3DS CSS certification.
Note: The result set storage supports only the database audit in agent mode.
- Mask Privacy Data
You are advised to enable it. After this function is enabled, you can configure masking rules to prevent privacy data leakage.
- Store Result Set
- Click Add Rule. In the displayed Add Rule dialog box, set the data masking rule, as shown in Figure 5. For details about related parameters, see Table 2.
- Click OK.
A masking rule in the Enabled status is added to the rule list.
Verifying a Rule
Perform the following steps to check whether a rule takes effect. The audit information about passport No. in a MySQL database is used as an example.
- Enable Mask Privacy Data, and ensure the "Passport NO." masking rule is enabled, as shown in Figure 6.
- Log in to the database as user root through the MySQL database client.
- On the database client, enter an SQL statement.
select * from db where HOST="Passport NO.";
- In the navigation pane, choose Dashboard.
- In the navigation tree on the left, choose Data Reports. The Data Reports page is displayed.
- In the Instance drop-down list, select the instance whose SQL statement information you want to view. Click the Statements tab.
- Set filtering conditions to find the entered SQL statement.
- Click the SQL statement. On the Statement Details page, view the SQL statement information. The privacy data masking function is normal, and the masked information is displayed in SQL Statement.
References
- You can add an audit scope rule. For details, see Configuring an Audit Scope Rule.
- You can add a custom SQL rule to audit all the database connected to database audit. For details, see Configuring SQL Injection Rules.
- You can add a risky operation rule to audit risky operations on databases. For details, see Managing Risky Operation Rules.
- You can add trusted SQL statements to the whitelist. Database audit will ignore whitelisted SQL statements. For details, see Configuring SQL Whitelist.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot

