Connecting Your Website to WAF (Cloud Mode - Load Balancer Access)
If your service servers are deployed on Huawei Cloud, you can connect your web services to your WAF instance in cloud load balancer access mode.
You can select Cloud Mode - Load balancer when connecting a website to WAF only when the website has used a dedicated load balancer to forward traffic. In this mode, WAF works in out-of-path mode and does not forward traffic. Before using this mode, configure a dedicated load balancer first. .
If you have enabled enterprise projects, you can select an enterprise project from the Enterprise Project drop-down list and add websites to be protected in the project.
Solution Overview
In cloud load balancer access mode, WAF is integrated into the load balancer gateway through an SDK modular. After your website is connected to WAF, the ELB load balancer mirrors the website traffic to WAF. WAF checks the mirrored traffic and synchronizes the check result to the load balancer. The load balancer determines whether to forward client requests to the origin server based on the check result it receives. In this method, WAF does not forward traffic. This eliminates compatibility and stability issues that might be caused by additional-layer of traffic forwarding.
Figure 1 shows the request forwarding process after a domain name is connected to WAF.
- 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.
- DNS returns the domain name resolution address to the client.
- The client accesses the ELB load balancer over its EIP.
- The ELB load balancer mirrors traffic to WAF.
- WAF checks the traffic and synchronizes the check result to the ELB load balancer.
- The ELB load balancer determines whether to forward traffic to the origin server based on check result WAF sends to it.
Prerequisites
- You have purchased a cloud WAF instance and understood details about how to connect a website to WAF.
- To use cloud load balancer WAF, you need to submit a service ticket to enable it for you first. Cloud load balancer WAF is available in some regions. For details, see Functions.
- If you want to use the load balancer access mode, make sure you are using standard, professional, or platinum cloud WAF. When you are using cloud WAF, the quotas for the domain name, QPS, and rule expansion packages are shared between the cloud load balancer and cloud CNAME access modes.
- You have purchased a dedicated load balancer with Specifications set to Application load balancing (HTTP/HTTPS). For more details, see Creating a Dedicated Load Balancer. Note that you should use the same account to buy the load balancer and dedicated WAF.
Connecting Your Website to WAF (Cloud Mode - Load balancer Access Mode)
- Create a dedicated load balancer.
- Specifications: Select Application load balancing (HTTP/HTTPS) .
- Set other parameters based on your service requirements.
- Add a listener to the load balancer created in 1. For details, see Adding an HTTP Listener or Adding an HTTPS Listener.
- Create a backend server group.
- Run the following command to check the service connectivity:
curl -kv -H "Host: {Origin server domain name}" {protocol of the listener}://{IP address of the ELB load balancer}:{port of the listener}
If status code 200 is returned, the service has been connected.
- Configure the websites for which you want WAF to check the traffic.
- 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.
- Select Cloud Mode - Load balancer and click Configure Now.
- On the displayed page, configure basic settings by referring to Table 1.
Figure 2 Configuring basic settings of a website
Table 1 Parameter description Parameter
Description
Example Value
ELB (Load Balancer)
Select the load balancer created in 1 and ensure that the server address of the protected website has been added to the load balancer.
elb-waf-test
ELB Listener
Listener configured for the selected ELB load balancer.
- All listeners
- Specific listener
All listeners
Website Name
(Optional) You can specify a name for your website.
None
Domain Name
Set this parameter to the domain name or IP address (public or private IP address) you want to protect. Make sure that the domain name has been resolved to the EIP of the load balancer created in 1.
Domain name: Single domain names or wildcard domain names are supported.- Single domain name: Enter a single domain name, for example, www.example.com.
- Wildcard domain name
- 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.
- Wildcard domain name* can be added.
NOTE:WAF can protect both public and private IP addresses. If a private IP address is used, ensure that the corresponding network path is accessible so that WAF can correctly monitor and filter traffic.
Single domain name: www.example.com
Wildcard domain name: *.example.com
IP Address:
XXX.XXX.1.1
Website Remarks
(Optional) You can enter a description for your website.
-
Policy
The system-generated policy is selected by default. You can select a policy you configured before. You can also customize rules after the domain name is connected to WAF.
System-generated policies
- Basic web protection (Log only mode and common checks)
The basic web protection defends against attacks such as SQL injections, XSS, remote overflow vulnerabilities, file inclusions, Bash vulnerabilities, remote command execution, directory traversal, sensitive file access, and command/code injections.
- Anti-crawler (Log only mode and Scanner feature)
WAF only logs web scanning tasks, such as vulnerability scanning and virus scanning, such as crawling behavior of OpenVAS and Nmap.
NOTE:- Log only: WAF only logs detected attacks instead of blocking them.
- Only the professional and platinum editions allow you to specify a custom policy for Policy.
System-generated policy
- Click OK.
You can view the added websites in the protected website list.
Follow-up Operations
- The initial Access Status of a website is Unaccessed. When a request reaches the WAF instance configured for the website, the access status automatically changes to Accessed. To address access failure, see Why Is the Access Status of a Domain Name or IP Address Inaccessible?
- Complete Recommended Configurations
- If HTTPS is selected for Client Protocol, you can configure PCI DSS/3DS compliance check and TLS, enable HTTP/2, and enable cookies.
- Enabling WAF IPv6 Protection: You can use WAF to protect IPv6 origin servers.
- Configuring a Timeout for Connections Between WAF and a Website Server: The default timeout for a connection between WAF and the origin server is 30 seconds. You can customize the connection timeout, read timeout, and write timeout.
- Configuring a Traffic Identifier for a Known Attack Source: Configure an identifier for the client IP address, session, or user to block malicious requests based on the IP address, cookie, or params for a duration you specify.
- Forwarding Custom Header Fields: After you add a header field, WAF inserts it into the request before forwarding the requests to the origin server to mark the requests.
- Modifying the Alarm Page: Customize the page you want to return to visitors when WAF blocks a website request.
- Adjust the protection policy configured for the protected domain name based on protection requirements. For details, see Protection Configuration Overview.
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