Updated on 2024-09-19 GMT+08:00

Condition Field Description

When setting a CC attack, precise access, or global whitelist protection rule, there are some fields in the Condition List or Trigger area. These fields together are used to define the request attributes to trigger the rule. This topic describes the fields that you can specify in conditions to trigger a rule.

What Is a Condition Field?

A condition field specifies the request attribute WAF checks against protection rules. When configuring a CC attack protection rule, precise access protection rule, or global protection whitelist, you can define condition fields to specify request attributes to trigger the rule. If a request meets the conditions set in a rule, the request matches the rule. WAF handles the request based on the action (for example, allow, block, or log only) set in the rule.

Figure 1 Condition field

A condition field consists of the field, subfield, logic, and content. Example:

  • Example 1: If Field is set to Path, logic to Include, and Content to /admin, a request matches the rule when the requested path contains /admin.
  • Example 2: Set Field to IPv4, Subfield to Client IP Address, Logic to Equal to, and Content to 192.XX.XX.3. When the client IP address is 192.XX.XX.3, the request hits the rule.

Supported Condition Fields

Table 1 Condition list configurations

Field

Subfield

Logic

Content (Example)

Path: Part of a URL that does not include a domain name. This value supports exact matches only. For example, if the path to be protected is /admin, Path must be set to /admin.

--

Select the desired logical relationship from the Logic drop-down list.

/buy/phone/

NOTICE:
  • If Path is set to /, all paths of the website are protected.
  • The path content cannot contain the following special characters: (<>*)

User Agent: A user agent of the scanner to be protected

--

Mozilla/5.0 (Windows NT 6.1)

IP: An IP address of the visitor.

  • Client IP Address
  • X-Forwarded-For
  • TCP connection IP address
  • Layer 3 source IP address

XXX.XXX.1.1

Params: A request parameter to be protected

  • All fields
  • Any subfield
  • Custom

201901150929

Referer: A user-defined request resource

For example, if the protected path is /admin/xxx and you do not want visitors to access the page from www.test.com, set Content for Referer to http://www.test.com.

--

http://www.test.com

Cookie: A small piece of data to identify web visitors

  • All fields
  • Any subfield
  • Custom

jsessionid

Header: A user-defined HTTP header

  • All fields
  • Any subfield
  • Custom

text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8

Method: the user-defined request method.

--

GET, POST, PUT, DELETE, and PATCH

Request Line: Length of a user-defined request line.

--

50

Request: Length of a user-defined request. It includes the request header, request line, and request body.

--

--

Protocol: the protocol of the request.

--

http

Response Code: Status code returned to the request.

--

  • Equal to
  • Not equal to
  • Equal to any value
  • Not equal to any value

404

Response Length: the length of the response to the request.

--

  • Subfield length equal to
  • Subfield length not equal to
  • Subfield length greater than
  • Subfield length less than

--

Response Time: time to respond the request.

--

  • Subfield length equal to
  • Subfield length not equal to
  • Subfield length greater than
  • Subfield length less than

--

Response Header: response header.

  • All fields
  • Any subfield
  • Custom
  • Include
  • Exclude
  • Equal to
  • Not equal to
  • Prefix is
  • Prefix is not
  • Suffix is
  • Suffix is not
  • Include any value
  • Exclude any value
  • Equal to any value
  • Not equal to any value
  • Prefix is any value
  • Prefix is not any value
  • Suffix is any value
  • Regex matching

--

Response Body: response message body

--

  • Include
  • Exclude
  • Include any value
  • Exclude any value
  • Regex matching

--

Request message body.

--

  • Include
  • Exclude
  • Include any value
  • Exclude any value
  • Regex matching

--