Help Center> Web Application Firewall> Best Practices> Upgrading a Dedicated WAF Instance
Updated on 2024-02-29 GMT+08:00

Upgrading a Dedicated WAF Instance

You can upgrade your dedicated WAF instances on the WAF console to obtain the latest protection performance. To ensure business availability during the upgrade, upgrade your dedicated WAF instances by following the procedure below.

If your workloads have high reliability requirements, at least two dedicated WAF instances should be deployed in dual-active or multi-active architecture. A single dedicated WAF instance may cause single points of failure (SPOFs) once the ECS hosting it becomes faulty.

Prerequisites

You have connected the website to a dedicated WAF instance.

Upgrading a Single Dedicated WAF Instance

If you have deployed only one dedicated WAF instance for your workloads, perform the following operations:

  1. Buy a dedicated WAF instance.

    • The new dedicated WAF instance is of the latest version. So its Upgrade button is grayed out.
    • The VPC, subnet, security group, and other settings of the new instance must be the same as those of the original one. In this way, the new instance automatically synchronizes all WAF protection configurations of the original instance.

  2. Run the curl command on any ECS in the VPC the original dedicated WAF instance locates to check whether the workloads are normal.

    • HTTP workloads

      curl http://IP-address-of-the-dedicated-WAF-instance :Service-port -H "host:Service-domain-name" -H "User-Agent: Test"

    • HTTPS workloads

      curl https://IP-address-of-the-dedicated-WAF-instance :Service-port -H "host:Service-domain-name" -H "User-Agent: Test"

    Check whether the service is normal. If the service is normal, go to Step 3. If the service is abnormal, fix the issue by referring to Why Is the Access Status of a Domain Name Inaccessible? and How Do I Troubleshoot 404/502/504 Errors?. After the fault is rectified, go to Step 3.

    To run a curl command, your ECS must meet the following requirements:
    • The network communication is normal.
    • A curl command line tool has been installed. If you are using a Windows ECS, manually install a curl command line tool on it. If you are a using a non-Windows ECS, no such action is required as the curl tool is installed automatically along with the operating system.

  3. Add the new dedicated WAF instance to the backend server group of the ELB load balancer you are using.

    The following uses a shared load balancer to show how to add an instance to a backend server group.

    1. Choose Security > Web Application Firewall to go to the Dashboard page.
    2. In the navigation pane on the left, choose Instance Management > Dedicated Engine to go to the dedicated WAF instance page.
    3. Locate the row containing the WAF instance. In the Operation column, click More > Add to ELB.
    4. In the Add to ELB dialog box, specify ELB (Load Balancer), ELB Listener, and Backend Server Group you configure for the original dedicated instance.
    5. Click Confirm. Then, configure service port for the WAF instance. In this example, configure Backend Port to the one we configured for the original dedicated instance.

  4. On the ELB console, set the weight of the original dedicated instance to 0. For details, see Configuring Weights for Backend Servers.

    Requests are not forwarded to a backend server if its weight is set to 0.

  5. Delete the original dedicated WAF instance during off-peak hours.

    View the monitored metrics on Cloud Eye for the dedicated WAF instance, if there are less than five new connections, the traffic to the instance has decreased. For details, see Viewing Metrics of a Dedicated WAF Instance.

    1. In the navigation pane on the left on the WAF console, choose Instance Management > Dedicated Engine to go to the dedicated WAF instance page.
    2. In the row of the instance, click More > Delete in the Operation column.
    3. Click Confirm.

      Resources on deleted instance are released and cannot be restored.

Upgrading Multiple Dedicated WAF Instances

If you have deployed multiple dedicated WAF instances for your workloads, perform the following steps to upgrade them:

  1. On the ELB console, obtain the weight of a dedicated instance and then change the weight to 0. For details, see Configuring Weights for Backend Servers.

    Requests are not forwarded to a backend server if its weight is set to 0.

  2. Upgrade the dedicated WAF instance during off-peak hours.

    View the monitored metrics on Cloud Eye for the dedicated WAF instance, if there are less than five new connections, the traffic to the instance has decreased. For details, see Viewing Metrics of a Dedicated WAF Instance.

    1. In the navigation pane on the left on the WAF console, choose Instance Management > Dedicated Engine to go to the dedicated WAF instance page.
    2. In the row containing the desired instance, click Upgrade in the Operation column.
    3. Confirm the upgrade conditions and click Confirm.

      It takes about 5 minutes for the upgrade to complete.

  3. Run the curl command on any ECS in the VPC the dedicated WAF instance locates to check whether the workloads are normal.

    • HTTP workloads

      curl http://IP-address-of-the-dedicated-WAF-instance :Service-port -H "host:Service-domain-name" -H "User-Agent: Test"

    • HTTPS workloads

      curl https://IP-address-of-the-dedicated-WAF-instance :Service-port -H "host:Service-domain-name" -H "User-Agent: Test"

    Check whether the service is normal. If the service is normal, go to Step 4. If the service is abnormal, fix the issue by referring to Why Is the Access Status of a Domain Name Inaccessible? and How Do I Troubleshoot 404/502/504 Errors?. After the fault is rectified, go to Step 4.

    To run a curl command, your ECS must meet the following requirements:
    • The network communication is normal.
    • A curl command line tool has been installed. If you are using a Windows ECS, manually install a curl command line tool on it. If you are a using a non-Windows ECS, no such action is required as the curl tool is installed automatically along with the operating system.

  4. On the ELB console, change the weight of the dedicated instance from 0 to the one you obtain in Step 1. For details, see Configuring Weights for Backend Servers.
  5. Upgrade other dedicated WAF instances one by one by referring to Step 1 to Step 4.