Updated on 2025-08-12 GMT+08:00

Adding a Custom Masking Algorithm

Scenario

The system offers built-in masking algorithms for sensitive data labels. You can update these built-in algorithms or add custom ones. Once a masking rule is configured and enabled, the system masks sensitive data in the API according to the specified masking algorithm. This algorithm can be referenced during the configuration of industry-specific masking templates. For details, see Configuring a Masking Template.

If the built-in masking algorithms do not meet service requirements, you can add custom masking algorithms tailored to service characteristics.

This section describes how to add a custom masking algorithm.

Procedure

  1. Log in to the web console of the API data security protection system as the sysadmin user.
  2. In the navigation pane, choose Security Policies > Data Masking.
  3. Click the Algorithms tab and click Add custom algorithm in the upper right corner.
  4. In the Add custom algorithm dialog box, configure a custom algorithm. For details about related parameters, see Parameters for adding a custom masking algorithm.

    Figure 1 Adding a custom algorithm
    Table 1 Parameters for adding a custom masking algorithm

    Parameter

    Description

    Algorithm name

    Set the name of the custom algorithm.

    Labels

    Select an associated sensitive data label from the drop-down list. For details about data labels, see Adding a Sensitive Data Label.

    Desensitization type

    Select the masking algorithm type.

    • Shade type: Data will be covered after masking. You need to set masking rule and symbol.
      • Masking rule: Set the number of characters to be retained after masking. The retained characters are not covered.
      • Masking symbol: Select a symbol from the drop-down list box. The available symbols include *, #, and ?.
    • Blanking type: Data is left empty after masking.

    Algorithm remark

    Description of a custom algorithm.

  5. Click OK.

Operation Result

After the algorithm is added, you can view the added custom algorithm on the Algorithms page. You can use the custom masking algorithm when creating a masking template. For details, see Adding a Custom Masking Algorithm.

Related Operations

You can perform the following operations on the Algorithms page:

  • Editing a custom masking algorithm: Locate the target algorithm and click Edit in the Actions column.
  • Deleting a custom masking algorithm: Locate the target algorithm and click Delete in the Actions column.