呼叫BatchCreateDcdnWafRules設定WAF防護規則。
介面說明
單使用者呼叫頻率:20 次/秒。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
dcdn:BatchCreateDcdnWafRules |
create |
*全部資源。
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| PolicyId |
integer |
是 |
防護策略 ID。 |
1000001 |
| RuleConfigs |
string |
是 |
防護規則設定。 |
[{"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 取值說明
RuleConfigs 為清單切片,其中每個結構體代表一條規則。
根據 PolicyId 對應的防護策略類型不同,RuleConfigs 的格式也不同。
防護場景 1:Web 正規防護(waf_group)
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| status | String | 否 | on | 防護規則開關,取值:on(開啟),off(關閉)。預設為 on。 |
| action | String | 是 | block | 規則動作,取值:block(攔截),monitor(觀察)。 |
| wafGroupIds | String | 否 | 1012 | WAF 規則群組 ID,預設為"1012",多個 ID 使用半形逗號(,)分隔。 |
waf_group 設定範例:
// Web 正規防護目前僅支援一條策略下設定一條規則。
[
{
"status": "on",
"action": "block"
}
]
防護場景 2:自訂規則(custom_acl)
| 名稱 | 類型 | 是否必選 | 範例值 | 描述 |
| name | string | 是 | acl_1 | 防護規則名稱,支援輸入英文字元(大小寫)、數字(0~9)及底線(_),最大輸入 64 個字元。 |
| status | string | 否 | on | 取值:on(開啟),off(關閉)。預設為 on。 |
| conditions | Condition | 是 | [ {"key": "URI", "subKey": "","opValue": "contain", "values": "/login.php" }] | 觸發規則條件,具體參數請參考表 1 Condition 參數說明。 |
| ccStatus | string | 是 | off | 頻率控制開關,on(開啟),off(關閉)。 |
| rateLimit | RateLimit | 否 | { "target": "Header", "subKey": "User-Agent", "interval": 5, "threshold": 2, "ttl": 1800} | 具體的頻率控制規則,當 ccStatus 為 on 時必填。具體參數請參考表 2 RateLimit 參數說明。 |
| effect | string | 否 | service | 頻率控制黑名單的生效範圍,當 ccStatus 為 on 時必填,取值:rule(目前規則生效),service(全域生效)。 |
| action | string | 是 | deny | 規則動作,取值:deny(攔截)、js(JS 驗證)、monitor(觀察)。 |
表 1 Condition 參數說明
| 名稱 | 類型 | 是否必選 | 範例值 | 描述 |
| Key | string | 是 | Query String Parameter | 匹配欄位,具體請參考 DescribeDcdnWafFilterInfo 。 |
| subKey | string | 否 | action | 匹配子欄位,具體請參考 DescribeDcdnWafFilterInfo 。 |
| opValue | String | 是 | eq | 邏輯符,具體請參考 DescribeDcdnWafFilterInfo 。 |
| values | String | 否 | js | 匹配內容,多值使用英文逗號(,)分隔,具體值參考 DescribeDcdnWafFilterInfo 。 |
表 2 RateLimit 參數說明
| 名稱 | 類型 | 是否必選 | 範例值 | 描述 |
| target | string | 是 | Header | 頻率控制的統計欄位,取值:IP:表示統計同一個 IP 發起請求的頻率。Header:表示統計包含指定 Header 的請求的頻率。Query String Parameter:表示統計包含指定參數的請求的頻率。Cookie Name:表示統計包含指定 Cookie 的請求的頻率。Session:表示統計來自同一個工作階段發起請求的頻率。 |
| subKey | string | 否 | User-Agent | 統一欄位的子欄位,當 target 為 Header、Query String Parameter 或 Cookie Name 時必填。 |
| Interval | Integer | 是 | 5 | 統計時長。取值範圍:5~1800。單位:秒。 |
| threshold | Integer | 是 | 2 | 統計閾值。取值範圍:2~500000。單位:次。 |
| ttl | Integer | 是 | 1800 | 黑名單逾時時間。取值範圍:60~86400。單位:秒。 |
| status | RateLimitStatus | 否 | {"code": "404", "ratio": 10} | 回應碼統計。具體參數請參考表 3 RateLimitStatus 參數說明。 |
表 3 RateLimitStatus 參數說明
| 名稱 | 類型 | 是否必選 | 範例值 | 描述 |
| codet | string | 是 | 404 | HTTP 狀態碼。 |
| ratio | Integer | 否 | 10 | 按比例(%)統計。取值:1~100,與 count 欄位二選一。 |
| count | Integer | 否 | 10 | 按數量統計。取值:2~50000,與 ratio 欄位二選一。 |
custom_acl 設定範例:
[
// 存取控制
{
"name": "acl_1",
"status": "off",
"conditions":
[
{
"key": "Query String Parameter",
"subKey": "action",
"opValue": "eq",
"values": "js"
}
],
"ccStatus": "off",
"action": "js"
},
// 頻率控制
{
"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"
}
]
防護場景 3:白名單(whitelist)
| 名稱 | 類型 | 是否必選 | 範例值 | 描述 |
| name | string | 是 | on | 防護規則名稱,支援輸入英文字元(大小寫)、數字(0~9)及底線(_),最大輸入 64 個字元。 |
| status | string | 否 | on | 防護規則開關,取值:on(預設):開啟。off:關閉。 |
| conditions | Condition | 是 | [{ "key": "Http-Method","subKey": "","opValue": "match-one", "values": "GET,POST,DELETE" }] | 觸發規則的條件。具體參數請參考表 1 Condition 參數說明。 |
| tags | String | 是 | [ "waf_group", "custom_acl"] | 防護策略類型清單。 |
| regularTypes | String | 否 | [ [ "sqli", "xss","code_exec", "crlf", "lfilei", "rfilei", "webshell","vvip", "other"] | 正規規則類型,當 tags 中出現 waf_group 時,此值可填,可選值:["sqli", "xss", "code_exec", "crlf", "lfilei", "rfilei", "webshell", "vvip", "other"]。 |
| regularRules | String | 否 | [ "100001", "100002", "100003"] | 正規規則,當 tags 中出現 waf_group 時,此值可填,且與 regularTypes 只能出現一個,值為字串格式的六位數字組成的清單。 |
whitelist 設定範例:
[
// 跳過全部場景
{
"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"
]
},
// 跳過 waf_group 的指定規則 id
{
"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"
]
},
{
// 跳過 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"
]
},
// 跳過自訂規則
{
"name": "wl_custom_acl",
"status": "on",
"conditions":
[
{
"key": "Http-Method",
"subKey": "",
"opValue": "match-one",
"values": "GET,POST,DELETE"
}
],
"tags":
[
"custom_acl"
]
},
// 跳過 IP 黑名單
{
"name": "wl_ip_blacklist",
"status": "on",
"conditions":
[
{
"key": "Http-Method",
"subKey": "",
"opValue": "match-one",
"values": "GET,POST,DELETE"
}
],
"tags":
[
"ip_blacklist"
]
},
// 跳過區域封鎖
{
"name": "wl_region_block",
"status": "on",
"conditions":
[
{
"key": "Http-Method",
"subKey": "",
"opValue": "match-one",
"values": "GET,POST,DELETE"
}
],
"tags":
[
"region_block"
]
}
]
防護場景 4:IP 黑名單(ip_blacklist)
| 名稱 | 類型 | 是否必選 | 範例值 | 描述 |
| name | string | 是 | ipblacklist | 防護規則名稱,支援輸入英文字元(大小寫)、數字(0~9)及底線(_),最大輸入 64 個字元。 |
| status | string | 否 | on | 防護規則開關,取值:取值:on(開啟),off(關閉)。預設為 on。 |
| remoteAddr | []String | 是 | ["192.168.0.1","10.10.10.10/24","::1","abcd::abcd","BCDE::BCDE"] | 按 IP 位址過濾,具體請參見 DescribeDcdnWafFilterInfo 。 |
| action | string | 是 | deny | 規則動作,取值:deny(攔截),monitor(觀察)。 |
ipblacklist 設定範例:
[
{
"name": "ipblacklist",
"status": "on",
"remoteAddr": ["192.168.0.1","10.10.10.10/24","::1","abcd::abcd","BCDE::BCDE"],
"action": "deny"
}
]
防護場景 5:區域封鎖(region_block)
| 名稱 | 類型 | 是否必選 | 範例值 | 描述 |
| status | string | 否 | on | 防護規則開關,取值:on(開啟),off(關閉)。預設為 on。 |
| cnRegionList | string | 否 | 110000,TW,MO | 中國境內封鎖區域,逗號分隔。支援封鎖的地區請參見 DescribeDcdnWafGeoInfo 。 |
| otherRegionList | string | 否 | JP,GB | 中國境外封鎖區域,逗號分隔。支援封鎖的地區請參見 DescribeDcdnWafGeoInfo 。 |
| action | string | 是 | deny | 規則動作,取值:deny(攔截),monitor(觀察)。 |
cnRegionList 和 otherRegionList 至少填寫其中一個。
region_block 設定範例:
[
{
"status": "on",
"cnRegionList": "110000,TW,MO",
"otherRegionList": "JP,GB",
"action": "deny"
}
]
防護場景 6:Bot 管理(bot)
規則範本
所有的規則參數都是以下四個,具體值參見具體規則分類。
| 參數 | 類型 | 必要 | 描述 |
| type | String | 是 | 規則類型,參見具體規則分類。 |
| status | String | 是 | 規則狀態,取值:on(開啟),off(關閉)。 |
| config | TargetType | 否 | 規則配置,參見具體規則分類。 |
| action | String | 否 | 規則動作,參見具體規則分類。 |
規則分類一:防護目標類型
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | target_type | 規則類型,取值:target_type。 |
| status | String | 是 | on | 規則開關,取值:on(開啟)。 |
| config | TargetType | 否 | {"target":"app"} | 規則配置。格式如下: target:防護目標類型,必填。取值範圍包含 web(網頁/瀏覽器)和 app(APP)。 |
| action | String | 否 | 置空 | 規則動作,此處不涉及,置為空值。 |
防護目標類型配置範例:
[
{
"type":"target_type",
"status":"on",
"config":{"target":"app"},
"action":""
}
]
規則分類二:Web SDK 整合
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | web_sdk | 規則類型,取值:web_sdk。 |
| status | String | 是 | on | 規則開關,取值:on(開啟)。 |
| config | WebSdk | 否 | {"mode":"automatic","crossDomain":"example.com"} | 規則配置。格式如下: mode :Web SDK 整合方式,必填。取值範圍包含 automatic(自動整合)和 manual(手動整合)。 crossDomain:跨網域的網域名稱呼叫,選填,僅當 mode 取值為 automatic 時生效。 |
| action | String | 否 | 置空 | 規則動作,此處不涉及,置為空值。 |
Web SDK 整合配置範例:
[
{
"type":"web_sdk",
"status":"on",
"config":{"mode":"automatic","crossDomain":"example.com"},
"action":""
}
]
規則分類三:防護目標特徵
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | traffic_feature | 規則類型,取值:traffic_feature。 |
| status | String | 是 | on | 規則開關,取值:on(開啟)。 |
| config | TrafficFeature | 是 | {"conditions":[{"key":"Header","subKey":"User-Agent","opValue":"contain","values":"Chrome"},{"key":"IP","subKey":"","opValue":"ip-contain","values":"192.168.0.1/24"}]} | 規則配置。具體請參見 condition。 |
| action | String | 否 | 置空 | 規則動作,此處不涉及,置為空值。 |
condition(比對條件)
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| key | String | 是 | Header | 比對欄位,具體值請參見 DescribeDcdnWafFilterInfo 。 |
| subKey | String | 否 | User-Agent | 比對子欄位,具體值請參見 DescribeDcdnWafFilterInfo 。 |
| opValue | String | 是 | contain | 運算子,具體值請參見 DescribeDcdnWafFilterInfo 。 |
| values | String | 否 | Chrome | 比對內容,多值使用英文逗號分隔,具體值請參見 DescribeDcdnWafFilterInfo 。 |
防護目標特徵配置範例:
[
{
"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":""
}
]
規則分類四:合法 Bot 管理
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | intelligence_crawler | 規則類型,取值:intelligence_crawler。 |
| status | String | 是 | on | 規則開關,取值:on(開啟)。 |
| config | IntelligenceCrawler | 否 | {"name":"intelligence_crawler_baidu"} | 規則配置。取值請參見name(搜尋引擎蜘蛛白名單)。 |
| action | String | 是 | bypass | 規則動作,取值:bypass(放行)。 |
name(搜尋引擎蜘蛛白名單)
| 參數值 | 含義 |
| intelligence_crawler_all | 合法搜尋引擎白名單(Google、Bing、百度、搜狗、360、Yandex) |
| intelligence_crawler_baidu | 百度蜘蛛白名單 |
| intelligence_crawler_sogou | 搜狗蜘蛛白名單 |
| intelligence_crawler_360 | 360 蜘蛛白名單 |
| intelligence_crawler_google | Google 蜘蛛白名單 |
| intelligence_crawler_bing | Bing 蜘蛛白名單 |
| intelligence_crawler_yandex | andex 蜘蛛白名單 |
合法 Bot 管理配置範例:
[
{
"type":"intelligence_crawler",
"status":"on",
"config":{"name":"intelligence_crawler_baidu"},
"action":"bypass"
},
{
"type":"intelligence_crawler",
"status":"on",
"config":{"name":"intelligence_crawler_google"},
"action":"bypass"
}
]
規則分類五:簡單指令碼過濾(JavaScript 挑戰)
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | js | 規則類型,取值:js。 |
| status | String | 是 | on | 規則開關,取值:on(開啟),off(關閉)。 |
| config | Js | 否 | 置空 | 規則配置,此處不涉及,置為空值。 |
| action | String | 是 | js | 規則動作,取值:js(JS 校驗)。 |
簡單指令碼過濾(JavaScript 挑戰)配置範例:
[
{
"type":"js",
"status":"on",
"config":{},
"action":"js"
}
]
規則分類六:進階 Bot 防禦(動態權杖挑戰)
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | sigchl | 規則類型,取值:sigchl。 |
| status | String | 是 | on | 規則開關,取值:on(開啟),off(關閉)。 |
| config | Sigchl | 否 | {"sigchl":["sig","replay","driver"]} | 規則配置,格式如下: sigchl :請求資料簽章驗證,必填。取值範圍包含 sig(簽章驗證異常),replay(簽章時間戳記異常),driver(WebDriver 攻擊)。 |
| action | String | 是 | sigchl | 規則動作,取值:sigchl(攔截)。 |
進階 Bot 防禦(動態權杖挑戰)配置範例:
[
{
"type":"sigchl",
"status":"on",
"config":{"sigchl":["sig","replay","driver"]},
"action":"sigchl"
}
]
規則分類七:AI 智慧防護
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | algorithm | 規則類型,取值:algorithm。 |
| status | String | 是 | on | 規則開關,取值:on(開啟),off(關閉)。 |
| config | Algorithm | 否 | 置空 | 規則配置,此處不涉及,置為空值。 |
| action | String | 是 | captcha | 規則動作,取值:monitor(觀察),captcha(滑桿校驗)。 |
AI 智慧防護配置範例:
[
{
"type":"algorithm",
"status":"on",
"config":{},
"action":"captcha"
}
]
規則分類八:IP 限速
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | custom_cc_ip | 規則類型,取值:custom_cc_ip。 |
| status | String | 是 | on | 規則開關,取值:on(開啟),off(關閉)。 |
| config | CustomCcIp | 是 | {"interval":20,"target":"IP","threshold":50,"ttl":2800} | 規則配置,具體請參見IP 限速 config 參數說明 。 |
| action | String | 是 | monitor | 規則動作,deny(攔截),monitor(觀察),captcha(滑桿,僅涉及 Web) 。 |
IP 限速 config 參數說明
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| target | String | 是 | IP | 頻率控制的統計欄位,取值:IP。 |
| subKey | String | 否 | 置空 | 統一欄位的子欄位,此處不涉及,置為空值。 |
| Interval | Integer | 是 | 20 | 統計時長,取值:5~1800,單位:秒。 |
| threshold | Integer | 是 | 50 | 統計閾值,取值:2~50000,單位:次。 |
| ttl | Integer | 是 | 2800 | 黑名單逾時時間,取值:60~86400,單位:秒。 |
IP 限速配置範例:
[
{
"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 | String | 是 | custom_cc_dev | 規則類型,取值:custom_cc_dev。 |
| status | String | 是 | on | 規則開關,取值:on(開啟),off(關閉)。 |
| config | CustomCcDev | 是 | {"interval":20,"target":"Header","subKey":"aliwaf_wxbb_umid","threshold":50,"ttl":2800} | 配置規則,具體請參見裝置限速 config 參數說明 。 |
| action | String | 是 | monitor | 規則動作,deny(攔截),monitor(觀察)。 |
裝置限速 config 參數說明
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| target | String | 是 | Header | 頻率控制的統計欄位,取值:Header。 |
| subKey | String | 否 | aliwaf_wxbb_umid | 統一欄位的子欄位,取值:aliwaf_wxbb_umid。 |
| Interval | Integer | 是 | 20 | 統計時長,取值:5~1800,單位:秒。 |
| threshold | Integer | 是 | 50 | 統計閾值,取值:2~50000,單位:次。 |
| ttl | Integer | 是 | 2800 | 黑名單逾時時間,取值:60~86400,單位:秒。 |
裝置限速配置範例:
[
{
"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 | String | 是 | custom_cc | 規則類型,取值:custom_cc。 |
| status | String | 是 | on | 規則開關,取值:on(開啟),off(關閉)。 |
| config | CustomCcIp | 是 | {"interval":10,"target":"Query String Parameter","subKey":"arg","threshold":30,"ttl":1800} | 規則配置,具體請參見自訂工作階段限速 config 參數說明 。 |
| action | String | 是 | monitor | 規則動作,deny(攔截),monitor(觀察),captcha(滑桿,僅涉及 Web) 。 |
自訂工作階段限速 config 參數說明
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| target | String | 是 | Query String Parameter | 頻率控制的統計欄位,取值:Header(表示統計包含指定 Header 的請求的頻率),Query String Parameter(表示統計包含指定參數的請求的頻率),Cookie Name(表示統計包含指定 Cookie 的請求的頻率)和 Session(表示統計來自同一個工作階段發起請求的頻率)。 |
| subKey | String | 否 | arg | 統一欄位的子欄位,使用者自訂。 |
| Interval | Integer | 是 | 10 | 統計時長,取值:5~1800,單位:秒。 |
| threshold | Integer | 是 | 30 | 統計閾值,取值:2~50000,單位:次。 |
| ttl | Integer | 是 | 2800 | 黑名單逾時時間,取值:60~86400,單位:秒。 |
自訂工作階段限速配置範例:
[
{
"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 | String | 是 | intelligence | 規則類型,取值:intelligence。 |
| status | String | 是 | on | 規則開關,取值:on(開啟),off(關閉)。 |
| config | Intelligence | 否 | 置空 | 規則配置,此處不涉及,置為空值。 |
| action | String | 是 | captcha | 規則動作,取值:monitor(觀察),captcha(滑桿校驗)。 |
爬蟲威脅情報庫配置範例:
[
{
"type":"intelligence",
"status":"on",
"config":{},
"action":"captcha"
}
]
規則分類十二:IDC 黑名單封鎖
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | intelligence_idc | 規則類型,取值:intelligence_idc。 |
| status | String | 是 | on | 規則開關,取值:on(開啟),off(關閉)。 |
| config | IntelligenceIdc | 是 | {"name":"intelligence_idc_alibaba"} | 規則配置,取值請參見name 參數說明。 |
| action | String | 是 | captcha | 規則動作,取值:deny(攔截),monitor(觀察),captcha(滑桿校驗)。 |
name 參數說明
| 參數值 | 含義 |
| intelligence_idc_alibaba | IDC IP 庫-阿里雲 |
| intelligence_idc_tencent | IDC IP 庫-騰訊雲 |
| intelligence_idc_mtyun | IDC IP 庫-美團雲 |
| intelligence_idc_vnet | IDC IP 庫-世紀互聯 |
| intelligence_idc_other | IDC IP 庫-其他 |
IDC 黑名單封鎖配置範例:
[
{
"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 | String | 是 | intelligence_fake_crawler | 規則類型,取值:intelligence_fake_crawler。 |
| status | String | 是 | on | 規則開關,取值:on(開啟),off(關閉)。 |
| config | IntelligenceFakeCrawler | 否 | 置空 | 規則配置,此處不涉及,置為空值。 |
| action | String | 是 | deny | 規則動作,取值:deny(攔截)。 |
偽造蜘蛛攔截配置範例:
[
{
"type": "intelligence_fake_crawler",
"status": "on",
"config":{},
"action": "deny"
}
]
規則分類十四:Bot 特徵識別
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| type | String | 是 | app_sdk | 規則類型,取值:app_sdk。 |
| status | String | 是 | on | 規則開關,取值:on(開啟)。 |
| config | AppSdk | 是 | {"featureAbnormal":["simulator","proxy","root","debugged","hook","virtual","antiReplay","signInvalid"],"customSignStatus":"on","customSign":{"key":"header","value":"ua"}} | 規則配置,具體請參見Bot 特徵識別 config 參數說明 。 |
| action | String | 是 | monitor | 規則動作,取值:deny(攔截),monitor(觀察)。 |
Bot 特徵識別 config 參數說明
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| featureAbnormal | []String | 是 | simulator | signInvalid:APP 簽章異常。 antiReplay:簽章過期。 simulator:使用模擬器 proxy:使用代理 root:Root 裝置 debugged:偵錯模式。 hook:APP 被 hook。 virtual :APP 多開。 |
| customSignStatus | String | 否 | on | 自訂加簽欄位開關,取值:on(開啟),off(關閉)。 |
| customSign | CustomSign | 否 | {"key":"header","value":"ua"} | 自訂加簽欄位,格式如下: key :欄位名稱,必填。取值為 header、arg、cookie。 value:欄位值,必填。 |
Bot 特徵識別配置範例:
[
{
"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 | String | 是 | app_package | 規則類型,取值:app_package。 |
| status | String | 是 | on | 規則開關,取值:on(開啟)。 |
| config | AppPackage | 否 | {"packageSigns":[{"name":"aaaaa","sign":"bbbb"},{"name":"cccc","sign":"dddd"}]} | 規則配置,具體請參見packageSigns 參數說明。 |
| action | String | 是 | monitor | 規則動作,取值:deny(攔截),monitor(觀察)。 |
packageSigns 參數說明
| 參數 | 類型 | 必要 | 範例值 | 描述 |
| name | String | 是 | aaaaa | 指定合法套件名稱。 |
| sign | String | 否 | bbbb | 套件簽章。 |
進階防護(二次打包偵測)配置範例:
[
{
"type": "app_package",
"status": "on",
"config": {"packageSigns":[{"name":"aaaaa","sign":"bbbb"},{"name":"cccc","sign":"dddd"}]},
"action": "deny"
}
]
Bot 管理網頁/瀏覽器防護組合參數配置範例
[
{
"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"
}
]
Bot 管理 APP 防護組合參數配置範例
[
{
"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"
}
]
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
CB1A380B-09F0-41BB-280B-72F8FD6DA2FE |
| RuleIds |
object |
||
| RuleId |
array |
防護規則 ID 清單。 |
|
|
string |
建立的規則 ID 清單。 |
100001,200002 |
樣本
正常返回樣本
JSON格式
{
"RequestId": "CB1A380B-09F0-41BB-280B-72F8FD6DA2FE",
"RuleIds": {
"RuleId": [
"100001,200002"
]
}
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | 參數錯誤。 |
| 400 | Policy.NotExist | The specified policy does not exist. | 指定的防護策略不存在。 |
| 400 | RuleConfigs.Malformed | The specified RuleConfigs format is invalid. | 指定的參數 RuleConfigs 格式錯誤。 |
| 400 | RuleName.AlreadyExists | Rule name already exists in specified policy. | 規則名稱在指定的策略中已存在。 |
| 400 | Rule.QuantityOverflow | Rules are overflowed quantity in specified policy. | 規則在指定的策略中超出配額。 |
| 500 | InternalError | An internal error occurred; please try again later. | 內部錯誤,請重試,如果多次重試仍報錯,請提交工單。 |
| 403 | %s.NotSupport | The specified resource type %s is not supported. | 不支援指定的資源類型。如需使用該類型資源,請與我們聯絡。 |
| 403 | %s.OverQuota | The quantity of %s exceeds the quota. | 該資源的數量超出了配額所規定的範圍,如需申請更多的額度,請與我們聯絡。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。