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

  • Database audit has been enabled.

Procedure

  1. In the navigation tree, choose Rules.

  2. In the Instance drop-down list, select the instance whose privacy data protection rule is to be configured.

  3. Click the Privacy Data Protection tab.

    Note

    Only user-defined rules can be edited and deleted. Default rules can only be enabled and disabled.

  4. Enable or disable Store Result Set and Mask Privacy Data.

    • Store Result Set

      You are advised to disable image1. 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.

    • Mask Privacy Data

      You are advised to enable image2. After this function is enabled, you can configure masking rules to prevent privacy data leakage.

  5. Click Add Rule. In the displayed Add Rule dialog box, set the data masking rule, as shown in Figure 1. For details about related parameters, see Table 1.

    **Figure 1** Add Rule dialog box

    Figure 1 Add Rule dialog box

    Table 1 Rule parameters

    Parameter

    Description

    Example Value

    Rule Name

    Name of a rule

    test

    Regular Expression

    Regular expression that specifies the sensitive data pattern

    -

    Substitution Value

    Value used to replace sensitive data specified by the regular expression

    ###

  6. 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.

  1. Enable Mask Privacy Data, and ensure the "Passport NO." masking rule is enabled, as shown in Figure 2.

    **Figure 2** Enabling privacy data protection

    Figure 2 Enabling privacy data protection

  2. Log in to the database as user root through the MySQL database client.

  3. On the database client, enter an SQL statement.

    select * from db where HOST="Passport NO.";

  4. In the navigation pane, choose Dashboard.

  5. In the navigation tree on the left, choose Data Reports. The Data Reports page is displayed.

  6. In the Instance drop-down list, select the instance whose SQL statement information you want to view. Click the Statements tab.

  7. Set filtering conditions to find the entered SQL statement.

  8. In the row containing the SQL statement, click Details in the Operation column.

  9. Check the SQL statement information in SQL Statement.

Common Operations

After adding a user-defined masking rule, you can perform the following operations on it:

  • Disable

    Locate the row that contains the rule to be disabled and click Disable in the Operation column. A disabled rule cannot be used.

  • Edit

    Locate the row that contains the rule to be modified, click Edit in the Operation column, and modify the rule in the displayed dialog box.

  • Delete

    Locate the row that contains the rule to be deleted, click Delete in the Operation column, and click OK in the displayed dialog box.