Updated on 2026-09-24 GMT+08:00

Discovery Rule Management

Discovery Rule: Used for sensitive data discovery tasks; by executing these tasks within a project, specific fields are tagged as a particular Data Domain.

A single data domain can contain one or more discovery rules. These rules are used to identify sensitive data with different data characteristics within the same data domain, thereby improving the accuracy of the discovery process. For example, a name data domain may include a Chinese name discovery rule, an English name discovery rule, or a combined Chinese–English name discovery rule, among others.

The Data Domain contains a default discovery rule, which is the most commonly used discovery rule.

For instructions on managing sensitive data discovery tasks, please refer to the Importing and Exporting.

Sensitive data discovery supports identifying sensitive data based on data and metadata (e.g., field names).

Sensitive data discovery methods can be implemented using the following three approaches—referred to as Discovery Rule Types within the platform; the description of these discovery methods is provided in Table 1:

Table 1 Sensitive data discovery methodology

Order Number

Discovery Method

Description

Applicable Scenario

1

regular expression

Discover sensitive data fields by writing regular expressions.

For the regular expression syntax supported by this platform, please refer to the Regular Expression Syntax.

Feature: Suitable for data fields with relatively simple patterns that are defined using regular expressions.

Regular expressions have lower performance.

2

Custom Method

The term "custom method" here refers to a method implemented within a custom Java class.

NOTE:

The cloud version of the database encryption product does not currently support uploading custom Java classes to mitigate the risk of Java class injection.

  • Suitable for scenarios involving complex logic and high-precision discovery requirements.
  • For security reasons, cloud products may only use built-in Java class methods.

3

Dictionary Discovery

Discovery supported by a built-in knowledge base.

For information on the system's built-in knowledge bases and how to manage them, please refer to the Knowledge Base.

Suitable for data discovery where all or part of the data consists of simple enumerated types; for example:

  • Stock Code Discovery
  • Name Discovery

Prerequisite

Before creating new discovery rules, you must first create the corresponding data domain that needs to be discovered; for instructions on managing data domains, please refer to the Data Domain Management.

New Discovery Rule

  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. Select the data field where you want to add a discovery rule, then click the plus icon next to the corresponding data field to create a new discovery rule, as shown in Figure 1.

    Figure 1 Creating a discovery rule

  4. The system displays a window for adding new discovery rules, as shown in Figure 2.

    The system supports three different types of discovery rules, including:

    • Regular expression method: Suitable for data fields where data characteristics can be described using regular expressions—e.g., email addresses.

      For information on the regular expression syntax supported by this system, please refer to the Regular Expression Syntax. Detailed configuration settings are shown in Figure 2; parameter descriptions are provided in Table 2.

      Figure 2 Adding a discovery rule – regular expression
      Table 2 New discovery rule parameter documentation – regular expressions

      Parameter

      Description

      Discovery Rule Name

      Enter the name of the user-defined rule.

      Recommended naming convention: combine the data field, feature, and keyword using the "Rule" combination method.

      For example: Chinese name formatting rules. Here, "name" refers to a data field; "Chinese" denotes a name whose data characteristics are described in Chinese; and "rules" is the keyword.

      Data Domain

      Add a new data domain for the discovery rule. Read-only.

      Discovery Method

      Select the matching method for the data field; currently, two methods are supported, including:

      • Field Name (Metadata)
      • data

      Discovery Rule Type

      Select the type of discovery rule. There are three methods:

      • regular expression
      • Custom Method
      • Dictionary Discovery

      Regular Expression

      Enter a regular expression that conforms to Java regular expression syntax as a template for the discovery rule. Refer to the Regular Expression Syntax for details.

      Demo

      Recommended to fill in.

      Provide sample data that complies with the current rules to help understand the intent of the rules; e.g.: Zhang San, 11010119900307663X.

      Test

      Enter the data to be tested.

      Click Test on the right to verify whether the rules have been matched successfully.

      Remark

      Optional: Provide supplementary information regarding the purpose, scope of application, and precautions of the rules to facilitate subsequent maintenance.

      Default Algorithm

      Whether the rule is a default rule.

      • This rule serves as the default discovery rule for this data field.

        When executing a task, if no other rules are selected, the default rules will be used by default.

      • No: This rule must be enabled manually.
    • Custom methods: These refer to custom methods defined within Java classes; for security reasons, cloud platforms have disabled the functionality for uploading custom Java classes. In the current version, only built-in Java class methods can be used; detailed configuration instructions are shown in Figure 3, and parameter descriptions are provided in Table 3.
      Figure 3 Creating a discovery rule – custom method
      Table 3 New discovery rule parameter documentation – custom method

      Parameter

      Description

      Discovery Rule Name

      Enter the name of the user-defined rule.

      Recommended naming convention: combine the data field, feature, and keyword using the "Rule" combination method.

      For example: Chinese name formatting rules. Here, "name" refers to a data field; "Chinese" denotes a name whose data characteristics are described in Chinese; and "rules" is the keyword.

      Data Domain

      Add a new data domain for the discovery rule. Read-only.

      Discovery Method

      Select the matching method for the data field; currently, two methods are supported:

      • Field Name (Metadata)
      • data

      Discovery Rule Type

      Select the type of discovery rule; three methods are supported:

      • Regular Expression
      • Custom Method
      • Dictionary Discovery

      JAVA Method

      Please enter the full Java class name that implements the discovery logic.

      This function must implement a system-defined rule interface and return a boolean value or a matching result.

      NOTICE:

      Due to security concerns, Java class uploads are disabled for cloud products; only the built-in discovery rules may be used.

      Demo

      Recommended to fill in.

      Provide sample data that complies with the current rules to help understand the intent of the rules; e.g.: Zhang San, 11010119900307663X.

      Test

      Enter the data to be tested.

      Click Test on the right to verify whether the rules have been matched successfully.

      Remark

      Optional: Provide supplementary information regarding the purpose, scope of application, and precautions of the rules to facilitate subsequent maintenance.

      Default Algorithm

      Whether the rule is a default rule.

      • This rule serves as the default discovery rule for this data field.

        When executing a task, if no other rules are selected, the default rules will be used by default.

      • No: This rule must be enabled manually.
    • Dictionary-based discovery: This feature utilizes a built-in knowledge base to assist in data discovery. For information on the available built-in knowledge bases and how to manage them, please refer to the Knowledge Base. This method is suitable for discovering data where all or part of the data consists of simple enumerative values—such as stock ticker symbol discovery or name discovery. The dictionary-based discovery rules are illustrated in Figure 4; the parameter descriptions are provided in Table 4.
      Figure 4 Creating a discovery rule – dictionary discovery
      Table 4 New discovery rule parameter documentation – dictionary discovery

      Parameter

      Description

      Discovery Rule Name

      Enter the name of the user-defined rule.

      Recommended naming convention: combine the data field, feature, and keyword using the "Rule" combination method.

      For example: Chinese name formatting rules. Here, "name" refers to a data field; "Chinese" denotes a name whose data characteristics are described in Chinese; and "rules" is the keyword.

      Data Domain

      Add a new data domain for the discovery rule. Read-only.

      Discovery Method

      Select the data field matching method; currently, two methods are supported:

      • Field Name (Metadata)
      • data

      Discovery Rule Type

      Select the discovery rule type; currently, three methods are supported:

      • regular expression
      • Custom Method
      • Dictionary Discovery

      Dictionary Category

      You can choose from the system-predefined dictionary categories.

      For example: province/city/district, name, mobile number, etc.; you can also create custom categories in the dictionary for selection here.

      Matching Mode

      You can use operators such as inclusion, equality, or left/right matching.

      Demo

      Recommended to fill in.

      Provide sample data that complies with the current rules to help understand the intent of the rules; e.g.: Zhang San, 11010119900307663X.

      Test

      Enter the data to be tested.

      Click Test on the right to verify whether the rules have been matched successfully.

      Remark

      Optional: Provide supplementary information regarding the purpose, scope of application, and precautions of the rules to facilitate subsequent maintenance.

      Default Algorithm

      Whether the rule is a default rule.

      • This rule serves as the default discovery rule for this data field.

        When executing a task, if no other rules are selected, the default rules will be used by default.

      • No: This rule must be enabled manually.

View and Edit Discovery Rules

  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. Select the target data domain, choose the discovery rule you wish to edit, and click Edit, as shown in Figure 5.

    Figure 5 Viewing and editing discovery rules

Delete Discovery Rule

  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. Select the target data domain, then hover your mouse over the rule you wish to delete; a trash can icon will appear, as shown in Figure 6. Click the trash can icon to delete the discovery rule.

    Figure 6 Deleting the discovery rule