Updated on 2026-07-07 GMT+08:00

Discovery Rules

The discovery rule allows you to configure and manage data fields for subsequent unified encryption and data masking operations.

The concept of discovery rules pertains to data domains. Specifically, these rules can be utilized to determine whether data falls within a given data domain.

Description of the Data Domain: The Data Domain is a description of data knowledge within the Transparent Encryption Gateway, primarily used to define a specific data service entity. For operational convenience, Data Domain management is not an independent module but is integrated into the Discovery Rules module. As shown in Figure 1: Stock Code, Mixed ID Number, and English Address are examples of Data Domains.

Create Data Field

  1. Logging In to the Database Encryption System using the system administrator sysadmin account.
  2. In the left navigation tree, select Rule Management > Discovery Rule.
  3. Click Add Data Region.

    Figure 1 Discovering Rules

  4. Enter the data and name in the pop-up window, click Confirm to save and exit.

    Figure 2 Creating data region

    Parameter

    Description

    Data RegionName

    Enter the user-defined data field category name.

    Remark

    Provide remarks for this data field.

Creating Discovery Rule

  1. Select the desired data domain, click icon, and add a discovery rule.

    Figure 3 Discovering rules

  2. Fill in the information in the pop-up window, click Confirm, save and exit.

    Figure 4 Creating discovery rules - regular expressions
    Table 1 Description of new discovery rule parameters - regular expressions

    Parameter

    Description

    Discovery Rule Name

    Enter the name of the user-defined number rule.

    Data Region

    Added the data domain to which the discovery rule belongs.

    Discovery Method

    Select the matching method for the data field.

    • Match by field name.
    • Match by data content.

    Discovery Rule Type

    Select the type of discovery rule.

    • Regular Expression
    • Custom Method
    • Dictionary Discovery

    Regular Expression

    Enter an expression that conforms to the Java regular expression syntax as a template for discovery rules.

    Demo

    Recommended for filling in. Provide an example data that complies with the current rules to help understand the rule intent, such as: Zhang San, 11010119900307663X.

    Test

    Required. Enter the raw data to be tested and click the Test button on the right to verify if the rule matches successfully. You can test multiple data sets on separate lines.

    Remark

    Optional. Provide additional information about the purpose, scope of application, and precautions for the rule to facilitate future maintenance.

    Default Rule

    Configure whether the newly added discovery rule is the default rule.

    • Yes: This rule will be the default discovery rule for this data domain and will be automatically enabled during system initialization.
    • No: This rule needs to be enabled manually.
    Figure 5 Filling in the matching rule configuration (custom method)
    Table 2 Filling in the matching rule configuration (custom method)

    Parameter

    Description

    Discovery Rule Name

    Enter the name of the user-defined number rule.

    Data Region

    Added the data domain to which the discovery rule belongs.

    Discovery Method

    Select the matching method for the data field.

    • Match by field name.
    • Match by data content.

    Discovery Rule Type

    Select the type of discovery rule.

    • Regular Expression
    • Custom Method
    • Dictionary Discovery

    JAVA method

    Required. Enter the full Java class name that implements the discovery logic. The class must implement the system-defined rule interface and return a Boolean value or a match result.

    Demo

    Recommended for filling in. Provide a sample data that matches the expected pattern of this custom method to help understand the rule's purpose.

    Test

    Required. Enter the target data to be tested, then click the Test button to execute the custom method. The system will return whether the match was successful.

    Remark

    Optional. Provide additional information about the purpose, scope of application, and precautions for the rule to facilitate future maintenance.

    Default Rule

    Configure whether the newly added discovery rule is the default rule.

    • Yes: This rule will be the default discovery rule for this data domain and will be automatically enabled during system initialization.
    • No: This rule needs to be enabled manually.
    Figure 6 Filling in the discovery rule configuration (dictionary discovery)
    Table 3 Filling in the discovery rule configuration (dictionary discovery)

    Parameter

    Description

    Discovery Rule Name

    Enter the name of the user-defined number rule.

    Data Region

    Added the data domain to which the discovery rule belongs.

    Discovery Method

    Select the matching method for the data field.

    • Match by field name.
    • Match by data content.

    Discovery Rule Type

    Select the type of discovery rule.

    • Regular Expression
    • Custom Method
    • Dictionary Discovery

    Dictionary category

    Required. You can choose system-predefined dictionary categories, such as province, city, district, name, or phone number; or customize categories in the dictionary for selection here.

    Matching Method

    You can choose methods such as include, equal, or left-right match.

    Demo

    Recommended for filling in. Provide a sample data that matches the expected pattern of this custom method to help understand the rule's purpose.

    Test

    Required. Enter the target data to be tested, then click the Test button to execute the custom method. The system will return whether the match was successful. Supports testing single or multiple lines with new lines.

    Remark

    The supplementary explanations cover the purpose, scope of application, and precautions of the rules to facilitate future maintenance.

    Default Rules

    Configure whether the newly added discovery rule is the default rule.

    • Yes: This rule will be the default discovery rule for this data domain and will be automatically enabled during system initialization.
    • No: This rule needs to be enabled manually.

Viewing and Editing

  • View/Edit Data region: Select the target data field and click to view the data field; click Edit to edit the data field.
    Figure 7 Viewing rule details
  • View/Edit Discovery rules: Parameter description: Refer to Add Data Region above.
    Figure 8 Editing discovery rule

Deleting Data Region or Rules

The page provides a delete button to remove data fields or rules.

Figure 9 Deleting data region

----End