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

Adding Protection Rules to Block or Allow Traffic

After protection is enabled, CFW allows all traffic by default. You can configure protection rules to block or allow traffic.

You can configure protection rules in the following scenarios:
If your IP address is a back-to-source WAF IP address, you are advised to configure a protection rule or the whitelist to allow its access. Exercise caution when configuring a protection rule to block access, which may affect your services.

Specification Limitations

Only the professional edition supports VPC border protection and NAT traffic (private IP address) protection.

Constraints

  • CFW does not support application-level gateways (ALGs). ALG can analyze the fields in application-layer payloads and dynamically adjust policies for multi-channel protocols (such as FTP and SIP) whose payloads contain port numbers and IP addresses. However, CFW only support static policies for ports. To allow multi-channel protocol communication, you are advised to configure a rule to allow traffic from all ports.
  • To use CFW persistent connections, enable a bidirectional bypass policy. If you only enable a unidirectional policy, the client will need to re-initiate connections in certain scenarios, such as enabling or disabling protection.
  • Quota:
    • Up to 20,000 protection rules can be added.
    • The restrictions on a single protection rule are as follows:
      • A maximum of 20 source IP addresses and 20 destination IP addresses can be added.
      • A maximum of two source IP address groups and two destination IP address groups can be associated.
      • A maximum of five service groups can be associated.
  • Restrictions on domain name protection:
    • Domain names in Chinese are not supported.
    • Domain name protection depends on the DNS server you configure. The default DNS server may be unable resolute complete IP addresses. You are advised to configure DNS resolution if the domain names of your services need to be accessed.
  • Predefined address groups can be configured only for the source addresses in inbound rules (whose Direction is set to Inbound).

Impacts on Services

When configuring a blocking rule, if address translation or proxy is involved, evaluate the impact of blocking IP addresses with caution.

Related Operations

For details about how to add protection rules in batches, see Importing and Exporting Protection Policies.