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

Configuring a Data Masking Rule

You can configure data masking rules to mask sensitive data in APIs. This example shows how to configure data masking rules to mask access requests.

Networking Requirements

Figure 1 shows the networking configuration of API data security protection.

Figure 1 Reverse proxy networking
Table 1 Networking description

Device

Description

Client PC

IP address: 172.16.212.65

API data security protection

IP address: 172.16.35.44

Application Server

IP address: 172.16.35.53

(Optional) Configuring a Masking Template

Before configuring a custom data masking rule, you can configure a masking template and use it to quickly configure a data masking rule.

  1. Log in to the API data security protection web console as user sysadmin.
  2. In the navigation pane on the left, choose Security Policies > Data Masking and click the Templates tab.
  3. In the upper right corner of the page, click Add Template.
  4. On the displayed page, configure masking template information, as shown in Figure 2.

    Figure 2 Configuring a masking template

  5. After the masking template is configured, click Save.

Configuring a Data Masking Rule

Before configuring a data masking rule, ensure that you have added application assets. For details, see Application Services. Ensure that no rules that conflict with the data masking rule are enabled.

  1. Log in to the API data security protection web console as user sysadmin.
  2. In the navigation pane on the left, choose Security Policies > Data Masking and click the Rules tab.
  3. Click Add in the upper right corner of the page.
  4. In the displayed dialog box, configure the data masking rule. Figure 3 shows an example of configuring a data masking rule using a template.

    Figure 3 Configuring a data masking rule

  5. Click OK.

Verifying a Data Masking Rule

  1. Enter the proxy IP address and port (172.16.35.44:8182) of the application in the address box of the browser on the client. If sensitive data is masked, the masking rule takes effect. Figure 4 shows an example.

    Figure 4 Verifying the data masking result

  2. Log in to the API data security protection web console as user sysadmin.
  3. Choose Log Management > Retrieval, find the target request record, and click Details. If the request matches the configured data masking rule, the masking rule takes effect.