Integrating WAF with ELB to Protect Your Websites
Scenarios
If your service servers are deployed on Huawei Cloud, you can purchase dedicated WAF instances to protect important domain names or websites that only use IP addresses to provide services.
In this way, ELB routes HTTP or HTTPS requests first to dedicated WAF instances for filtering out malicious traffic and the latter then directs normal traffic to backend servers.
This document describes how you can add dedicated WAF instances to the backend server group of your load balancer to protect your websites.
Notes and Constraints
- The security group rules configured for backend servers must allow traffic from the backend subnet where the load balancer resides to the backend servers over the backend port. For details, see Configuring Security Group Rules for Backend Servers.
- The security group rules configured for WAF instances must allow traffic over the specified port. For details, see Adding a Security Group Rule.
Traffic Path
After WAF is integrated with ELB, the traffic flow is as illustrated in Figure 1.
Procedure
Creating an Application Load Balancer
- Log in to the management console.
- In the upper left corner of the page, click and select the desired region and project.
- Click in the upper left corner to display Service List and choose Networking > Elastic Load Balance.
- On the Load Balancers page, click Buy Elastic Load Balancer. For details, see Creating a Dedicated Load Balancer.
Complete the basic configuration of the load balancer as prompted. For example, select Application load balancing (HTTP/HTTPS) for Specifications.
Figure 3 Creating an application load balancer (Dedicated)
- Configure the network as prompted.
Choose Public IPv4 network for Network Type and select an existing EIP for or assign a new EIP to the load balancer to receive requests from public networks.
Figure 4 Selecting an EIP for the load balancer
- Confirm the information, click Next, and submit your request.
Adding an HTTP Listener and Creating a Backend Server Group
- Log in to the management console.
- In the upper left corner of the page, click and select the desired region and project.
- Click in the upper left corner to display Service List and choose Networking > Elastic Load Balance.
- On the Load Balancers page, locate the created load balancer and click its name.
- Under Listeners, click Add Listener. Add an HTTP listener and specify a frontend port for it.
For details, see .Figure 5 Adding an HTTP listener
- Click Next: Configure Request Routing Policy. On the Configure Routing Policy page, select Create new for Backend Server Group.
Figure 6 Creating a backend server group
- Click Next: Add Backend Server. Add backend servers and configure health check for the backend server group.
- Click Next: Confirm, confirm the settings, and click Submit.
Translating Domain Names into the EIP of the Load Balancer
Use Huawei Cloud DNS to translate your domain name, such as www.example.com, into the EIP bound to your load balancer.
For details about how to configure DNS, see Routing Internet Traffic to a Website.
Buying a Dedicated WAF Instance
- Log in to the management console.
- In the upper left corner of the page, click and select the desired region and project.
- Click in the upper left corner and choose Web Application Firewall under Security & Compliance.
- In the upper right corner of the page, click Buy WAF. Configure the parameters as prompted. Select Dedicated Mode for WAF Mode.
Figure 7 Buying a dedicated WAF instance
Dedicated WAF instances cannot be purchased. Only existing dedicated WAF instances can be used.
- Confirm the settings and go through the subsequent steps to complete the purchase.
Adding Your Website to WAF
You can add your website (domain name: www.example.com) to WAF by following the below steps. For more details, see Adding a Website to WAF (Dedicated Mode).
- Log in to the management console.
- In the upper left corner of the page, click and select the desired region and project.
- Click in the upper left corner and choose Web Application Firewall under Security & Compliance.
- In the navigation pane on the left, choose Website Settings.
- In the upper left corner of the website list, click Add Website.
In the displayed dialog box, select Dedicated mode and click OK.Figure 8 Adding a domain name to WAF
- Confirm the advanced settings. Set Proxy Configured to Layer-7 proxy.
Figure 9 Confirming advanced settings
Associating WAF with Your Load Balancer
You can add THE dedicated WAF instance to the backend server group. Ensure that the network ACL and the security group that contains the WAF instance allow traffic from IP address ranges where the WAF instance and load balancer are deployed.
- Log in to the management console.
- In the upper left corner of the page, click and select the desired region and project.
- Click in the upper left corner and choose Web Application Firewall under Security & Compliance.
- In the navigation pane on the left, choose Instance Management > Dedicated Engine to go to the dedicated WAF instance page.
- Locate the WAF instance created in Buying a Dedicated WAF Instance and choose More > Add to ELB in the Operation column.
- In the Add to ELB dialog box, specify ELB (Load Balancer), ELB Listener, and Backend Server Group.
Figure 10 Adding the WAF instance to a load balancer
- Click Confirm. Set Backend Port to the one configured for Protected Port in Adding Your Website to WAF.
- Click Confirm.
Whitelisting the Back-to-Source IP Addresses of Your Dedicated WAF Instance
In dedicated mode, website traffic is directed to the load balancer and then to dedicated WAF instances. The latter filters out malicious traffic and routes 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 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. As a result, your website may become unavailable or respond very slowly. Therefore, ACL rules must be configured on the origin server to trust only the subnet IP addresses of your dedicated WAF instances.
For details, see Pointing Traffic to a Load Balancer.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot