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

Step 1: Add a Website to WAF (Dedicated Mode)

Updated on 2024-03-14 GMT+08:00

If your service servers are deployed on the cloud, you can add the domain name or IP address of the website to WAF so that the website traffic is forwarded to WAF for inspection.

NOTE:

If you have enabled enterprise projects, you can select your enterprise project from the Enterprise Project drop-down list and add websites to be protected in the project.

Prerequisites

You have applied for a dedicated WAF instance.

Constraints

  • A dedicated Elastic Load Balance (ELB) load balancer has been used to distribute workloads for the website you want to add to WAF.
  • If your website has no layer-7 proxy server such as CDN and cloud acceleration service deployed in front of WAF and uses only layer-4 load balancers (or NAT), set Proxy Configured to No. Otherwise, Proxy Configured must be set to Yes. This ensures that WAF obtains real IP addresses of website visitors and takes protective actions configured in protection policies.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner of the management console and select a region or project.
  3. Click in the upper left corner and choose Web Application Firewall (Dedicated) under Security.
  1. In the navigation pane, choose Website Settings.
  2. In the upper left corner of the website list, click Add Website.
  3. Configure basic information of the domain name referring to Table 1.

    Table 1 Parameter description

    Parameter

    Description

    Example Value

    Website Name

    Website name you specify.

    WAF-OCB

    Protected Object

    A domain name or IP address of the website to be protected. The domain name can be a single domain name or a wildcard domain name.

    • Single domain name: Enter a single domain name. For example, www.example.com.
    • Wildcard domain name
      NOTE:

      WAF does not support wildcard domain names containing underscores (_).

      • If the server IP address of each subdomain name is the same, enter a wildcard domain name to be protected. 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.

    Single domain name: www.example.com

    Wildcard domain name: *.example.com

    IP address format: XXX.XXX.1.1

    Website Remarks

    Brief description of the website

    test

    Protected Port

    Select the port that needs to be protected from the drop-down list box.

    To protect port 80 or 443, select Standard port from the drop-down list.

    Standard ports

    Server Configuration

    Address of the web server. The configuration contains the Client Protocol, Server protocol, VPC, Server Address, and Server Port.

    • Client Protocol: Protocol used for forwarding a client requests to the dedicated WAF instance. The options are HTTP and HTTPS.
    • Server Protocol: Protocol used for forwarding a client request to the origin server through the dedicated WAF instance. The options are HTTP and HTTPS.
      NOTE:

      WAF can check WebSocket and WebSockets requests, which is enabled by default.

    • VPC: Select the VPC to which the dedicated WAF instance belongs.
    • Server Address: Private IP address of the website server that a client (for example, a browser) accesses.
    • Server Port: service port of the server to which the dedicated WAF instance forwards client requests.

    Client Protocol: HTTP

    Server Protocol: HTTP

    VPC: vpc-default

    Server Address: 192.168.1.1

    Server Port: 80

    Certificate Name

    If you set Client Protocol to HTTPS, an SSL certificate is required. You can select an existing certificate or import an external certificate. For details about how to import a certificate, see Importing a New Certificate.

    For details about how to create a certificate, see Uploading a Certificate.

    NOTICE:
    • Only .pem certificates can be used in WAF. If the certificate is not in .pem, convert it into a .pem certificate by referring to Importing a New Certificate before uploading the certificate.
    • Each domain name must have a certificate associated. A wildcard domain name can only use a wildcard domain certificate. If you only have single-domain certificates, you need to add domain names one by one in WAF.

    None

  4. Configure Proxy Configured.

    If your website has no layer-7 proxy server such as CDN and cloud acceleration service deployed in front of WAF and uses only layer-4 load balancers (or NAT), set Proxy Configured to No. Otherwise, Proxy Configured must be set to Yes. This ensures that WAF obtains real IP addresses of website visitors and takes protective actions configured in protection policies.

  5. Select a policy. By default, System-generated policy is selected.

    You can select a policy you configured. 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 attack events instead of blocking them.

  6. Click Confirm.

    To enable WAF protection, there are still several steps, including configuring a load balancer, binding an EIP to the load balancer, and whitelisting WAF IP addresses. You can click Later in this step. Then, follow the instructions and finish those steps by referring to Step 2: Configure a Load Balancer for WAF and Step 3: Bind an EIP to a Load Balancer.

Verification

The initial Access Status of a website is Inaccessible. After you configure a load balancer and bind an EIP to the load balancer for your website, when a request reaches the WAF dedicated instance, the access status automatically changes to Accessible.

Importing a New Certificate

If you set Client Protocol to HTTPS, an SSL certificate is required. You can perform the following steps to import a new certificate.

  1. Click Import New Certificate. In the displayed dialog box, enter a certificate name, and copy and paste the certificate file and private key to the corresponding text boxes.
    NOTE:

    WAF encrypts and saves the private key to keep it safe.

    Only .pem certificates can be used in WAF. If the certificate is not in .pem format, convert it into .pem locally by referring to Table 2 before uploading it.
    Table 2 Certificate conversion commands

    Format

    Conversion Method

    CER/CRT

    Rename the cert.crt certificate file to cert.pem.

    PFX

    • Obtain a private key. For example, run the following command to convert cert.pfx into key.pem:

      openssl pkcs12 -in cert.pfx -nocerts -out key.pem -nodes

    • Obtain a certificate. For example, run the following command to convert cert.pfx into cert.pem:

      openssl pkcs12 -in cert.pfx -nokeys -out cert.pem

    P7B

    1. Convert a certificate. For example, run the following command to convert cert.p7b into cert.cer:

      openssl pkcs7 -print_certs -in cert.p7b -out cert.cer

    2. Rename certificate file cert.cer to cert.pem.

    DER

    • Obtain a private key. For example, run the following command to convert privatekey.der into privatekey.pem:

      openssl rsa -inform DER -outform PEM -in privatekey.der -out privatekey.pem

    • Obtain a certificate. For example, run the following command to convert cert.cer into cert.pem:

      openssl x509 -inform der -in cert.cer -out cert.pem

    NOTE:
    • Before running an OpenSSL command, ensure that the OpenSSL tool has been installed on the local host.
    • If your local PC runs a Windows operating system, go to the command line interface (CLI) and then run the certificate conversion command.
  2. Click Confirm.

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