Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Web Application Firewall/ User Guide/ Connecting a Website to WAF/ Connecting Your Website to WAF (Cloud Mode - Load Balancer Access)

Connecting Your Website to WAF (Cloud Mode - Load Balancer Access)

Updated on 2024-11-05 GMT+08:00

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. .

NOTE:

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.

Figure 1 Website access diagram
The traffic forwarding details are as follows:
  1. 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.
  2. DNS returns the domain name resolution address to the client.
  3. The client accesses the ELB load balancer over its EIP.
  4. The ELB load balancer mirrors traffic to WAF.
  5. WAF checks the traffic and synchronizes the check result to the ELB load balancer.
  6. 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.
    NOTE:
    • 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)

  1. Create a dedicated load balancer.

    • Specifications: Select Application load balancing (HTTP/HTTPS) .
    • Set other parameters based on your service requirements.

  2. Add a listener to the load balancer created in 1. For details, see Adding an HTTP Listener or Adding an HTTPS Listener.
  3. Create a backend server group.

    • Load Balancer: Select Associate existing and select the load balancer created in 1 from the drop-down list.
    • Configure the server address of the website you plan to add to WAF in 5 as backend server.

  4. 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.

  5. Configure the websites for which you want WAF to check the traffic.

    1. Click in the upper left corner and choose Web Application Firewall under Security & Compliance.
    2. In the navigation pane on the left, choose Website Settings.
    3. In the upper left corner of the website list, click Add Website.
    4. Select Cloud Mode - Load balancer and click Configure Now.
    5. 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

    6. Click OK.

      You can view the added websites in the protected website list.

Follow-up Operations

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback