用於建立執行個體層級的Web Application Firewall規則集,支援多種類型的防護規則。
介面說明
請求說明
本 API 允許使用者為指定執行個體建立新的 WAF(Web Application Firewall)規則集。
InstanceId是必需參數,指定了要為其建立規則集的具體執行個體。Phase參數定義了規則集的應用階段,例如自訂規則、頻次控制等。Name和Expression是必填項,分別代表規則集的名字和具體的匹配運算式。選擇性參數
Description提供了對規則集功能或用途的文字描述。Status控制著規則集是否立即生效 (on) 或者處於關閉狀態 (off)。通過
Rules參數可以進一步配置更詳細的規則列表,每個規則都包含名稱、位置、運算式及動作等屬性。成功響應將返回新建立規則集的唯一識別碼
Id以及所有關聯規則的 ID 列表RuleIds。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
esa:CreateUserWafRuleset |
none |
*全部資源
|
無 | 無 |
請求文法
POST / HTTP/1.1
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| InstanceId |
string |
是 |
執行個體 ID。 |
esa-site-ads11w |
| Phase |
string |
是 |
WAF 規則運行階段。
|
http_custom |
| Name |
string |
是 |
WAF 規則集名稱。 |
example |
| Description |
string |
否 |
WAF 規則集描述。 |
this is a test ruleset. |
| Status |
string |
是 |
WAF 規則集狀態。 |
on |
| Expression |
string |
是 |
WAF 規則集運算式。 |
ip.src == 1.1.1.1 |
| Shared | WafBatchRuleShared |
否 |
WAF 批量規則共用配置。 |
|
| Rules |
array |
否 |
WAF 規則集下的規則配置列表。 |
|
| WafRuleConfig |
否 |
WAF 規則集下的規則配置。 |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
Schema of Response |
||
| RequestId |
string |
請求 ID。 |
15C66C7B-671A-4297-9187-2C4477247A74 |
| Id |
integer |
WAF 規則集的 ID。 |
665d3af3621bccf3fe29e1a4 |
| RuleIds |
array |
WAF 規則集下的規則 ID 列表。 |
|
|
integer |
WAF 規則集下的規則 ID。 |
87570 |
樣本
正常返回樣本
JSON格式
{
"RequestId": "15C66C7B-671A-4297-9187-2C4477247A74",
"Id": 0,
"RuleIds": [
87570
]
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | 輸入參數規範校正失敗。 |
| 400 | InstanceNotExist | The instance does not exist. Check whether the specified instance ID is correct or whether the instance belongs to your account. | 執行個體不存在,請檢查提供的執行個體ID是否正確或該執行個體是否屬於您的賬戶。 |
| 400 | InternalException | Failed to call the service. Try again later or contact technical support. | 調用服務失敗,請稍後重試或聯絡客服諮詢詳情。 |
| 403 | Rule.Config.Noncompliance | The specified rule configuration does not meet the compliance requirements.Check and adjust your configurations. | 指定的規則配置未滿足既定的合規性標準。請檢查規則設定,尋找任何不符合或違反預期標準的差異,並進行必要的調整,以確保所有規則均得到正確驗證。 |
| 403 | Rule.Config.Malformed | The format of the rule configuration is invalid.Check the configuration for syntax errors or structural inconsistencies and correct them to meet the requirements. | 指定的規則配置格式錯誤或未按要求格式編寫。請檢查規則配置中是否存在語法錯誤或結構不一致,並予以糾正,以符合預期的配置架構。 |
| 403 | %s.NotSupport | The specified resource type %s is not supported. | 不支援指定的資源類型。如需使用該類型資源,請與我們聯絡。 |
| 403 | %s.OverQuota | The quantity of %s exceeds the quota. | 該資源的數量超出了配額所規定的範圍,如需申請更多的額度,請與我們聯絡。 |
| 403 | %s.WrongValueMatched | The value of specified parameter %s can not pass the matching check. | 指定的參數對應的值不能通過匹配校正。如果您確定需要使用該參數值,請與我們聯絡。 |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。