Este conteúdo foi traduzido por máquina para sua conveniência e a Huawei Cloud não pode garantir que o conteúdo foi traduzido com precisão. Para exibir o conteúdo original, use o link no canto superior direito para mudar para a página em inglês.
Atualizado em 2023-09-21 GMT+08:00

Passo 2: Coloque os endereços de IP de WAF na lista branca

To let your cloud WAF instances take effect, configure ACL rules on the origin server to trust only the back-to-source IP addresses of all your cloud WAF instances. This prevents hackers from attacking the origin server through the server IP addresses.

ACL rules must be configured on the origin server to whitelist WAF back-to-source IP addresses. Otherwise, your website visitors will frequently receive 502 or 504 error code after your website is connected to WAF in cloud mode.

What Are Back-to-Source IP Addresses?

From the perspective of a server, all web requests originate from WAF. The IP addresses used by WAF forwarding are back-to-source IP addresses of WAF. The real client IP address is written into the X-Forwarded-For (XFF) HTTP header field.

Figura 1 Back-to-source IP address

WAF Back-to-Source IP Address Check Mechanism

A back-to-source IP address, or WAF IP address, is randomly allocated from the back-to-source IP address range. When WAF forwards requests to the origin server, WAF will check the IP address status. If the IP address is abnormal, WAF will remove it and randomly allocate a normal one to receive or send requests.

WAF back-to-source IP addresses are periodically updated. Whitelist the new IP addresses in time to prevent these IP addresses from being blocked by origin servers.

Why Do I Need to Whitelist the WAF IP Address Ranges?

All web requests originate from a limited quantity of WAF IP addresses. The security software on the origin server may most likely regard these IP addresses as malicious and block them. Once WAF IP addresses are blocked, the website may fail to be accessed or it opens extremely slowly. To fix this, add the WAF IP addresses to the whitelist of the security software.

After you connect your website to WAF, uninstall other security software from the origin server or allow only the requests from WAF to access your origin server. This ensures normal access and protects the origin server from hacking.

Procedure

  1. Efetue login no console de gerenciamento.
  2. Click in the upper left corner of the management console and select a region or project.
  3. Click in the upper left corner and choose Web Application Firewall under Security & Compliance.
  4. In the navigation pane, choose Website Settings.
  5. Above the website list, click WAF Back-to-Source IP Addresses.

    Figura 2 WAF Back-to-Source IP Addresses

  6. In the displayed dialog box, click Copy to copy all the addresses.

    Figura 3 WAF Back-to-Source IP Addresses dialog box

  7. Open the security software on the origin server and add the copied IP addresses to the whitelist.

    If you deploy your origin server on HUAWEI CLOUD ECSs and use ELB for balancing workloads, allow all WAF back-to-source IP addresses by referring to Origin Server Protection.