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/ Getting Started/ Blocking Malicious Traffic Through IP Address Blacklist or Whitelist Rules

Blocking Malicious Traffic Through IP Address Blacklist or Whitelist Rules

Updated on 2025-02-19 GMT+08:00

By default, WAF allows access from all IP addresses. If you find that your website is accessed from malicious IP addresses, you can add a WAF blacklist or whitelist rule to block malicious IP addresses.

The following example shows you how to configure an IP address whitelist or blacklist rule. In this example, we use the WAF cloud load balancer access mode.

  • Website access mode: Cloud mode - Load balancer access
  • Protected objects: domain names and IP addresses
  • Billing mode: Yearly/Monthly
  • Edition: Standard
  • Protection rule: blacklist and whitelist settings

Process

Procedure

Description

Preparations

Sign up for a HUAWEI ID, enable Huawei Cloud services, top up your account, and assign WAF permissions to the account.

Step 1: Buy the Standard Edition Cloud WAF

Purchase WAF and select the region and WAF mode.

Step 2: Add a Website to WAF in Load Balancer Access Mode

Add the website you want to protect to WAF for traffic inspection.

Step 3: Configure an IP Address Blacklist or Whitelist Rule

Add blacklist and whitelist rules to block malicious IP addresses.

Preparations

  1. Before purchasing WAF, create a Huawei account and subscribe to Huawei Cloud. For details, see Registering a HUAWEI ID and Enabling HUAWEI CLOUD Services and Real-Name Authentication.

    If you have enabled Huawei Cloud services and completed real-name authentication, skip this step.

  2. Make sure that your account has sufficient balance, or you may fail to pay to your WAF orders.
  3. Make sure your account has WAF permissions assigned. For details, see Creating a User Group and Granting Permissions.
    Table 1 System policies supported by WAF

    Role/Policy Name

    Description

    Category

    Dependencies

    WAF Administrator

    Administrator permissions for WAF

    System-defined role

    Dependent on the Tenant Guest and Server Administrator roles.

    • Tenant Guest: A global role, which must be assigned in the global project.
    • Server Administrator: A project-level role, which must be assigned in the same project.

    WAF FullAccess

    All permissions for WAF

    System-defined policy

    None.

    WAF ReadOnlyAccess

    Read-only permissions for WAF.

    System-defined policy

Step 1: Buy the Standard Edition Cloud WAF

You can use the load balancer access mode only after you purchase the standard, professional, or platinum edition cloud WAF. The following describes how to buy the standard edition cloud WAF.

  1. Log in to Huawei Cloud management console.
  2. On the management console page, choose Security & Compliance > Web Application Firewall.
  3. In the upper right corner of the page, click Buy WAF. On the purchase page displayed, complete the purchase by referring to configurations below.
    Table 2 Purchase parameters

    Parameter

    Example Value

    Description

    WAF Mode

    Cloud Mode

    After purchasing WAF, submit a service ticket to enable the cloud load balancer access mode. WAF then can protect your websites deployed on Huawei Cloud. In this mode, the protected objects can be website domain names or IP addresses.

    Billing Mode

    Yearly/Monthly

    Yearly/Monthly is a prepaid billing mode, where you pay in advance for a subscription term and receive a discounted rate. This mode is ideal when the resource use duration is predictable.

    Region

    CN-Hong Kong

    You can select the region nearest to your services WAF will protect.

    Edition

    Standard

    This edition can protect small and medium-sized websites.

  4. Confirm the product details and click Buy Now in the lower right corner of the page.
  5. Check the order details and read the WAF Disclaimer. Then, select the box and click Pay Now.
  6. On the payment page, select a payment method and pay for your order.
NOTE:

After the purchase is complete, submit a service ticket to enable WAF cloud load balancer access mode.

Step 2: Add a Website to WAF in 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 Step 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 Step 1 from the drop-down list.
    • Set the backend server to the server address of the website you plan to add to WAF in Step 8.

  4. Click in the upper left corner and choose Web Application Firewall under Security & Compliance.
  5. In the navigation pane on the left, choose Website Settings.
  6. In the upper left corner of the website list, click Add Website.
  7. Select Cloud - Load balancer and click Configure Now.
  8. On the Add Website page, set the parameters by referring to Figure 1.

    • ELB (Load Balancer): Select an ELB load balancer. Make sure you have added the server address corresponding to the protected website to the ELB load balancer.
    • ELB Listener: Select All listeners.
    • Protected Domain Name: Enter the domain name or IP address you want to protect. We use www.example.com in this example.
    • Policy: System-generated policy is selected by default.
    Figure 1 Domain name settings

  9. Click OK.

Step 3: Configure an IP Address Blacklist or Whitelist Rule

  1. In the navigation pane on the left, choose Policies.
  2. Click the name of the target policy to go to the protection configuration page.
  3. Choose Blacklist and Whitelist and enable it.

    • : enabled
    • : disabled

  4. Above the blacklist and whitelist rule list, click Add Rule and configure a rule as shown in Figure 2.

    • IP Address/Range/Group: Select IP address/range. To block multiple IP addresses, select Address group.
    • IP Address/Range: Configure the IP addresses or IP address ranges you want to block, for example, 192.168.2.1.
    • Protective Action: Select Block.
    Figure 2 Blocking a specified IP address

  5. Click OK.

Related Information

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