Combining AAD and WAF to Get All-Round Protection
How the Combination Works
- Advanced Anti-DDoS (AAD) works as a proxy and uses AAD IP address to forward requests to origin servers. All public network traffic is diverted to the AAD IP address so that the origin server is hidden from the public. This protects origin servers from DDoS attacks.
Objects supported by AAD: domain names of web applications on HUAWEI CLOUD, other cloud platforms, or on-premises data centers
- Web Application Firewall (WAF) keeps web services stable and secure. It examines all HTTP and HTTPS requests to detect and block the following attacks: Structured Query Language (SQL) injection, cross-site scripting (XSS), web shells, command and code injections, file inclusion, sensitive file access, third-party vulnerability exploits, Challenge Collapsar (CC) attacks, malicious crawlers, and cross-site request forgery (CSRF). WAF offers the cloud, dedicated, and ELB mode to protect websites. You can add either domain names or IP addresses to WAF. Before you start, get familiar with the following differences:
- Cloud mode: protects your web applications on HUAWEI CLOUD, other cloud platforms, or on-premises data centers through domain names.
- Dedicated or ELB mode: protects your web applications on HUAWEI CLOUD through domain names or IP addresses.
You can deploy both AAD and WAF to protect your websites hosted on HUAWEI CLOUD, other clouds, or in on-promises data centers. The combination of AAD and WAF can protect your website against DDoS attacks (such as NTP flood, SYN flood, ACK flood, ICMP flood, and HTTP Get flood attacks), web application attacks (such as SQL injection, cross-site scripting, web shells, command/code injection, file inclusion, sensitive file access, third-party application vulnerability attacks, CC attacks, malicious crawler scanning, and cross-site request forgery). Figure 1 shows the configuration.
If you configure AAD and WAF for your website, website traffic goes to AAD first. AAD scrubs incoming traffic and forwards clean traffic to WAF. WAF blocks attacks and forwards only the normal traffic to the origin server. In this way, two layers of protection are implemented on your website.

The configurations are as follows:
- Cloud mode
Resolve the website domain name to AAD and change the AAD back-to-source IP address to WAF CNAME record. To prevent others from configuring your domain names on WAF in advance (this will cause interference on your domain name protection), add the subdomain name and TXT record on your DNS management platform.
- Dedicated mode
Point the website domain name to AAD and change the AAD back-to-source IP address to the EIP bound to the load balancer configured for your dedicated WAF instance.
- ELB mode
Resolve the website domain name to AAD and change the AAD back-to-source IP address to the EIP bound to the load balancer configured for the dedicated WAF instance.
Prerequisites
You have purchased an AAD instance, connected your website service to the instance, and completed the configurations shown in Table 1.
| Deployment Mode | Description |
|---|---|
| Cloud mode |
NOTICE: To ensure that the WAF policy takes effect for the real source IP address, ensure that Yes is selected for Proxy Configured when you add the domain name to WAF. For details, see Viewing Basic Information |
| Dedicated mode |
|
| ELB mode |
|
Cloud WAF Configuration
The methods to configure the DNS server are similar. The following uses HUAWEI CLOUD AAD as an example.
- Obtain settings of CNAME, Subdomain Name, and TXT Record.
- Log in to the management console.
- Go to the Website Settings page by following the steps shown in Figure 2.
- In the Protected Website column, click the domain name you want to go to the Basic Information page.
- On the page for configuring basic domain information, click
in the row where the CNAME is located to copy CNAME. In the row of Access Status, click How to Access. In the Access Guide dialog box, copy Subdomain Name and TXT Record. Figure 3 Domain name access information
- Change the AAD back-to-source IP address.
- Click
at the top of the page and choose Security & Compliance > DDoS Mitigation. In the navigation pane on the left, choose Advanced Anti-DDoS > Domain Name Access to go to the domain name configuration page. - In the Operation column of the target domain name, click Edit. On the displayed page, set Origin Server IP Address/Domain Name to the copied WAF CNAME record. Figure 4 shows an example.
- Click OK.
- Click
- (Optional) Add a WAF subdomain name and TXT record at your DNS provider.
To prevent others from configuring your domain names on WAF in advance (this will cause interference on your domain name protection), this step is recommended.
- Access the DNS resolution page, as shown in Figure 5.
- In the upper right corner of the page, click Add Record Set. The Add Record Set page is displayed. Figure 6 shows an example.
- Name: TXT record copied in 1.d.
- Type: Select TXT – Specify text records.
- Alias: Select No.
- Line: Default
- TTL (s): The recommended value is 5 min. A larger TTL value will make it slower for synchronization and update of DNS records.
- Value: Add quotation marks to the TXT record copied in 1.d and paste them in the text box, for example, TXT record.
- Keep other settings unchanged.
- Click OK.
- (Optional) Ping the IP address of your domain name to check whether the new DNS settings take effect.
It takes some time for the new DNS settings to take effect. If ping fails, wait for 5 minutes and ping again.
Dedicated/ELB WAF Configuration
Perform the following steps to complete configurations on HUAWEI CLOUD AAD:
- Log in to the management console.
- Click
in the upper left corner of the management console and select a region or project. - Click
in the upper left corner of the page and choose Security & Compliance > DDoS Mitigation. - In the navigation pane on the left, choose Advanced Anti-DDoS > Domain Name Access to go to the Domain Name Access page.
- In the row containing the domain name you want, click Modify in the Operation column.
- In the Modify Domain Name dialog box, change the origin server IP address. Figure 7 shows an example.
- If you use a dedicated WAF instance, enter the EIP bound to the load balancer in the Origin text box.
- If you use a load-balancing WAF instance, enter the EIP bound to the load balancer configured for the WAF instance in the Origin text box.
- Click OK.
Verification
If Access Status is Accessible, the traffic destined for your website domain name or IP address is routed to WAF.
If WAF detects 20 access requests to a website within 5 minutes, WAF considers that the website has been successfully connected to WAF.
If a domain name fails to be connected to WAF, its access status is Inaccessible. To fix this issue, see Why Is the Access Status of a Domain Name or IP Address Inaccessible?
Last Article: Combining CDN and WAF to Get Improved Protection and Load Speed
Next Article: Obtaining the Client IP Address






Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.