El contenido no se encuentra disponible en el idioma seleccionado. Estamos trabajando continuamente para agregar más idiomas. Gracias por su apoyo.

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

Creating a Domain Name

Updated on 2023-01-05 GMT+08:00

This section describes how to create a domain name and connect it to WAF. After connecting a domain name, WAF works as a reverse proxy between the client and server. The real IP address of the server is hidden and only the IP address of WAF is visible to web visitors.

Prerequisites

Login credentials have been obtained.

Domain Configuration Principle

  • Figure 1 shows how WAF works if the web server is using a proxy.
    Figure 1 A proxy configured
    • DNS resolves the domain name to the IP address of a proxy (such as AAD) before your site is moved to WAF. In this case, the traffic passes through the proxy and then the proxy routes the traffic back to the origin server.
    • After your site is moved to WAF, DNS resolves your domain name to the access address of WAF. In this way, the proxy forwards the traffic to WAF. WAF then filters out illegitimate traffic and only routes legitimate traffic back to the origin server.
      1. Change the back-to-source IP address of the proxy to the access address of WAF.
      2. Add a WAF subdomain name and TXT record to the DNS records of your DNS provider.
  • Figure 2 shows how WAF works if the web server does not use a proxy.
    Figure 2 No proxy configured
    • DNS resolves your domain name to the origin server IP address before your site is connected to WAF. Therefore, web visitors can directly access the server.
    • After your website is connected to WAF, DNS resolves your domain name to the CNAME record of WAF. In this way, the traffic passes through WAF. WAF then filters out illegitimate traffic and only routes legitimate traffic back to the origin server.

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 Service List at the top of the page and choose Security > Web Application Firewall.
  4. In the navigation pane, choose Domains.
  5. Click Create Domain.
  6. On the Create Domain page, specify required parameters by referring to Table 1.

    Table 1 Parameter description

    Parameter

    Description

    Example Value

    Domain Name

    A domain name to be protected, which can be a single domain name or a wildcard domain name.

    • 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, *.example.com.
      • 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

    Non-standard Port

    Set this parameter only if Non-standard Port is selected.

    • If Client Protocol is HTTP, WAF protects the standard port 80 by default. To protect a non-standard port, select Non-standard Port and then select a value from the Port drop-down list.
    • If Client Protocol is HTTPS, WAF protects the standard port 443 by default. To protect a non-standard port, select Non-standard Port and then select a value from the Port drop-down list.

    For details about non-standard ports supported by WAF, see Web Application Firewall.

    4443

    Server Configuration

    Address configurations of the web server, including Client Protocol, Server Protocol, Server Address, and Server Port.

    • Client Protocol: Type of client protocol. The options are HTTP and HTTPS.
    • Server Protocol: Protocol used by WAF to forward requests to the server. The options are HTTP and HTTPS.
      NOTE:

      For details about configuring Client Protocol and Server Protocol, see Rules for Configuring Client Protocol and Server Protocol.

    • Server Address: IP address (generally the A record before the domain name is connected to WAF) or domain name (generally the CNAME before the domain name is connected to WAF) of the web server that a client accesses
      NOTE:

      WAF cannot check server health. To check server health, use WAF along with Elastic Load Balance (ELB). After a load balancer is configured, use the EIP bound to the load balancer as your origin server IP address and point this IP address to your WAF instance.

    • Server Port: Port number used by the web server

    Client Protocol: HTTPS

    Server Protocol: HTTP

    Server Address: XXX.XXX.1.1

    Server Port: 80

    Certificate Name

    If Client Protocol is HTTPS, select an existing certificate or upload a new certificate. For details about how to upload a new certificate, see 7.

    None

  7. Upload a new certificate if Client Protocol is HTTPS.

    1. Click Upload Certificate. In the displayed Upload Certificate dialog box, enter the certificate name and paste the certificate file and private key to the corresponding text boxes.
      Currently, only .pem certificates are supported. If the certificate is not in .pem format, convert it into a .pem certificate by referring to Table 2 before uploading.
      Table 2 Certificate conversion commands

      Format

      Usage (Using OpenSSL)

      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 cert.key:

        openssl pkcs12 -in cert.pfx -nocerts -out cert.key -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. As an example, run the following command to convert cert.cer into cert.pem:

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

    2. Click OK.

  8. Set Proxy Configured. The default value is No.

    NOTICE:

    If a proxy is deployed before WAF on your website, the WAF working mode cannot be switched to Bypassed.

    • If your website is using a proxy such as Advanced Anti-DDoS (AAD), Content Delivery Network (CDN), or any other cloud acceleration service, select Yes so that the WAF security policies take effect on the origin server IP address. If this parameter is No, WAF cannot obtain the real IP address requested by a web visitor.
      NOTE:

      If a proxy such as CDN is used, WAF obtains the real source IP address of a client from the HTTP Header X-Forwarded-For by default. If the proxy does not use X-Forwarded-For to identify the real source IP address of a client, click next to X-Forwarded-For in the row of Source IP Header. In the displayed dialog box, select an existing source IP header or select Custom and enter a source IP header.

    • If your website does not use a proxy, select No.

  9. Click Create Now. In the upper right corner of the page, if Domain created successfully is displayed, the domain name is created.

    NOTE:

    If you do not want to connect the domain name to WAF in this step, click Next. Then click Finish. DNS is displayed as Unconfigured. Later, you can refer to Connecting a Domain Name to finish domain connection.

    • If a proxy such as CDN or AAD is used, you need to configure the back-to-source IP address, subdomain name, and TXT record.
      1. Configure the back-to-source IP address of the proxy on the website.

        For example, change the back-to-source IP address of CDN or AAD to the WAF IP address.

      2. Configure Subdomain Name and TXT Record.

        Add a subdomain name and TXT record to the DNS records of your DNS provider.

      NOTICE:

      The high availability of our system, which is based on multi-AZ deployments to support both active-active and disaster recovery, relies on the WAF CNAME record. Do not use a fixed IP address to access services. Otherwise, service disaster recovery reliability will be affected.

    • If no proxy is used, the CNAME record must be configured.
      1. Go to your DNS provider and configure the CNAME record. For details, contact your DNS provider.
        NOTICE:

        The high availability of our system, which is based on multi-AZ deployments to support both active-active and disaster recovery, relies on the WAF CNAME record. Do not use a fixed IP address to access services. Otherwise, service disaster recovery reliability will be affected.

        1. Do not modify the hosts file. Add the CNAME record directly to the DNS records of your DNS provider.
        2. Do not use the A record to replace the CNAME record.

        The CNAME binding method of some common DNS providers is listed for your reference. If the following configuration is inconsistent with the actual configuration, rely on information provided by the DNS providers.

        1. Log in to the management console of the DNS provider.
        2. Go to the domain resolution record page.
        3. Set the CNAME resolution record.
          • Set the record type to CNAME.
          • Generally, enter the domain name prefix in the host record. For example, if the protected domain name is admin.demo.com, enter admin in the host record.
          • The record value is the CNAME generated by WAF.
          • Resolution line: keep the default value TTL.
        4. Click Save.
        NOTICE:

        The preceding resolution methods are provided by third parties. This document does not control or assume responsibility for any third party content, including but not limited to its accuracy, compatibility, reliability, availability, legitimacy, appropriateness, performance, non-infringement, or status update, unless otherwise specified in this document.

      2. Verify that the CNAME has been configured.
        1. In Windows, choose Start > Run. Then enter cmd and press Enter.
        2. Run the following command to query the CNAME. If the configured CNAME is displayed, the configuration is successful.

          nslookup www.domain.com

  10. After the domain name is connected to WAF, click Next.
  11. Click Finish.

    You can view the DNS status and mode of the domain name in the domain list.

    NOTE:
    • If your web server is using other firewalls, disable the firewalls or whitelist the WAF IP address ranges.
    • If your web server is using personal security software, replace it with enterprise security software and whitelist the WAF IP address ranges.
    • If a domain name has been connected to WAF, DNS should be Normal. If DNS is Unconfigured, choose More > Check DNS in the Operation column of the target domain name to check the DNS status. If the problem persists, perform domain connection again by referring to What Should I Do If the DNS Status Is Unconfigured?
    • After a domain name is created, WAF protection is enabled by default. The mode of Basic Web Protection is Log only (detected attacks are only logged but not blocked.). WAF creates a CC attack protection rule for the domain name by default. The rule can be modified but cannot be deleted. Rate Limit in the rule is 500 requests/5 seconds by default and it can be adjusted up to 10,000 requests/5 seconds. If you want a higher rate limit than the maximum value, contact the administrator.

Rules for Configuring Client Protocol and Server Protocol

WAF provides various protocol types. If your website is www.example.com, WAF provides the following four access modes:

  • HTTP mode.

    Client Protocol and Server Protocol are set to HTTP.

    NOTICE:

    This configuration allows web visitors to access your website over HTTP only. If they access over HTTPS, they receive the 302 Found code and are redirected to http://www.example.com.

  • HTTPS mode. This configuration allows web visitors to access your website over HTTPS only. If they access over HTTP, they are redirected to https://www.example.com.
    NOTICE:
    • If web visitors access your website over HTTPS, the website returns a successful response.
    • If web visitors access your website over HTTP, they receive the 302 Found code and are directed to https://www.example.com.
  • HTTP and HTTPS mode.

    Add two server configurations. One uses HTTP for Client Protocol and Server Protocol, and the other uses HTTPS for Client Protocol and Server Protocol.

    NOTICE:
    • If web visitors access your website over HTTP, the website returns a successful response but no communication between the browser and website is encrypted.
    • If web visitors access your website over HTTPS, the website returns a successful response and all communications between the browser and website are encrypted.
  • HTTPS/HTTP mode.

    Client Protocol is set to HTTPS and Server Protocol is set to HTTP.

    NOTICE:

    If web visitors access your website over HTTPS, WAF forwards the requests to your origin server over HTTP.

Utilizamos cookies para mejorar nuestro sitio y tu experiencia. Al continuar navegando en nuestro sitio, tú aceptas nuestra política de cookies. Descubre más

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback