All Products
Search
Document Center

Edge Security Acceleration:BatchCreateDcdnWafRules

Last Updated:Oct 12, 2026

Configures WAF protection rules.

Operation description

Note

Rate limit per user: 20 calls per second.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dcdn:BatchCreateDcdnWafRules

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

PolicyId

integer

Yes

The policy ID.

1000001

RuleConfigs

string

Yes

The configuration of the protection rules.

[{"name":"example","action":"monitor","conditions":[{"key":"URL","opValue":"match-one","values":"1,2,3,4,5"},{"key":"Header","opValue":"contain-one","subKey":"example_subkey","values":"6,7,8,9,10"}],"ratelimit":{"target":"header","interval":10,"threshold":5,"ttl":1800,"subKey":"example_subkey","status":{"code":"502","count":5}},"ccStatus":"on","effect":"rule","status":"on"}]

RuleConfigs value description

  • RuleConfigs is a list slice, where each struct represents a rule.

  • The format of RuleConfigs varies based on the type of the protection policy specified by PolicyId.

Protection scenario 1: Web regex protection (waf_group)

ParameterTypeRequiredExampleDescription
statusStringNoonThe switch for the protection rule. Valid values: on (enable) and off (disable). Default value: on.
actionStringYesblockThe action of the rule. Valid values: block (block requests) and monitor (monitor requests).
wafGroupIdsStringNo1012The ID of the WAF rule group. Default value: 1012. Separate multiple IDs with commas (,).

waf_group configuration example:

// Web regex protection currently supports only one rule per policy.
[
  {
    "status": "on",
    "action": "block"
  }
]

Protection scenario 2: Custom rules (custom_acl)

ParameterTypeRequiredExampleDescription
namestringYesacl_1The name of the protection rule. The name can contain letters, digits, and underscores (_), and can be up to 64 characters in length.
statusstringNoonThe switch for the protection rule. Valid values: on (enable) and off (disable). Default value: on.
conditionsConditionYes[ {"key": "URI", "subKey": "","opValue": "contain", "values": "/login.php" }]The conditions that trigger the rule. For more information about the parameters, see Table 1 Condition metric description.
ccStatusstringYesoffThe switch for frequency control. Valid values: on (enable) and off (disable).
rateLimitRateLimitNo{ "target": "Header", "subKey": "User-Agent", "interval": 5, "threshold": 2, "ttl": 1800}The frequency control rule. This parameter is required when ccStatus is set to on. For more information about the parameters, see Table 2 RateLimit metric description.
effectstringNoserviceThe effective scope of the frequency control blacklist. This parameter is required when ccStatus is set to on. Valid values: rule (effective for the current rule) and service (globally effective).
actionstringYesdenyThe action of the rule. Valid values: deny (block), js (JavaScript verification), and monitor (monitor).

Table 1 Condition metric description

ParameterTypeRequiredExampleDescription
KeystringYesQuery String ParameterThe match field. For more information, see DescribeDcdnWafFilterInfo.
subKeystringNoactionThe match subfield. For more information, see DescribeDcdnWafFilterInfo.
opValueStringYeseqThe logical operator. For more information, see DescribeDcdnWafFilterInfo.
valuesStringNojsThe match content. Separate multiple values with commas (,). For more information, see DescribeDcdnWafFilterInfo.

Table 2 RateLimit metric description

ParameterTypeRequiredExampleDescription
targetstringYesHeaderThe statistical field for frequency control. Valid values: IP (counts the frequency of requests from the same IP address), Header (counts the frequency of requests that contain the specified header), Query String Parameter (counts the frequency of requests that contain the specified parameter), Cookie Name (counts the frequency of requests that contain the specified cookie), and Session (counts the frequency of requests from the same session).
subKeystringNoUser-AgentThe subfield of the unified field. This parameter is required when target is set to Header, Query String Parameter, or Cookie Name.
IntervalIntegerYes5The statistical period. Valid values: 5 to 1800. Unit: seconds.
thresholdIntegerYes2The statistical threshold. Valid values: 2 to 500000. Unit: times.
ttlIntegerYes1800The timeout period of the blacklist. Valid values: 60 to 86400. Unit: seconds.
statusRateLimitStatusNo{"code": "404", "ratio": 10}The statistics of response codes. For more information about the parameters, see Table 3 RateLimitStatus metric description.

Table 3 RateLimitStatus metric description

ParameterTypeRequiredExampleDescription
codetstringYes404The HTTP status code.
ratioIntegerNo10The statistical percentage (%). Valid values: 1 to 100. This parameter and the count parameter are mutually exclusive.
countIntegerNo10The statistical count. Valid values: 2 to 50000. This parameter and the ratio parameter are mutually exclusive.

custom_acl configuration example:

[
  // Access control
  {
    "name": "acl_1",
    "status": "off",
    "conditions":
    [
      {
        "key": "Query String Parameter",
        "subKey": "action",
        "opValue": "eq",
        "values": "js"
      }
    ],
    "ccStatus": "off",
    "action": "js"
  },
  // Frequency control
  {
    "name": "cc_1",
    "status": "on",
  	"conditions": 
    [
      {
        "key": "URI",
        "subKey": "",
        "opValue": "contain",
        "values": "/login.php"
      },
      {
        "key": "IP",
        "subKey": "",
        "opValue": "ip-contain",
        "values": "192.168.0.1/24"
      }
    ],
    "ccStatus": "on",
    "ratelimit":
    {
      "target": "Header",
      "subKey": "User-Agent",
      "interval": 5,
      "threshold": 2,
      "ttl": 1800,
      "status":
      {
        "code": "404",
        "ratio": 10
      }
    },
    "effect": "service",
    "action": "deny"
  }
]

Protection scenario 3: Whitelist (whitelist)

ParameterTypeRequiredExampleDescription
namestringYesonThe name of the protection rule. The name can contain letters, digits, and underscores (_), and can be up to 64 characters in length.
statusstringNoonThe switch for the protection rule. Valid values: on (default, enable) and off (disable).
conditionsConditionYes[{ "key": "Http-Method","subKey": "","opValue": "match-one", "values": "GET,POST,DELETE" }]The conditions that trigger the rule. For more information about the parameters, see Table 1 Condition metric description.
tagsStringYes[ "waf_group", "custom_acl"]The list of protection policy types.
regularTypesStringNo[ [ "sqli", "xss","code_exec", "crlf", "lfilei", "rfilei", "webshell","vvip", "other"]The type of the regular expression rule. This parameter can be specified when waf_group is included in tags. Valid values: sqli, xss, code_exec, crlf, lfilei, rfilei, webshell, vvip, and other.
regularRulesStringNo[ "100001", "100002", "100003"]The regular expression rule. This parameter can be specified when waf_group is included in tags. This parameter and regularTypes are mutually exclusive. The value is a list of six-digit strings.

whitelist configuration example:

[
  // Skip all scenarios
  {
    "name": "wl_all",
    "status": "on",
    "conditions":
    [
      {
        "key": "Http-Method",
        "subKey": "",
        "opValue": "match-one",
        "values": "GET,POST,DELETE"
      }
    ],
    "tags":
    [
      "waf_group",
      "custom_acl",
      "ip_blacklist",
      "region_block"
    ]
  },
  // Skip specified rule IDs in waf_group
  {
    "name": "wl_waf_id",
    "status": "off",
    "conditions":
    [
      {
        "key": "Cookie Name",
        "subKey": "cdn-sec",
        "opValue": "prefix-match",
        "values": "a7sdsa9dsa8d8sa"
      },
      {
        "key": "Referer",
        "subKey": "",
        "opValue": "none",
        "values": ""
      }
    ],
    "tags":
    [
      "waf_group"
    ],
    "regularRules":
    [
      "100001",
      "100002",
      "100003"
    ]
  },
  {
  // Skip specified rule types in waf_group
    "name": "wl_waf_type",
    "status": "on",
    "conditions":
    [
      {
        "key": "Query String",
        "subKey": "",
        "opValue": "exists",
        "values": ""
      }
    ],
    "tags":
    [
      "waf_group"
    ],
    "regularTypes":
    [
      "sqli",
      "xss",
      "code_exec",
      "crlf",
      "lfilei",
      "rfilei",
      "webshell",
      "vvip",
      "other"
    ]
  },
  // Skip custom rules
  {
    "name": "wl_custom_acl",
    "status": "on",
    "conditions":
    [
      {
        "key": "Http-Method",
        "subKey": "",
        "opValue": "match-one",
        "values": "GET,POST,DELETE"
      }
    ],
    "tags":
    [
      "custom_acl"
    ]
  },
  // Skip IP blacklist
  {
    "name": "wl_ip_blacklist",
    "status": "on",
    "conditions":
    [
      {
        "key": "Http-Method",
        "subKey": "",
        "opValue": "match-one",
        "values": "GET,POST,DELETE"
      }
    ],
    "tags":
    [
      "ip_blacklist"
    ]
  },
  // Skip region blocking
  {
    "name": "wl_region_block",
    "status": "on",
    "conditions":
    [
      {
        "key": "Http-Method",
        "subKey": "",
        "opValue": "match-one",
        "values": "GET,POST,DELETE"
      }
    ],
    "tags":
    [
      "region_block"
    ]
  }
]

Protection scenario 4: IP blacklist (ip_blacklist)

ParameterTypeRequiredExampleDescription
namestringYesipblacklistThe name of the protection rule. The name can contain letters, digits, and underscores (_), and can be up to 64 characters in length.
statusstringNoonThe switch for the protection rule. Valid values: on (enable) and off (disable). Default value: on.
remoteAddr[]StringYes["192.168.0.1","10.10.10.10/24","::1","abcd::abcd","BCDE::BCDE"]Filters by IP address. For more information, see DescribeDcdnWafFilterInfo.
actionstringYesdenyThe action of the rule. Valid values: deny (block) and monitor (monitor).

ipblacklist configuration example:

[
    {
    "name": "ipblacklist",
    "status": "on",
    "remoteAddr": ["192.168.0.1","10.10.10.10/24","::1","abcd::abcd","BCDE::BCDE"],
    "action": "deny"
  }
]

Protection scenario 5: Region blocking (region_block)

ParameterTypeRequiredExampleDescription
statusstringNoonThe switch for the protection rule. Valid values: on (enable) and off (disable). Default value: on.
cnRegionListstringNo110000,TW,MOThe blocked regions in the Chinese mainland, separated by commas (,). For more information about the supported regions, see DescribeDcdnWafGeoInfo.
otherRegionListstringNoJP,GBThe blocked regions outside the Chinese mainland, separated by commas (,). For more information about the supported regions, see DescribeDcdnWafGeoInfo.
actionstringYesdenyThe action of the rule. Valid values: deny (block) and monitor (monitor).
Note

You must specify at least one of cnRegionList and otherRegionList.

region_block configuration example:

[
    {
    "status": "on",
    "cnRegionList": "110000,TW,MO",
    "otherRegionList": "JP,GB",
    "action": "deny"
  }
]

Protection scenario 6: Bot management (bot)

Rule template

All rule parameters include the following four fields. For specific values, refer to the corresponding rule category.

ParameterTypeRequiredDescription
typeStringYesThe rule type. For more information, see the specific rule category.
statusStringYesThe rule status. Valid values: on (enabled) and off (disabled).
configTargetTypeNoThe rule configuration. For more information, see the specific rule category.
actionStringNoThe rule action. For more information, see the specific rule category.

Rule category 1: Protected object type

ParameterTypeRequiredExampleDescription
typeStringYestarget_typeThe rule type. Set the value to target_type.
statusStringYesonThe rule switch. Valid value: on (enabled).
configTargetTypeNo{"target":"app"}The rule configuration. Format:
target: the protected object type. Required. Valid values: web (web pages/browsers) and app (apps).

actionStringNoEmptyThe rule action. Not applicable here. Set it to an empty value.

Example of protected object type configuration:

[
  {
    "type":"target_type",
    "status":"on",
    "config":{"target":"app"},
    "action":""
  }
]

Rule category 2: Web SDK integration

ParameterTypeRequiredExampleDescription
typeStringYesweb_sdkThe rule type. Set the value to web_sdk.
statusStringYesonThe rule switch. Valid value: on (enabled).
configWebSdkNo{"mode":"automatic","crossDomain":"example.com"}The rule configuration. Format:
mode: the Web SDK integration method. Required. Valid values: automatic (automatic integration) and manual (manual integration).
crossDomain: the cross-domain domain name call. Optional. This parameter takes effect only when mode is set to automatic.




actionStringNoEmptyThe rule action. Not applicable here. Set it to an empty value.

Example of Web SDK integration configuration:

[
  {
    "type":"web_sdk",
    "status":"on",
    "config":{"mode":"automatic","crossDomain":"example.com"},
    "action":""
  }
]

Rule category 3: Traffic features

ParameterTypeRequiredExampleDescription
typeStringYestraffic_featureThe rule type. Set the value to traffic_feature.
statusStringYesonThe rule switch. Valid value: on (enabled).
configTrafficFeatureYes{"conditions":[{"key":"Header","subKey":"User-Agent","opValue":"contain","values":"Chrome"},{"key":"IP","subKey":"","opValue":"ip-contain","values":"192.168.0.1/24"}]}The rule configuration. For more information, see condition.
actionStringNoEmptyThe rule action. Not applicable here. Set it to an empty value.

condition (Match conditions)

ParameterTypeRequiredExampleDescription
keyStringYesHeaderThe match field. For specific values, see DescribeDcdnWafFilterInfo.
subKeyStringNoUser-AgentThe match subfield. For specific values, see DescribeDcdnWafFilterInfo.
opValueStringYescontainThe operator. For specific values, see DescribeDcdnWafFilterInfo.
valuesStringNoChromeThe match content. Separate multiple values with commas (,). For specific values, see DescribeDcdnWafFilterInfo.

Example of traffic feature configuration:

[
  {
    "type":"traffic_feature",
    "status":"on",
    "config":{"conditions":[{"key":"Header","subKey":"User-Agent","opValue":"contain","values":"Chrome"},{"key":"IP","subKey":"","opValue":"ip-contain","values":"192.168.0.1/24"}]},
    "action":""
  }
]

Rule category 4: Legitimate bot management

ParameterTypeRequiredExampleDescription
typeStringYesintelligence_crawlerThe rule type. Set the value to intelligence_crawler.
statusStringYesonThe rule switch. Valid value: on (enabled).
configIntelligenceCrawlerNo{"name":"intelligence_crawler_baidu"}The rule configuration. For valid values, see name (Search engine bot whitelist).
actionStringYesbypassThe rule action. Valid value: bypass (allow).

name (Search engine bot whitelist)

ValueDescription
intelligence_crawler_allLegitimate search engine whitelist (Google, Bing, Baidu, Sogou, 360, Yandex)
intelligence_crawler_baiduBaidu bot whitelist
intelligence_crawler_sogouSogou bot whitelist
intelligence_crawler_360360 bot whitelist
intelligence_crawler_googleGoogle bot whitelist
intelligence_crawler_bingBing bot whitelist
intelligence_crawler_yandexYandex bot whitelist

Example of legitimate bot management configuration:

[
  {
    "type":"intelligence_crawler",
    "status":"on",
    "config":{"name":"intelligence_crawler_baidu"},
    "action":"bypass"
  },
  {
    "type":"intelligence_crawler",
    "status":"on",
    "config":{"name":"intelligence_crawler_google"},
    "action":"bypass"
  }
]

Rule category 5: Simple script filtering (JavaScript challenge)

ParameterTypeRequiredExampleDescription
typeStringYesjsThe rule type. Set the value to js.
statusStringYesonThe rule switch. Valid values: on (enabled) and off (disabled).
configJsNoEmptyThe rule configuration. Not applicable here. Set it to an empty value.
actionStringYesjsThe rule action. Valid value: js (JavaScript verification).

Example of simple script filtering (JavaScript challenge) configuration:

[
  {
    "type":"js",
    "status":"on",
    "config":{},
    "action":"js"
  }
]

Rule category 6: Advanced bot protection (dynamic token challenge)

ParameterTypeRequiredExampleDescription
typeStringYessigchlThe rule type. Set the value to sigchl.
statusStringYesonThe rule switch. Valid values: on (enabled) and off (disabled).
configSigchlNo{"sigchl":["sig","replay","driver"]}The rule configuration. Format:
sigchl: the request data signature verification. Required. Valid values: sig (signature verification exception), replay (signature timestamp exception), and driver (WebDriver attack).

actionStringYessigchlThe rule action. Valid value: sigchl (block).

Example of advanced bot protection (dynamic token challenge) configuration:

[
  {
    "type":"sigchl",
    "status":"on",
    "config":{"sigchl":["sig","replay","driver"]},
    "action":"sigchl"
  }
]

Rule category 7: AI-based intelligent protection

ParameterTypeRequiredExampleDescription
typeStringYesalgorithmThe rule type. Set the value to algorithm.
statusStringYesonThe rule switch. Valid values: on (enabled) and off (disabled).
configAlgorithmNoEmptyThe rule configuration. Not applicable here. Set it to an empty value.
actionStringYescaptchaThe rule action. Valid values: monitor (monitor) and captcha (slider CAPTCHA).

Example of AI-based intelligent protection configuration:

[
  {
    "type":"algorithm",
    "status":"on",
    "config":{},
    "action":"captcha"
  }
]

Rule category 8: IP rate limiting

ParameterTypeRequiredExampleDescription
typeStringYescustom_cc_ipThe rule type. Set the value to custom_cc_ip.
statusStringYesonThe rule switch. Valid values: on (enabled) and off (disabled).
configCustomCcIpYes{"interval":20,"target":"IP","threshold":50,"ttl":2800}The rule configuration. For more information, see IP rate limiting config parameter description.
actionStringYesmonitorThe rule action. Valid values: deny (block), monitor (monitor), and captcha (slider CAPTCHA, applicable only to web).

IP rate limiting config parameter description

ParameterTypeRequiredExampleDescription
targetStringYesIPThe statistical field for frequency control. Valid value: IP.
subKeyStringNoEmptyThe subfield of the statistical field. Not applicable here. Set it to an empty value.
IntervalIntegerYes20The statistical period. Valid values: 5 to 1800. Unit: seconds.
thresholdIntegerYes50The statistical threshold. Valid values: 2 to 50000. Unit: times.
ttlIntegerYes2800The blacklist timeout period. Valid values: 60 to 86400. Unit: seconds.

Example of IP rate limiting configuration:

[
  {
    "type":"custom_cc_ip",
    "status":"on",
    "config":{"interval":20,"target":"IP","threshold":50,"ttl":2800},
    "action":"monitor"
  },
  {
    "type":"custom_cc_ip",
    "status":"on",
    "config":{"interval":10,"target":"IP","threshold":30,"ttl":1800},
    "action":"monitor"
  }
]

Rule category 9: Device rate limiting

ParameterTypeRequiredExampleDescription
typeStringYescustom_cc_devThe rule type. Set the value to custom_cc_dev.
statusStringYesonThe rule switch. Valid values: on (enabled) and off (disabled).
configCustomCcDevYes{"interval":20,"target":"Header","subKey":"aliwaf_wxbb_umid","threshold":50,"ttl":2800}The rule configuration. For more information, see Device rate limiting config parameter description.
actionStringYesmonitorThe rule action. Valid values: deny (block) and monitor (monitor).

Device rate limiting config parameter description

ParameterTypeRequiredExampleDescription
targetStringYesHeaderThe statistical field for frequency control. Valid value: Header.
subKeyStringNoaliwaf_wxbb_umidThe subfield of the statistical field. Valid value: aliwaf_wxbb_umid.
IntervalIntegerYes20The statistical period. Valid values: 5 to 1800. Unit: seconds.
thresholdIntegerYes50The statistical threshold. Valid values: 2 to 50000. Unit: times.
ttlIntegerYes2800The blacklist timeout period. Valid values: 60 to 86400. Unit: seconds.

Example of device rate limiting configuration:

[
  {
    "type":"custom_cc_dev",
    "status":"on",
    "config":{"interval":20,"target":"Header","subKey":"aliwaf_wxbb_umid","threshold":50,"ttl":2800},
    "action":"monitor"
  },
  {
    "type":"custom_cc_dev",
    "status":"on",
    "config":{"interval":20,"target":"Header","subKey":"aliwaf_wxbb_umid","threshold":50,"ttl":2800},
    "action":"deny"
  }
]

Rule category 10: Custom session rate limiting

ParameterTypeRequiredExampleDescription
typeStringYescustom_ccThe rule type. Set the value to custom_cc.
statusStringYesonThe rule switch. Valid values: on (enabled) and off (disabled).
configCustomCcIpYes{"interval":10,"target":"Query String Parameter","subKey":"arg","threshold":30,"ttl":1800}The rule configuration. For more information, see Custom session rate limiting config parameter description.
actionStringYesmonitorThe rule action. Valid values: deny (block), monitor (monitor), and captcha (slider CAPTCHA, applicable only to web).

Custom session rate limiting config parameter description

ParameterTypeRequiredExampleDescription
targetStringYesQuery String ParameterThe statistical field for frequency control. Valid values: Header (counts the frequency of requests containing the specified header), Query String Parameter (counts the frequency of requests containing the specified parameter), Cookie Name (counts the frequency of requests containing the specified cookie), and Session (counts the frequency of requests from the same session).
subKeyStringNoargThe subfield of the statistical field. Custom value.
IntervalIntegerYes10The statistical period. Valid values: 5 to 1800. Unit: seconds.
thresholdIntegerYes30The statistical threshold. Valid values: 2 to 50000. Unit: times.
ttlIntegerYes2800The blacklist timeout period. Valid values: 60 to 86400. Unit: seconds.

Example of custom session rate limiting configuration:

[
  {
    "type":"custom_cc",
    "status":"on",
    "config":{"interval":10,"target":"Query String Parameter","subKey":"arg","threshold":30,"ttl":1800},
    "action":"deny"
  },
  {
    "type":"custom_cc",
    "status":"on",
    "config":{"interval":10,"target":"Query String Parameter","subKey":"arg","threshold":30,"ttl":1800},
    "action":"captcha"
  }
]

Rule category 11: Bot threat intelligence library

ParameterTypeRequiredExampleDescription
typeStringYesintelligenceThe rule type. Set the value to intelligence.
statusStringYesonThe rule switch. Valid values: on (enabled) and off (disabled).
configIntelligenceNoEmptyThe rule configuration. Not applicable here. Set it to an empty value.
actionStringYescaptchaThe rule action. Valid values: monitor (monitor) and captcha (slider CAPTCHA).

Example of bot threat intelligence library configuration:

[
  {
    "type":"intelligence",
    "status":"on",
    "config":{},
    "action":"captcha"
  }
]

Rule category 12: IDC IP blacklist

ParameterTypeRequiredExampleDescription
typeStringYesintelligence_idcThe rule type. Set the value to intelligence_idc.
statusStringYesonThe rule switch. Valid values: on (enabled) and off (disabled).
configIntelligenceIdcYes{"name":"intelligence_idc_alibaba"}The rule configuration. For valid values, see name parameter description.
actionStringYescaptchaThe rule action. Valid values: deny (block), monitor (monitor), and captcha (slider CAPTCHA).

name parameter description

ValueDescription
intelligence_idc_alibabaIDC IP library - Alibaba Cloud
intelligence_idc_tencentIDC IP library - Tencent Cloud
intelligence_idc_mtyunIDC IP library - Meituan Cloud
intelligence_idc_vnetIDC IP library - 21Vianet
intelligence_idc_otherIDC IP library - Others

Example of IDC IP blacklist configuration:

[
  {
    "type":"intelligence_idc",
    "status":"on",
    "config":{"name":"intelligence_idc_alibaba"},
    "action":"captcha"
  },
  {
    "type":"intelligence_idc",
    "status":"on",
    "config":{"name":"intelligence_idc_tencent"},
    "action":"captcha"
  }
]

Rule category 13: Fake bot blocking

ParameterTypeRequiredExampleDescription
typeStringYesintelligence_fake_crawlerThe rule type. Set the value to intelligence_fake_crawler.
statusStringYesonThe rule switch. Valid values: on (enabled) and off (disabled).
configIntelligenceFakeCrawlerNoEmptyThe rule configuration. Not applicable here. Set it to an empty value.
actionStringYesdenyThe rule action. Valid value: deny (block).

Example of fake bot blocking configuration:

[
  {
    "type": "intelligence_fake_crawler",
    "status": "on",
    "config":{},
    "action": "deny"
  }
]

Rule category 14: Bot characteristic identification

ParameterTypeRequiredExampleDescription
typeStringYesapp_sdkThe rule type. Set the value to app_sdk.
statusStringYesonThe rule switch. Valid value: on (enabled).
configAppSdkYes{"featureAbnormal":["simulator","proxy","root","debugged","hook","virtual","antiReplay","signInvalid"],"customSignStatus":"on","customSign":{"key":"header","value":"ua"}}The rule configuration. For more information, see Bot characteristic identification config parameter description.
actionStringYesmonitorThe rule action. Valid values: deny (block) and monitor (monitor).

Bot characteristic identification config parameter description

ParameterTypeRequiredExampleDescription
featureAbnormal[]StringYessimulatorsignInvalid: app signature exception.
antiReplay: signature expired.
simulator: emulator used.
proxy: proxy used.
root: rooted device.
debugged: debugging mode.
hook: app hooked.
virtual: app multi-opening.



















customSignStatusStringNoonThe custom signature field switch. Valid values: on (enabled) and off (disabled).
customSignCustomSignNo{"key":"header","value":"ua"}The custom signature field. Format:
key: the field name. Required. Valid values: header, arg, and cookie.
value: the field value. Required.




Example of bot characteristic identification configuration:

[
  {
    "type": "app_sdk",
    "status": "on",
    "config": {"featureAbnormal":["simulator","proxy","root","debugged","hook","virtual","antiReplay","signInvalid"],"customSignStatus":"on","customSign":{"key":"header","value":"ua"}},
    "action": "monitor"
  }
]

Rule category 15: Advanced protection (repackaged app detection)

ParameterTypeRequiredExampleDescription
typeStringYesapp_packageThe rule type. Set the value to app_package.
statusStringYesonThe rule switch. Valid value: on (enabled).
configAppPackageNo{"packageSigns":[{"name":"aaaaa","sign":"bbbb"},{"name":"cccc","sign":"dddd"}]}The rule configuration. For more information, see packageSigns parameter description.
actionStringYesmonitorThe rule action. Valid values: deny (block) and monitor (monitor).

packageSigns parameter description

ParameterTypeRequiredExampleDescription
nameStringYesaaaaaThe valid package name.
signStringNobbbbThe package signature.

Example of advanced protection (repackaged app detection) configuration:

[
  {
    "type": "app_package",
    "status": "on",
    "config": {"packageSigns":[{"name":"aaaaa","sign":"bbbb"},{"name":"cccc","sign":"dddd"}]},
    "action": "deny"
  }
]

Example of combined parameter configuration for bot management web page/browser protection

[
    {
        "type": "target_type",
        "status": "on",
        "config":
        {
            "target": "web"
        },
        "action": ""
    },
    {
        "type": "web_sdk",
        "status": "on",
        "config":
        {
            "mode": "automatic",
            "crossDomain": "example.com"
        },
        "action": ""
    },
    {
        "type": "traffic_feature",
        "status": "on",
        "config":
        {
            "conditions":
            [
                {
                    "key": "Header",
                    "subKey": "User-Agent",
                    "opValue": "contain",
                    "values": "Chrome"
                },
                {
                    "key": "IP",
                    "subKey": "",
                    "opValue": "ip-contain",
                    "values": "192.168.0.1/24"
                }
            ]
        },
        "action": ""
    },
    {
        "type": "intelligence_crawler",
        "status": "on",
        "config":
        {
            "name": "intelligence_crawler_baidu"
        },
        "action": "bypass"
    },
    {
        "type": "intelligence_crawler",
        "status": "on",
        "config":
        {
            "name": "intelligence_crawler_google"
        },
        "action": "bypass"
    },
    {
        "type": "js",
        "status": "on",
        "config":
        {},
        "action": "js"
    },
    {
        "type": "sigchl",
        "status": "on",
        "config":
        {
            "sigchl":
            [
                "sig",
                "replay",
                "driver"
            ]
        },
        "action": "sigchl"
    },
    {
        "type": "algorithm",
        "status": "on",
        "config":
        {},
        "action": "captcha"
    },
    {
        "type": "custom_cc_ip",
        "status": "on",
        "config":
        {
            "interval": 20,
            "target": "IP",
            "threshold": 50,
            "ttl": 2800
        },
        "action": "monitor"
    },
    {
        "type": "custom_cc_ip",
        "status": "on",
        "config":
        {
            "interval": 10,
            "target": "IP",
            "threshold": 30,
            "ttl": 1800
        },
        "action": "monitor"
    },
    {
        "type": "custom_cc",
        "status": "on",
        "config":
        {
            "interval": 10,
            "target": "Query String Parameter",
            "subKey": "arg",
            "threshold": 30,
            "ttl": 1800
        },
        "action": "deny"
    },
    {
        "type": "custom_cc",
        "status": "on",
        "config":
        {
            "interval": 10,
            "target": "Query String Parameter",
            "subKey": "arg",
            "threshold": 30,
            "ttl": 1800
        },
        "action": "captcha"
    },
    {
        "type": "intelligence",
        "status": "on",
        "config":
        {},
        "action": "captcha"
    },
    {
        "type": "intelligence_idc",
        "status": "on",
        "config":
        {
            "name": "intelligence_idc_alibaba"
        },
        "action": "captcha"
    },
    {
        "type": "intelligence_idc",
        "status": "on",
        "config":
        {
            "name": "intelligence_idc_tencent"
        },
        "action": "captcha"
    },
    {
        "type": "intelligence_fake_crawler",
        "status": "on",
        "config":
        {},
        "action": "deny"
    }
]

Example of combined parameter configuration for bot management app protection

[
    {
        "type": "target_type",
        "status": "on",
        "config":
        {
            "target": "app"
        },
        "action": ""
    },
    {
        "type": "traffic_feature",
        "status": "on",
        "config":
        {
            "conditions":
            [
                {
                    "key": "Header",
                    "subKey": "User-Agent",
                    "opValue": "contain",
                    "values": "Chrome"
                },
                {
                    "key": "IP",
                    "subKey": "",
                    "opValue": "ip-contain",
                    "values": "192.168.0.1/24"
                }
            ]
        },
        "action": ""
    },
    {
        "type": "custom_cc_ip",
        "status": "on",
        "config":
        {
            "interval": 20,
            "target": "IP",
            "threshold": 50,
            "ttl": 2800
        },
        "action": "monitor"
    },
    {
        "type": "custom_cc_ip",
        "status": "on",
        "config":
        {
            "interval": 10,
            "target": "IP",
            "threshold": 30,
            "ttl": 1800
        },
        "action": "monitor"
    },
    {
        "type": "custom_cc_dev",
        "status": "on",
        "config":
        {
            "interval": 20,
            "target": "Header",
            "subKey": "aliwaf_wxbb_umid",
            "threshold": 50,
            "ttl": 2800
        },
        "action": "monitor"
    },
    {
        "type": "custom_cc_dev",
        "status": "on",
        "config":
        {
            "interval": 20,
            "target": "Header",
            "subKey": "aliwaf_wxbb_umid",
            "threshold": 50,
            "ttl": 2800
        },
        "action": "deny"
    },
    {
        "type": "custom_cc",
        "status": "on",
        "config":
        {
            "interval": 10,
            "target": "Query String Parameter",
            "subKey": "arg",
            "threshold": 30,
            "ttl": 1800
        },
        "action": "monitor"
    },
    {
        "type": "custom_cc",
        "status": "on",
        "config":
        {
            "interval": 10,
            "target": "Query String Parameter",
            "subKey": "arg",
            "threshold": 30,
            "ttl": 1800
        },
        "action": "deny"
    },
    {
        "type": "app_sdk",
        "status": "on",
        "config":
        {
            "featureAbnormal":
            [
                "simulator",
                "proxy",
                "root",
                "debugged",
                "hook",
                "virtual",
                "antiReplay",
                "signInvalid"
            ],
            "customSignStatus": "on",
            "customSign":
            {
                "key": "header",
                "value": "ua"
            }
        },
        "action": "monitor"
    },
    {
        "type": "app_package",
        "status": "on",
        "config":
        {
            "packageSigns":
            [
                {
                    "name": "aaaaa",
                    "sign": "bbbb"
                },
                {
                    "name": "cccc",
                    "sign": "dddd"
                }
            ]
        },
        "action": "deny"
    }
]

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

CB1A380B-09F0-41BB-280B-72F8FD6DA2FE

RuleIds

object

RuleId

array

The list of protection rule IDs.

string

The list of IDs of the created rules.

100001,200002

Examples

Success response

JSON format

{
  "RequestId": "CB1A380B-09F0-41BB-280B-72F8FD6DA2FE",
  "RuleIds": {
    "RuleId": [
      "100001,200002"
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter The specified parameter is invalid. A parameter is set to an invalid value.
400 Policy.NotExist The specified policy does not exist. The specified protection policy does not exist.
400 RuleConfigs.Malformed The specified RuleConfigs format is invalid. The RuleConfigs parameter is in an invalid format.
400 RuleName.AlreadyExists Rule name already exists in specified policy. The specified rule name is already used by another rule.
400 Rule.QuantityOverflow Rules are overflowed quantity in specified policy. The number of rules in the specified policy has already reached the upper limit.
500 InternalError An internal error occurred; please try again later. An internal error occurred. Try again later. If the error persists, submit a ticket.
403 %s.NotSupport The specified resource type %s is not supported. The specified resource type is not supported. To use this type of resource, contact us.
403 %s.OverQuota The quantity of %s exceeds the quota. The number of resources exceeds the quota. If you want to apply for more resources, contact us.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.