Help Center/ Web Application Firewall/ User Guide/ Access Management/ Connecting Your Website to WAF Using Dedicated Mode
Updated on 2026-10-10 GMT+08:00

Connecting Your Website to WAF Using Dedicated Mode

If your service servers are deployed on Huawei Cloud, you can use dedicated WAF instances to protect your website services as long as your website has domain names or IP addresses.

Dedicated WAF instances are not available in some regions. For details, see Notice on Web Application Firewall (Dedicated Mode) Discontinued.

Solution Overview

This section describes the principles of dedicated access and website traffic flow after a website is connected to WAF.

In dedicated mode, after a website is connected to WAF, the website traffic is sent to WAF through the ELB load balancer. WAF blocks abnormal requests and forwards normal requests to the origin server through the back-to-source IP address of the dedicated WAF engine.

Figure 1 shows access principles.

Figure 1 Access principles in dedicated mode

Figure 2 shows how your website traffic is forwarded when WAF is used.

Figure 2 Website access diagram

The details are as follows:

  1. After a visitor enters a domain name in the browser, the client sends a request to the DNS service to query the domain name resolution address.
  2. DNS returns the domain name resolution address to the client.
  3. If no proxies (for example, CDN or AAD) are used, the domain name resolution address returned by the DNS service is the EIP of the load balancer, and the client accesses the load balancer through the EIP. If a proxy is used:
    1. The domain name resolution address returned by DNS is the IP address of the proxy. The client accesses the proxy through the proxy IP address.
    2. The proxy accesses the ELB load balancer over its EIP.
  4. The ELB load balancer forwards the traffic to WAF.
  5. WAF checks the traffic, blocks abnormal traffic, and forwards normal traffic to the origin server over the back-to-source IP address of the dedicated WAF engine. For the definition of origin servers, see Origin Server.

Access Process

You need to perform the following operations based on whether your website uses a proxy (such as AAD, CDN, and cloud acceleration products).

Procedure

Description

Step 1. Add a Website to WAF

Add a domain name and origin server details to WAF.

Step 2: Configure a Load Balancer for a Dedicated WAF Instance

Configure a load balancer and health check for a dedicated WAF instance.

Step 3: Bind an EIP to a Load Balancer

Bind an EIP of the origin server to the load balancer configured for a dedicated WAF instance so that the website request traffic can be forwarded to and checked by the dedicated WAF instance.

Step 4: Whitelist Back-to-Source IP Addresses of Dedicated WAF Instances

Allow the back-to-source IP address of a dedicated engine.

Step 5: Test Dedicated WAF Instances

Check WAF traffic forwarding, ELB load balancer, and WAF basic protection.

Prerequisites

  • You have purchased a dedicated load balancer. For details about load balancer types, see Differences Between Dedicated and Shared Load Balancers.

    Dedicated WAF instances issued before April 2023 cannot be used with dedicated network load balancers. If you use a dedicated network load balancer (TCP/UDP), ensure that your dedicated WAF instance has been upgraded to the latest version (issued after April 2023). For details, see Dedicated Engine Version Iteration.

  • Related ports have been enabled in the security group to which the dedicated WAF instance belongs.
    You can configure your security group as follows:
    • Inbound rules

      Add an inbound rule to allow incoming network traffic to pass through over a specified port based on your service requirements. For example, if you want to allow access on port 80, you can add a rule that allows TCP and port 80.

    • Outbound rules

      The value is Default. All outgoing network traffic is allowed by default.

    For more details, see Adding a Security Group Rule.

Basic Settings

You can take the steps below to quickly connect your website to WAF.

During the configuration, you can retain the default settings for Policy. After completing the basic settings, you can adjust the settings based on your service requirements. For details, see Advanced Settings.

Step 1. Add a Website to WAF

To connect your services to WAF, you need to add the domain name and origin server information to WAF.

  1. Log in to the WAF console.
  2. Click in the upper left corner and select a region or project.
  3. (Optional) If you have enabled the enterprise project function, in the upper part of the navigation pane on the left, select your enterprise project from the Filter by enterprise project drop-down list. Then, WAF will display the related security data in the enterprise project on the page.

    You cannot add websites to all projects.

  4. In the navigation pane on the left, choose Access Management.

    Before adding a website to WAF, you can click Usage Guide in the upper right corner of the page to learn about the access process.

  1. On the Access Management page, click the Dedicated tab and click Add Website.

    If only one access mode is enabled, click Add Website.

  2. Select Dedicated Mode and click Configure Now.
  3. On the Add Website panel, configure basic information, as shown in Figure 3. Table 1 describes the parameters.

    Figure 3 Configuring basic information
    Table 1 Parameters for dedicated mode access

    Parameter

    Description

    Example Value

    Protected Object

    Domain name or IP address of the website you want to protect.

    • Domain Name: Single domain names or wildcard domain names are supported.
      • The wildcard * can be added to WAF to let WAF protect any domain names. If wildcard (*) is added to WAF, only non-standard ports other than 80 and 443 can be protected.
      • If the server IP address of each subdomain name is the same, enter a wildcard domain name. For example, if the subdomain names a.example.com, b.example.com, and c.example.com have the same server IP address, you can add the wildcard domain name *.example.com to WAF to protect all three.
      • If the server IP addresses of subdomain names are different, add subdomain names as single domain names one by one.
    • IP: The IP address can be a public or private IP address.

      If a private IP address is used, ensure that the corresponding network path is accessible so that WAF can correctly monitor and filter traffic.

    www.example.com

    Website Name (Optional)

    Website name you specify.

    WAF

    Website Remarks (Optional)

    Remarks of the website.

    waftest

    Protected Port

    Port to be protected.
    • To protect port 80 or 443, select Standard port from the drop-down list.
    • To protect other ports, choose one from the drop-down list. Click View Ports You Can Use to view the HTTP and HTTPS ports supported by WAF. For more information, see Ports Supported by WAF.

      If a port other than 80 or 443 is configured, the visitors need to add the non-standard port to the end of the website address when they access the website. Otherwise, a 404 error will occur. If a 404 error occurs, see How Do I Troubleshoot 404/502/504 Errors?

    81

    Server Configuration

    Information about the website server, including:
    • Client Protocol: protocol used by a client to access the website server. The options are as follows:
      • HTTP: If you select Standard port for Protected Port, port 80 is protected by default for HTTP.
      • HTTPS: If you select Standard port for Protected Port, port 443 is protected by default for HTTPS.

        Hypertext Transfer Protocol Secure (HTTPS) is an extension of the Hypertext Transfer Protocol (HTTP). In HTTPS, the communication protocol is encrypted using Transport Layer Security (TLS) or, formerly, Secure Sockets Layer (SSL). HTTPS is widely used to protect privacy and integrity of data in transit and to authenticate website identities. So, if HTTPS is selected, you need to configure a certificate.

    • Server Protocol: the protocol supported by your website server. Server Protocol: protocol used by WAF to forward client requests. The options are HTTP and HTTPS.
      NOTE:

      If the client protocol is different from the origin server protocol, WAF forcibly uses the origin server protocol to forward client requests.

    • VPC: the VPC that the dedicated WAF instance belongs to.
      • Make sure that you have IAM permissions for the enterprise project the VPC you select belongs to, and that you have purchased dedicated WAF instances in this VPC.
      • To implement active-active services and prevent single points of failure (SPOFs), you can buy at least two WAF instances and provision them in the same VPC.
    • Server Address: private IP address of the website server. The origin server address cannot be the same as that of the protected object.

      Log in to the ECS or ELB console and view the private IP address of the server in the instance list.

      The following IP address formats are supported:
      • IPv4, for example, XXX.XXX.1.1
      • IPv6, for example, fe80:0000:0000:0000:0000:0000:0000:0000
    • Server Port: the service port of the server to which the dedicated WAF instance forwards client requests.
    • Weight: Requests are distributed across backend origin servers based on the load balancing algorithm you select and the weight you assign to each server.
      • If you select the weighted round robin algorithm, requests are distributed across origin servers in turn based on the weight you assign to each origin server.
      • If you select the source IP hash or session hash algorithm, the weight only determines whether traffic is distributed. If the Weight is 0, traffic is not distributed. If the Weight is not 0, traffic is distributed.
      • Weight range: 0 to 65,536. A larger weight indicates more requests distributed to the server.
      • If the weight is set to 0, the origin server will not accept new requests if multiple origin servers are configured. If only one origin server is configured, all requests are distributed to the origin server.
    • Remarks (Optional): Enter remarks about the server.

    Client Protocol: HTTP

    Server Protocol: HTTP

    Server Address: XXX.XXX.1.1

    Server Port: 80

    Certificate Name

    If you select HTTPS for Client Protocol, you need to select the certificate associated with the website. International websites are supported.

    • Each domain name must have a valid certificate associated. A wildcard domain name can only use a wildcard domain certificate. If you only have single-domain certificates, you need to add domain names to WAF one by one.
    • If your website certificate is about to expire, purchase a new certificate before the expiration date and update the certificate associated with the website in WAF.

      WAF can send notifications if a certificate expires. You can configure such notifications on the Notifications page. For details, see Enabling Alarm Notifications.

    You can import a new certificate, select an SCM certificate, or select an existing certificate.
    • Importing a certificate: If you have not created a certificate, click Import New Certificate. In the Import New Certificate dialog box, set certificate parameters. For more details, see Uploading a Certificate.

      Only .pem certificates can be used in WAF. If the certificate is not in PEM format, convert it into PEM first. For details, see How Do I Convert a Certificate into PEM Format?

      The newly imported certificates will be listed on the Certificates page as well.

    • Selecting an existing certificate: If you have created a certificate in WAF, click the drop-down arrow, select Existing certificates, and select a correct and valid certificate from the list.
    • Selecting an SCM certificate: If you have used a CCM certificate under the same account, you can select an SSL certificate from the drop-down list. The name of the SSL certificate you select must be the same as that in CCM.
      • Currently, certificates purchased in Huawei Cloud SCM can be pushed only to the default enterprise project. For other enterprise projects, SSL certificates pushed by SCM cannot be used.
      • A record is automatically generated for the selected SSL certificate on the Certificates page. You can change the certificate name on this page, but the certificate name displayed in CCM will not be changed accordingly.

    --

    IP Tag

    After a website is connected to WAF, Use Layer-7 Proxy is set to Yes by default. In this scenario, WAF is unable to directly obtain the real IP address of the client. This makes IP address-based protection rules invalid. You can select an IP tag to specify how WAF identifies client IP addresses. This enables WAF to obtain real client IP addresses.
    • $remote_sockaddr: If there is no other proxy in front of WAF, the packet contains the TCP Option Address (TOA), and you do not want WAF to use the TOA as the client IP address, select this option. With this tag configured, WAF uses the Layer 3 source IP address of the packet as the real client IP address.
    • $remote_addr: If there is a layer-4 proxy in front of WAF, WAF uses the TCP connection IP address as the real client IP address.
    • x-forwarded-for: If there is a layer-7 proxy in front of WAF, WAF uses the first IP address in the X-Forwarded-For (XFF) header as the real client IP address.
    • Custom: If there is a layer-7 proxy in front of WAF, WAF preferentially obtains the real client IP address from the configured field. If multiple fields are configured, WAF reads the real client IP address from left to right.

      If WAF does not obtain the real client IP address from the custom field, it reads the CDN-Src-Ip, X-Real-Ip, X-Forwarded-For, and $remote_addr fields in sequence to obtain the real client IP address.

    $remote_sockaddr

    Policy

    Select the protection policy you want to use for the website.
    • System-generated policy (default):
      • Basic Web Protection: General Check is enabled by default. It can defend against attacks such as SQL injections, XSS, remote overflow attacks, file inclusions, Bash vulnerability exploits, remote command execution, directory traversal, sensitive file access, and command/code injections.

        General Check includes:

        • Rule Set: Default rule set (medium) is selected.
        • Protective Action: Log only is selected. This means WAF only logs detected attacks but does not block them.
      • Anti-Crawler: Scanner detection is enabled by default, and Protective Action is set to Log only. WAF only logs detected attacks but does not block them. This type of detection can defend against web scans, such as vulnerability and virus scanning, and crawler behaviors from tools like OpenVAS and Nmap.
    • A protection policy created manually: a custom policy you create based on your security requirements. For more details, see Configuring a Protection Policy.

    System-generated policy

  4. Click Configure Load Balancer Now on the panel and configure a load balancer for the dedicated WAF instance.

    Figure 4 Configure Load Balancer Now

    You can also click Later and complete the operations by referring to Step 2: Configure a Load Balancer for a Dedicated WAF Instance, Step 3: Bind an EIP to a Load Balancer, and Step 4: Whitelist Back-to-Source IP Addresses of Dedicated WAF Instances.

Step 2: Configure a Load Balancer for a Dedicated WAF Instance

To ensure your dedicated WAF instance reliability, after you add a website to it, use Huawei Cloud Elastic Load Balance (ELB) to configure a load balancer and a health check for the dedicated WAF instance.

Huawei Cloud ELB is billed by traffic. For details, see ELB Pricing Details.

  1. Go to the ELB console and add a listener to the load balancer.

    1. In the upper left corner of the page, click and choose Networking > Elastic Load Balance.
    2. Click the target load balancer name to go to its details page.
    3. Click the Listeners tab, click Add Listener, and configure the listener information.

      The key parameters are described below. For details about other parameters, see Adding an HTTP Listener, Adding an HTTPS Listener, or Adding a TCP Listener.

      Table 2 Key parameters for adding a listener

      Item

      Parameter

      Description

      Example Value

      Configure Listener

      Frontend Protocol

      Protocol used by the load balancer to receive requests from the clients. You can select HTTP, HTTPS, or TCP.

      HTTP

      Frontend Port

      Port used by the load balancer to receive requests from the clients. Value range: 1 to 65535

      80

      Configure Routing Policy

      Load Balancing Algorithm

      Algorithm used by the load balancer. The options are Weighted round robin, Weighted least connections, Source IP hash, and Connection ID.

      CAUTION:

      If you select Weighted round robin, disable Sticky Session. If you enable Sticky Session, the same requests will be forwarded to the same dedicated WAF instance. If this instance becomes faulty, an error will occur when the requests come to it next time.

      Weighted round robin

      Add Backend Server

      Health Check

      If Health Check is enabled, the health check result must be Healthy, or the website requests cannot be pointed to WAF. For details about how to configure a health check, see Configuring a Health Check.

      Enable Health Check.

      After the listener is added, you can check the added listener on the Listeners tab and learn the details about the ELB load balancer (① in Figure 5), ELB listener (② in Figure 5), and backend server group (③ in Figure 5).

      Figure 5 Checking listener information

  2. Configure a load balancer for a dedicated WAF instance.

    1. Log in to the management console, click in the upper left corner of the page, and choose Security & Compliance > Web Application Firewall.
    2. In the navigation pane on the left, choose Assets > Dedicated WAF Engines.
    3. Locate the row containing the WAF instance. In the Operation column, choose More > Add to ELB.

      If you are in the CN East-Shanghai1 or CN North-Ulanqab1 region, you can select multiple running dedicated WAF instances that function as reverse proxies, click Add to Load Balancer in the upper left corner of the instance list, and add them to a load balancer to distribute workloads across the dedicated WAF instances.

    4. On the Add to ELB panel, select the ELB (Load Balancer), ELB Listener, and Backend Server Group configured in 1.c, and click Next.

      If Health Check is enabled, the health check result must be Normal, or the website requests cannot be pointed to WAF. For details about troubleshooting, see How Do I Troubleshoot an Unhealthy Backend Server?

      Figure 6 Add to ELB
    5. After configuring the service Port and Weight for the WAF instance, click OK.

      Backend Port: Select the protected port you configured in Step 1. Add a Website to WAF.

Step 3: Bind an EIP to a Load Balancer

If you configure a load balancer for your dedicated WAF instance, unbind the EIP from the origin server and then bind this EIP to the load balancer you configured. For details, see Configuring a Load Balancer. This way, request traffic first goes to your dedicated WAF instance for attack detection. WAF then forwards only clean traffic to your origin servers, keeping them secure, available, and stable.

This section uses an origin server added to an Elastic Load Balance (ELB) load balancer as an example. You need to unbind the EIP from the load balancer and then bind the EIP to the load balancer configured for your dedicated WAF instances. The specific operations depend on the actual service.

  1. Unbind the EIP from the origin server.

    1. In the upper left corner of the page, click and choose Networking > Elastic Load Balance.
    2. On the Load Balancers page, unbind the EIP from the origin server.
      • Unbinding an IPv4 EIP: Locate the row that contains the load balancer configured for the origin server. Then, in the Operation column, click More > Unbind IPv4 EIP.
      • Unbinding an IPv6 EIP: Locate the row that contains the load balancer configured for the origin server. Then, in the Operation column, click More > Unbind IPv6 Address.
      Figure 7 Unbinding an EIP
    3. In the displayed dialog box, click Yes.

  2. On the Load Balancers page, locate the load balancer configured for the dedicated WAF instance and bind the EIP unbound from the origin server to the load balancer.

    • Binding an IPv4 EIP: Locate the row that contains the load balancer configured for the dedicated WAF instance, click More in the Operation column, and select Bind IPv4 EIP.
    • Binding an IPv6 EIP: Locate the row that contains the load balancer configured for the dedicated WAF instance, click More in the Operation column, and select Bind IPv6 Address.
    • In the displayed dialog box, select the EIP unbound in 1.b and click OK.

Step 4: Whitelist Back-to-Source IP Addresses of Dedicated WAF Instances

In dedicated mode, website traffic is pointed to the load balancer configured for your dedicated WAF instances and then to dedicated WAF instances. The latter will filter out malicious traffic and route only normal traffic to the origin server. In this way, the origin server only communicates with WAF back-to-source IP addresses. By doing so, WAF protects the origin server IP address from being attacked. In dedicated mode, the WAF back-to-source IP addresses are the subnet IP addresses of the dedicated WAF instances.

The security software on the origin server may most likely regard WAF back-to-source IP addresses as malicious and block them. Once they are blocked, the origin server will deny all WAF requests. Your website may become unavailable or respond very slowly. So, you need to configure ACL rules on the origin server to trust only the subnet IP addresses of your dedicated WAF instances.

The way to whitelist an IP address varies depending on where your origin servers are provisioned. You can follow the way suitable for you.

If your origin servers are deployed on Huawei Cloud ECSs, perform the following steps to configure a security group rule to allow only the back-to-source IP address of the dedicated instance to access the origin servers.

  1. Obtain the subnet IP addresses of all dedicated WAF instances.

    1. Log in to the management console, click in the upper left corner of the page, and choose Security & Compliance > Web Application Firewall.
    2. In the navigation pane on the left, choose Assets > Dedicated WAF Engines.
    3. On the Dedicated Engine page, click the IP address in the IP Address column of the dedicated engine and copy the address.
      Figure 8 Obtaining the subnet IP address of a dedicated engine

  2. Add the subnet IP address to the ECS security group.

    1. Log in to the ECS console.
    2. In the upper left corner of the page, click and choose Networking > Elastic Cloud Server.
    3. On the Elastic Cloud Server page, click the target ECS instance name.
    4. On the ECS details page, click the Security Groups tab and click Change Security Group.
    5. On the Change Security Group panel displayed, select a security group or create a security group and click OK.
    6. Click the security group name to go to the Security Groups page on the network console. Then, click the security group name again to go to the basic information page of the security group.
    7. Click the Inbound Rules tab and click Add Rule. In the Add Inbound Rule dialog box, configure parameters as follows and click OK. Table 3 describes the parameters.
      Figure 9 Add Inbound Rule
      Table 3 Inbound rule parameters

      Parameter

      Configuration Description

      Priority

      Security group rule priority. Retain the default value.

      Action

      Security group rule policy. Set this parameter to Allow.

      Type

      Set the IP address type of the origin server.

      Protocol & Port

      Protocols and ports that will be allowed. If you select TCP (Custom ports), and leave Port empty or enter 1-65535 for it, traffic on all ports from the back-to-source IP addresses or IP address ranges is allowed.

      More details about protocols and ports are as follows:

      • Protocols are used to match traffic in a security group rule. TCP, UDP, GRE, and ICMP are supported.
      • Ports are destination ports used to match traffic in a security group rule. Value range: 1 to 65535

        Port formats:

        • Individual port: Enter a port number, such as 22.
        • Consecutive ports: Enter a port range, such as 22-30.
        • Non-consecutive ports: Enter ports and port ranges, such as 22,23-30. You can enter up to 20 port ranges. Each port range must be unique.
        • All ports: Leave it empty or enter 1-65535.

      Source

      Add IP Address/Mask of all WAF back-to-source IP addresses/ranges copied in 1 one by one.

      NOTE:

      One inbound rule can contain only one IP address. To configure an inbound rule for each IP address, click Add Rule and add more rules. A maximum of 10 rules can be configured.

    8. Click OK.

      Now, the security group allows all inbound traffic from the back-to-source IP addresses of all your dedicated WAF instances.

      To check whether the configuration takes effect, use the Telnet tool to check whether a connection to the origin server service port bound to the IP address protected by WAF is established.

      For example, run the following command to check whether the connection to the origin server service port 443 bound to the IP address protected by WAF is established. If the connection cannot be established over the service port but the website is still accessible, the security group inbound rules take effect.

      Telnet Origin-server-IP-address 443

If your origin server uses Huawei Cloud ELB to distribute traffic, perform the following steps to configure an access control policy to allow only the IP addresses of the dedicated WAF instances to access the origin server:

  1. Obtain the subnet IP addresses of all dedicated WAF instances.

    1. Log in to the management console, click in the upper left corner of the page, and choose Security & Compliance > Web Application Firewall.
    2. In the navigation pane on the left, choose Assets > Dedicated WAF Engines.
    3. On the Dedicated Engine page, click the IP address in the IP Address column of the dedicated engine and copy the address.
      Figure 10 Obtaining the subnet IP address of a dedicated engine

  2. Add the subnet IP address to the access control whitelist of the load balancer.

    1. In the upper left corner of the page, click and choose Networking > Elastic Load Balance.
    2. Locate the load balancer that distributes traffic across origin servers and click the load balancer name in the Name column to go to the details page.
    3. On the Listeners tab, click the target listener and then click Configure in the Access Control column.
      Figure 11 Listener list
    4. In the Configure Access Control dialog box, complete the following configurations and click OK.
      1. Configure an access policy.
        1. Choose Whitelist > IP Address Group and click View IP Address Groups.
        2. On the IP Address Groups page, click Create IP Address Group in the upper right corner. In the displayed Create IP Address Group dialog box, add the WAF access IP address obtained in 1.c to the IP Address text box.
        3. Return to the Configure Access Control dialog box and select the IP address group created in 2.d.i.2 from the drop-down list under IP Address Group.
      2. Enable Access Control. This function is enabled by default. Retain the default setting.
    5. Click OK.

      Now, the access control policy allows all inbound traffic from the back-to-source IP addresses of your dedicated WAF instances.

      To check whether the configuration takes effect, use the Telnet tool to check whether a connection to the origin server service port bound to the IP address protected by WAF is established.

      For example, run the following command to check whether the connection to the origin server service port 443 bound to the IP address protected by WAF is established. If the connection cannot be established over the service port but the website is still accessible, the security group inbound rules take effect.

      Telnet Origin-server-IP-address 443

Step 5: Test Dedicated WAF Instances

After adding a website to a dedicated WAF instance, verify that the WAF instance can forward traffic properly and the ELB load balancers work well.

Advanced Settings

When performing Basic Settings, you can configure IP Tag and Policy. You can retain the default settings for these configuration items. You can also adjust them based on your actual service requirements.

You can choose Assets > Protected Objects, click the website domain name, and configure these items on the website details page.

Dedicated mode access supports the following advanced settings.
Table 4 Advanced settings

Function

Supported Function

HTTPS security hardening

  • Configuring PCI DSS/3DS Compliance Check and TLS: To balance compatibility and security, WAF uses TLS v1.0 as the minimum TLS version and secure cipher suites by default. You can configure a more secure TLS version and cipher suite based on your service requirements. You can also enable PCI DSS and PCI 3DS. With these measures, you can identify compliance risks, encrypt transmission, and prevent frauds, keeping services secure and compliant.
  • Enabling the HTTP/2 Protocol: HTTP/2 is automatically enabled for dedicated WAF instances provisioned in May 2023 and later.
  • Enabling Cookie Security Attributes: If you enable this function, WAF automatically adds the HttpOnly and Secure attributes (both set to true) to the cookies returned by your origin server. This prevents security risks such as cross-site scripting (XSS) attacks, cookie hijacking, and man-in-the-middle (MITM) attacks. It also helps meet security compliance requirements and prevents web security scanners such as AppScan, AWVS, and NSFOCUS from recording the cookies as security threats.

Forwarding requests while preserving the original client IP addresses

Back-to-origin link and performance optimization

  • Configuring a Timeout for Connections Between WAF and a Website Server: You can configure a timeout for each key step in the process. If the request or response time exceeds the configured threshold, WAF terminates the process and returns an error code. This prevents long-term request blocking and unexpected resource usage.
  • Enabling Break Protection to Protect Origin Servers: This feature prevents website breakdowns caused by frequent 502 Bad Gateway or 504 Gateway Timeout errors or request processing delays.
  • Enabling Open Tracing: If you enable open tracing, you can trace complete request links based on access logs to obtain the request source, nodes that the request passes through, and response time. This helps you quickly locate and resolve service problems.

Network extension and high availability configuration

Improved O&M monitoring efficiency

  • Configuring a Response Body Length in Logs: You can specify a response body length, and the system will log only those responses that meet the specified length.
  • Configuring a Custom Log Trace ID: You can configure custom log trace IDs, and WAF extracts and records custom request or response header fields into the custom_traceid field in WAF logs. A unified trace ID is used to connect the entire link from the frontend, WAF, gateway, to the backend service. In doing this, WAF logs and service logs are associated. This greatly improves the efficiency of log tracing, troubleshooting, and security incident investigation.

Routine O&M

During routine protection, you may need to perform the following operations:

Configuration Suggestions for Your Production Environment

To ensure your service security and stability, take the following suggestions before connecting service domain names to WAF:

  • Access time: Change DNS resolution during off-peak hours to minimize the impact on your customers.
  • Gray policy: Connect domain names for the non-production environment first. After the services have been running properly for a period, then connect the domain names to the production environment.
  • Service checks: After the access is complete, you can check whether the services are normal in the following ways:
    • Viewing logs: Check whether the proportion of status code 200 fluctuates significantly and whether the QPS increases or decreases sharply. You can perform a check by referring to Querying a Protection Event.
    • Service monitoring: Check whether service functions, such as user visits and transactions, are normal.
  • Hardening origin servers: Configure an access control policy on your origin server to allow only WAF back-to-origin IP addresses to access the origin server on any ports. This prevents hackers from bypassing WAF to attack origin servers.
  • HTTPS configuration: Deploy an SSL certificate on both your origin server and WAF. Follow the configuration suggestions below to efficiently manage the certificate.
  • Rule optimization: Observe services for a period of time before enabling a rule to ensure that no normal requests are blocked mistakenly. For details, see Configuring Core Protection Rules.
  • Monitoring and alarms:
    • Enable alarm notifications by referring to Enabling Alarm Notifications to learn about the number of attacks on your website, certificate expiration, protection rule expiration, and changes of WAF back-to-origin IP addresses or IP addresses used by your website to access WAF.
    • Configure a Web Application Firewall - Domains alarm rule by referring to Configuring Alarm Monitoring Rules to monitor the number of requests, 5XX status codes, number of basic protection times, and number of CC protection times for protected domain names.
  • Backup policy: Save the current DNS, certificate, and back-to-origin configurations for quick rollback in case of a fault.