Policies - Create Or Update
在资源组中使用指定的规则集名称创建或更新策略。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}?api-version=2025-10-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
policy
|
path | True |
string maxLength: 128 |
Web 应用程序防火墙策略的名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
获取在更新资源时更改的唯一只读字符串。 |
| location |
string |
资源位置。 |
| properties.customRules |
描述策略中的自定义规则。 |
|
| properties.managedRules |
描述策略中的托管规则。 |
|
| properties.policySettings |
描述策略的设置。 |
|
| sku |
Web 应用程序防火墙策略的定价层。 如果未指定,则默认为 Classic_AzureFrontDoor。 |
|
| tags |
object |
资源标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
资源“WebApplicationFirewallPolicy”更新作成功 |
|
| 201 Created |
资源“WebApplicationFirewallPolicy”创建作成功 标头
|
|
| 202 Accepted |
已接受请求进行处理,但尚未完成处理。 标头
|
|
| Other Status Codes |
意外错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流程。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 模拟用户帐户 |
示例
Creates specific policy
示例请求
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/Policy1?api-version=2025-10-01
{
"location": "WestUs",
"properties": {
"customRules": {
"rules": [
{
"name": "Rule1",
"action": "Block",
"matchConditions": [
{
"matchValue": [
"192.168.1.0/24",
"10.0.0.0/24"
],
"matchVariable": "RemoteAddr",
"operator": "IPMatch"
}
],
"priority": 1,
"rateLimitThreshold": 1000,
"ruleType": "RateLimitRule"
},
{
"name": "Rule2",
"action": "Block",
"matchConditions": [
{
"matchValue": [
"CH"
],
"matchVariable": "RemoteAddr",
"operator": "GeoMatch"
},
{
"matchValue": [
"windows"
],
"matchVariable": "RequestHeader",
"operator": "Contains",
"selector": "UserAgent",
"transforms": [
"Lowercase"
]
}
],
"priority": 2,
"ruleType": "MatchRule"
},
{
"name": "Rule3",
"action": "CAPTCHA",
"matchConditions": [
{
"matchValue": [
"AzureBackup",
"AzureBotService"
],
"matchVariable": "RemoteAddr",
"operator": "ServiceTagMatch"
}
],
"priority": 1,
"rateLimitThreshold": 1000,
"ruleType": "RateLimitRule"
}
]
},
"managedRules": {
"managedRuleSets": [
{
"exclusions": [
{
"matchVariable": "RequestHeaderNames",
"selector": "User-Agent",
"selectorMatchOperator": "Equals"
}
],
"ruleGroupOverrides": [
{
"exclusions": [
{
"matchVariable": "RequestCookieNames",
"selector": "token",
"selectorMatchOperator": "StartsWith"
}
],
"ruleGroupName": "SQLI",
"rules": [
{
"action": "Redirect",
"enabledState": "Enabled",
"exclusions": [
{
"matchVariable": "QueryStringArgNames",
"selector": "query",
"selectorMatchOperator": "Equals"
}
],
"ruleId": "942100"
},
{
"enabledState": "Disabled",
"ruleId": "942110"
}
]
}
],
"ruleSetAction": "Block",
"ruleSetType": "DefaultRuleSet",
"ruleSetVersion": "1.0"
},
{
"ruleGroupOverrides": [
{
"ruleGroupName": "ExcessiveRequests",
"rules": [
{
"action": "Block",
"enabledState": "Enabled",
"ruleId": "500100",
"sensitivity": "High"
}
]
}
],
"ruleSetType": "Microsoft_HTTPDDoSRuleSet",
"ruleSetVersion": "1.0"
}
]
},
"policySettings": {
"captchaExpirationInMinutes": 30,
"customBlockResponseBody": "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==",
"customBlockResponseStatusCode": 429,
"enabledState": "Enabled",
"javascriptChallengeExpirationInMinutes": 30,
"logScrubbing": {
"scrubbingRules": [
{
"matchVariable": "RequestIPAddress",
"selector": null,
"selectorMatchOperator": "EqualsAny",
"state": "Enabled"
}
],
"state": "Enabled"
},
"mode": "Prevention",
"redirectUrl": "http://www.bing.com",
"requestBodyCheck": "Disabled"
}
},
"sku": {
"name": "Premium_AzureFrontDoor"
}
}
示例响应
{
"name": "Policy1",
"type": "Microsoft.Network/frontdoorwebapplicationfirewallpolicies",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/Policy1",
"location": "WestUs",
"properties": {
"customRules": {
"rules": [
{
"name": "Rule1",
"action": "Block",
"enabledState": "Enabled",
"matchConditions": [
{
"matchValue": [
"192.168.1.0/24",
"10.0.0.0/24"
],
"matchVariable": "RemoteAddr",
"negateCondition": false,
"operator": "IPMatch",
"selector": null,
"transforms": []
}
],
"priority": 1,
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 1000,
"ruleType": "RateLimitRule"
},
{
"name": "Rule2",
"action": "Block",
"enabledState": "Enabled",
"matchConditions": [
{
"matchValue": [
"CH"
],
"matchVariable": "RemoteAddr",
"negateCondition": false,
"operator": "GeoMatch",
"selector": null
},
{
"matchValue": [
"windows"
],
"matchVariable": "RequestHeader",
"negateCondition": false,
"operator": "Contains",
"selector": "UserAgent",
"transforms": [
"Lowercase"
]
}
],
"priority": 2,
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 0,
"ruleType": "MatchRule"
},
{
"name": "rule3",
"action": "CAPTCHA",
"enabledState": null,
"matchConditions": [
{
"matchValue": [
"AzureBackup",
"AzureBotService"
],
"matchVariable": "RemoteAddr",
"negateCondition": false,
"operator": "ServiceTagMatch",
"selector": null,
"transforms": []
}
],
"priority": 1,
"rateLimitDurationInMinutes": null,
"rateLimitThreshold": 1000,
"ruleType": "RateLimitRule"
}
]
},
"frontendEndpointLinks": [],
"managedRules": {
"managedRuleSets": [
{
"exclusions": [
{
"matchVariable": "RequestHeaderNames",
"selector": "User-Agent",
"selectorMatchOperator": "Equals"
}
],
"ruleGroupOverrides": [
{
"exclusions": [
{
"matchVariable": "RequestCookieNames",
"selector": "token",
"selectorMatchOperator": "StartsWith"
}
],
"ruleGroupName": "SQLI",
"rules": [
{
"action": "Redirect",
"enabledState": "Enabled",
"exclusions": [
{
"matchVariable": "QueryStringArgNames",
"selector": "query",
"selectorMatchOperator": "Equals"
}
],
"ruleId": "942100"
},
{
"enabledState": "Disabled",
"ruleId": "942110"
}
]
}
],
"ruleSetAction": "Block",
"ruleSetType": "DefaultRuleSet",
"ruleSetVersion": "1.0"
},
{
"ruleGroupOverrides": [
{
"ruleGroupName": "ExcessiveRequests",
"rules": [
{
"action": "Block",
"enabledState": "Enabled",
"ruleId": "500100",
"sensitivity": "High"
}
]
}
],
"ruleSetType": "Microsoft_HTTPDDoSRuleSet",
"ruleSetVersion": "1.0"
}
]
},
"policySettings": {
"customBlockResponseBody": "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==",
"customBlockResponseStatusCode": 429,
"enabledState": "Enabled",
"javascriptChallengeExpirationInMinutes": 30,
"logScrubbing": {
"scrubbingRules": [
{
"matchVariable": "RequestIPAddress",
"selector": null,
"selectorMatchOperator": "EqualsAny",
"state": "Enabled"
}
],
"state": "Enabled"
},
"mode": "Prevention",
"redirectUrl": "http://www.bing.com",
"requestBodyCheck": "Disabled"
},
"provisioningState": "Succeeded",
"resourceState": "Enabled",
"securityPolicyLinks": []
},
"sku": {
"name": "Premium_AzureFrontDoor"
},
"tags": {
"key1": "value1",
"key2": "value2"
}
}
{
"name": "Policy1",
"type": "Microsoft.Network/frontdoorwebapplicationfirewallpolicies",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/Policy1",
"location": "WestUs",
"properties": {
"customRules": {
"rules": [
{
"name": "Rule1",
"action": "Block",
"enabledState": "Enabled",
"matchConditions": [
{
"matchValue": [
"192.168.1.0/24",
"10.0.0.0/24"
],
"matchVariable": "RemoteAddr",
"negateCondition": false,
"operator": "IPMatch",
"selector": null,
"transforms": []
}
],
"priority": 1,
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 1000,
"ruleType": "RateLimitRule"
},
{
"name": "Rule2",
"action": "Block",
"enabledState": "Enabled",
"matchConditions": [
{
"matchValue": [
"CH"
],
"matchVariable": "RemoteAddr",
"negateCondition": false,
"operator": "GeoMatch",
"selector": null
},
{
"matchValue": [
"windows"
],
"matchVariable": "RequestHeader",
"negateCondition": false,
"operator": "Contains",
"selector": "UserAgent",
"transforms": [
"Lowercase"
]
}
],
"priority": 2,
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 0,
"ruleType": "MatchRule"
}
]
},
"frontendEndpointLinks": [],
"managedRules": {
"managedRuleSets": [
{
"exclusions": [
{
"matchVariable": "RequestHeaderNames",
"selector": "User-Agent",
"selectorMatchOperator": "Equals"
}
],
"ruleGroupOverrides": [
{
"exclusions": [
{
"matchVariable": "RequestCookieNames",
"selector": "token",
"selectorMatchOperator": "StartsWith"
}
],
"ruleGroupName": "SQLI",
"rules": [
{
"action": "Redirect",
"enabledState": "Enabled",
"exclusions": [
{
"matchVariable": "QueryStringArgNames",
"selector": "query",
"selectorMatchOperator": "Equals"
}
],
"ruleId": "942100"
},
{
"enabledState": "Disabled",
"ruleId": "942110"
}
]
}
],
"ruleSetType": "DefaultRuleSet",
"ruleSetVersion": "1.0"
}
]
},
"policySettings": {
"customBlockResponseBody": "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==",
"customBlockResponseStatusCode": 429,
"enabledState": "Enabled",
"logScrubbing": {
"scrubbingRules": [
{
"matchVariable": "RequestIPAddress",
"selector": null,
"selectorMatchOperator": "EqualsAny",
"state": "Enabled"
}
],
"state": "Enabled"
},
"mode": "Prevention",
"redirectUrl": "http://www.bing.com",
"requestBodyCheck": "Disabled"
},
"provisioningState": "Succeeded",
"resourceState": "Enabled",
"securityPolicyLinks": []
},
"sku": {
"name": "Classic_AzureFrontDoor"
},
"tags": {
"key1": "value1",
"key2": "value2"
}
}
{
"name": "Policy1",
"type": "Microsoft.Network/frontdoorwebapplicationfirewallpolicies",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/Policy1",
"location": "WestUs",
"properties": {
"customRules": {
"rules": [
{
"name": "Rule1",
"action": "Block",
"enabledState": "Enabled",
"matchConditions": [
{
"matchValue": [
"192.168.1.0/24",
"10.0.0.0/24"
],
"matchVariable": "RemoteAddr",
"negateCondition": false,
"operator": "IPMatch",
"selector": null,
"transforms": []
}
],
"priority": 1,
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 1000,
"ruleType": "RateLimitRule"
},
{
"name": "Rule2",
"action": "Block",
"enabledState": "Enabled",
"matchConditions": [
{
"matchValue": [
"CH"
],
"matchVariable": "RemoteAddr",
"negateCondition": false,
"operator": "GeoMatch",
"selector": null
},
{
"matchValue": [
"windows"
],
"matchVariable": "RequestHeader",
"negateCondition": false,
"operator": "Contains",
"selector": "UserAgent",
"transforms": [
"Lowercase"
]
}
],
"priority": 2,
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 0,
"ruleType": "MatchRule"
}
]
},
"frontendEndpointLinks": [],
"managedRules": {
"managedRuleSets": [
{
"exclusions": [
{
"matchVariable": "RequestHeaderNames",
"selector": "User-Agent",
"selectorMatchOperator": "Equals"
}
],
"ruleGroupOverrides": [
{
"exclusions": [
{
"matchVariable": "RequestCookieNames",
"selector": "token",
"selectorMatchOperator": "StartsWith"
}
],
"ruleGroupName": "SQLI",
"rules": [
{
"action": "Redirect",
"enabledState": "Enabled",
"exclusions": [
{
"matchVariable": "QueryStringArgNames",
"selector": "query",
"selectorMatchOperator": "Equals"
}
],
"ruleId": "942100"
},
{
"enabledState": "Disabled",
"ruleId": "942110"
}
]
}
],
"ruleSetAction": "Block",
"ruleSetType": "DefaultRuleSet",
"ruleSetVersion": "1.0"
},
{
"ruleGroupOverrides": [
{
"ruleGroupName": "ExcessiveRequests",
"rules": [
{
"action": "Block",
"enabledState": "Enabled",
"ruleId": "500100",
"sensitivity": "High"
}
]
}
],
"ruleSetType": "Microsoft_HTTPDDoSRuleSet",
"ruleSetVersion": "1.0"
}
]
},
"policySettings": {
"customBlockResponseBody": "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==",
"customBlockResponseStatusCode": 429,
"enabledState": "Enabled",
"logScrubbing": {
"scrubbingRules": [
{
"matchVariable": "RequestIPAddress",
"selector": null,
"selectorMatchOperator": "EqualsAny",
"state": "Enabled"
}
],
"state": "Enabled"
},
"mode": "Prevention",
"redirectUrl": "http://www.bing.com",
"requestBodyCheck": "Disabled"
},
"provisioningState": "Succeeded",
"resourceState": "Enabled",
"securityPolicyLinks": []
},
"sku": {
"name": "Premium_AzureFrontDoor"
},
"tags": {
"key1": "value1",
"key2": "value2"
}
}
定义
| 名称 | 说明 |
|---|---|
|
Action |
定义对规则匹配执行的作。 |
|
Custom |
定义 Web 应用程序规则的内容 |
|
Custom |
描述自定义规则是否处于启用或禁用状态。 如果未指定,则默认为 Enabled。 |
|
Custom |
定义自定义规则的内容 |
|
Error |
错误响应指示 Front Door 服务无法处理传入请求。 错误消息中提供了原因。 |
|
Frontend |
定义前端端点的资源 ID。 |
|
Group |
描述可用于对速率限制请求进行分组的变量 |
|
Managed |
描述托管规则是否处于启用或禁用状态。 |
|
Managed |
从托管规则评估中排除变量。 |
|
Managed |
要排除的变量类型。 |
|
Managed |
在指定此排除项适用于集合中的哪些元素时应用于选择器的比较运算符。 |
|
Managed |
定义托管规则组覆盖设置。 |
|
Managed |
定义托管规则组覆盖设置。 |
|
Managed |
定义托管规则集。 |
|
Managed |
定义满足托管规则集分数阈值时要执行的操作。 |
|
Managed |
定义策略的托管规则集列表。 |
|
Match |
定义匹配条件。 |
|
Match |
请求变量进行比较。 |
| Operator |
用于与变量值匹配的比较类型。 |
|
Policy |
描述策略是处于启用状态还是禁用状态。 如果未指定,则默认为 Enabled。 |
|
Policy |
描述它在策略级别是否处于检测模式或预防模式。 |
|
Policy |
描述策略托管规则是否将检查请求正文内容。 |
|
Policy |
策略的资源状态。 |
|
Policy |
定义顶级 WebApplicationFirewallPolicy 配置设置。 |
|
Routing |
定义路由规则的资源 ID。 |
|
Rule |
描述规则的类型。 |
|
scrubbing |
如果 matchVariable 是集合,请对选择器进行操作,以指定此规则应用于的集合中的哪些元素。 |
|
Scrubbing |
要从日志中清理的变量。 |
|
scrubbing |
定义日志清理规则的状态。 默认值处于启用状态。 |
|
Security |
定义安全策略的资源 ID。 |
|
Sensitivity |
定义规则的敏感度。 |
| Sku |
Web 应用程序防火墙策略的定价层。 |
|
Sku |
定价层的名称。 |
|
Transform |
描述在匹配之前应用的转换。 |
|
Variable |
介绍组依据的受支持变量 |
|
Web |
定义 Web 应用程序防火墙策略。 |
|
Web |
定义日志清理规则的内容。 |
|
Web |
日志清理配置的状态。默认值为“已启用”。 |
ActionType
定义对规则匹配执行的作。
| 值 | 说明 |
|---|---|
| Allow |
Allow |
| Block |
块 |
| Log |
Log |
| Redirect |
重定向 |
| AnomalyScoring |
异常评分 |
| JSChallenge |
JSChallenge |
| CAPTCHA |
验证码 |
CustomRule
定义 Web 应用程序规则的内容
| 名称 | 类型 | 说明 |
|---|---|---|
| action |
描述规则匹配时要应用的作。 |
|
| enabledState |
描述自定义规则是否处于启用或禁用状态。 如果未指定,则默认为 Enabled。 |
|
| groupBy |
描述用于对速率限制请求进行分组的变量列表 |
|
| matchConditions |
匹配条件列表。 |
|
| name |
string maxLength: 128 |
描述规则的名称。 |
| priority |
integer (int32) |
描述规则的优先级。 在具有较高值的规则之前,将评估具有较低值的规则。 |
| rateLimitDurationInMinutes |
integer (int32) minimum: 0maximum: 5 |
重置速率限制计数的时间窗口。 默认值为 1 分钟。 |
| rateLimitThreshold |
integer (int32) minimum: 0 |
时间范围内每个客户端允许的请求数。 |
| ruleType |
描述规则的类型。 |
CustomRuleEnabledState
描述自定义规则是否处于启用或禁用状态。 如果未指定,则默认为 Enabled。
| 值 | 说明 |
|---|---|
| Disabled |
Disabled |
| Enabled |
已启用 |
CustomRuleList
定义自定义规则的内容
| 名称 | 类型 | 说明 |
|---|---|---|
| rules |
规则列表 |
ErrorResponse
错误响应指示 Front Door 服务无法处理传入请求。 错误消息中提供了原因。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| message |
string |
指示操作失败的原因的错误消息。 |
FrontendEndpointLink
定义前端端点的资源 ID。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
GroupByVariable
描述可用于对速率限制请求进行分组的变量
| 名称 | 类型 | 说明 |
|---|---|---|
| variableName |
介绍组依据的受支持变量 |
ManagedRuleEnabledState
描述托管规则是否处于启用或禁用状态。
| 值 | 说明 |
|---|---|
| Disabled |
Disabled |
| Enabled |
已启用 |
ManagedRuleExclusion
从托管规则评估中排除变量。
| 名称 | 类型 | 说明 |
|---|---|---|
| matchVariable |
要排除的变量类型。 |
|
| selector |
string |
此排除项适用于集合中哪些元素的选择器值。 |
| selectorMatchOperator |
在指定此排除项适用于集合中的哪些元素时应用于选择器的比较运算符。 |
ManagedRuleExclusionMatchVariable
要排除的变量类型。
| 值 | 说明 |
|---|---|
| RequestHeaderNames |
请求首部名称 |
| RequestCookieNames |
请求CookieNames |
| QueryStringArgNames |
QueryStringArgNames |
| RequestBodyPostArgNames |
请求身体帖子ArgNames。 |
| RequestBodyJsonArgNames |
RequestBodyJsonArgNames |
ManagedRuleExclusionSelectorMatchOperator
在指定此排除项适用于集合中的哪些元素时应用于选择器的比较运算符。
| 值 | 说明 |
|---|---|
| Equals |
等于 |
| Contains |
包含 |
| StartsWith |
以...开始 |
| EndsWith |
以...结尾 |
| EqualsAny |
等于任一 |
ManagedRuleGroupOverride
定义托管规则组覆盖设置。
| 名称 | 类型 | 说明 |
|---|---|---|
| exclusions |
描述应用于组中所有规则的排除项。 |
|
| ruleGroupName |
string |
描述要重写的托管规则组。 |
| rules |
将禁用的规则列表。 如果未指定任何规则,将禁用组中的所有规则。 |
ManagedRuleOverride
定义托管规则组覆盖设置。
| 名称 | 类型 | 说明 |
|---|---|---|
| action |
描述规则匹配时要应用的替代操作。 |
|
| enabledState |
描述托管规则是否处于启用或禁用状态。 如果未指定,则默认为 Disabled。 |
|
| exclusions |
描述应用于此特定规则的排除项。 |
|
| ruleId |
string |
托管规则的标识符。 |
| sensitivity |
描述规则匹配时要应用的替代敏感度。 |
ManagedRuleSet
定义托管规则集。
| 名称 | 类型 | 说明 |
|---|---|---|
| exclusions |
描述应用于集中所有规则的排除项。 |
|
| ruleGroupOverrides |
定义要应用于规则集的规则组替代。 |
|
| ruleSetAction |
规则设置作 |
|
| ruleSetType |
string |
定义要使用的规则集类型。 |
| ruleSetVersion |
string |
定义要使用的规则集的版本。 |
ManagedRuleSetActionType
定义满足托管规则集分数阈值时要执行的操作。
| 值 | 说明 |
|---|---|
| Block |
块 |
| Log |
Log |
| Redirect |
重定向 |
ManagedRuleSetList
定义策略的托管规则集列表。
| 名称 | 类型 | 说明 |
|---|---|---|
| managedRuleSets |
规则集列表。 |
MatchCondition
定义匹配条件。
| 名称 | 类型 | 说明 |
|---|---|---|
| matchValue |
string[] |
可能的匹配值列表。 |
| matchVariable |
请求变量进行比较。 |
|
| negateCondition |
boolean |
描述是否应否定此条件的结果。 |
| operator |
用于与变量值匹配的比较类型。 |
|
| selector |
string |
与 QueryString、PostArgs、RequestHeader 或 Cookies 变量中的特定键进行匹配。 默认值为 null。 |
| transforms |
转换列表。 |
MatchVariable
请求变量进行比较。
| 值 | 说明 |
|---|---|
| RemoteAddr |
远程添加器 |
| RequestMethod |
RequestMethod |
| QueryString |
QueryString |
| PostArgs |
PostArgs |
| RequestUri |
RequestUri |
| RequestHeader |
RequestHeader |
| RequestBody |
RequestBody |
| Cookies |
Cookies |
| SocketAddr |
SocketAddr |
Operator
用于与变量值匹配的比较类型。
| 值 | 说明 |
|---|---|
| Any |
任意 |
| IPMatch |
IPMatch |
| GeoMatch |
地理匹配 |
| Equal |
Equal |
| Contains |
包含 |
| LessThan |
LessThan |
| GreaterThan |
GreaterThan |
| LessThanOrEqual |
小于或等于 |
| GreaterThanOrEqual |
GreaterThanOrEqual |
| BeginsWith |
BeginsWith |
| EndsWith |
以...结尾 |
| RegEx |
RegEx |
| ServiceTagMatch |
服务标签匹配 |
PolicyEnabledState
描述策略是处于启用状态还是禁用状态。 如果未指定,则默认为 Enabled。
| 值 | 说明 |
|---|---|
| Disabled |
Disabled |
| Enabled |
已启用 |
PolicyMode
描述它在策略级别是否处于检测模式或预防模式。
| 值 | 说明 |
|---|---|
| Prevention |
预防 |
| Detection |
检测 |
PolicyRequestBodyCheck
描述策略托管规则是否将检查请求正文内容。
| 值 | 说明 |
|---|---|
| Disabled |
Disabled |
| Enabled |
已启用 |
PolicyResourceState
策略的资源状态。
| 值 | 说明 |
|---|---|
| Creating |
创建 |
| Enabling |
启用 |
| Enabled |
已启用 |
| Disabling |
禁用 |
| Disabled |
Disabled |
| Deleting |
正在删除 |
PolicySettings
定义顶级 WebApplicationFirewallPolicy 配置设置。
| 名称 | 类型 | 说明 |
|---|---|---|
| captchaExpirationInMinutes |
integer (int32) minimum: 5maximum: 1440 |
定义验证码 cookie 有效期(以分钟为单位)。 此设置仅适用于Premium_AzureFrontDoor。 值必须是介于 5 和 1440 之间的整数,默认值为 30。 |
| customBlockResponseBody |
string pattern: ^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$ |
如果操作类型为块,客户可以替代响应正文。 必须在 base64 编码中指定正文。 |
| customBlockResponseStatusCode |
integer (int32) |
如果操作类型为块,客户可以替代响应状态代码。 |
| enabledState |
描述策略是处于启用状态还是禁用状态。 如果未指定,则默认为 Enabled。 |
|
| javascriptChallengeExpirationInMinutes |
integer (int32) minimum: 5maximum: 1440 |
定义 JavaScript 质询 Cookie 有效期(以分钟为单位)。 此设置仅适用于Premium_AzureFrontDoor。 值必须是介于 5 和 1440 之间的整数,默认值为 30。 |
| logScrubbing.scrubbingRules |
应用于 Web 应用程序防火墙日志的日志清理规则列表。 |
|
| logScrubbing.state |
日志清理配置的状态。默认值为“已启用”。 |
|
| mode |
描述它在策略级别是否处于检测模式或预防模式。 |
|
| redirectUrl |
string |
如果作类型为重定向,则此字段表示客户端的重定向 URL。 |
| requestBodyCheck |
描述策略托管规则是否将检查请求正文内容。 |
RoutingRuleLink
定义路由规则的资源 ID。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
RuleType
描述规则的类型。
| 值 | 说明 |
|---|---|
| MatchRule |
比赛规则 |
| RateLimitRule |
RateLimitRule |
scrubbingRuleEntryMatchOperator
如果 matchVariable 是集合,请对选择器进行操作,以指定此规则应用于的集合中的哪些元素。
| 值 | 说明 |
|---|---|
| EqualsAny |
等于任一 |
| Equals |
等于 |
ScrubbingRuleEntryMatchVariable
要从日志中清理的变量。
| 值 | 说明 |
|---|---|
| RequestIPAddress |
RequestIPAddress |
| RequestUri |
RequestUri |
| QueryStringArgNames |
QueryStringArgNames |
| RequestHeaderNames |
请求首部名称 |
| RequestCookieNames |
请求CookieNames |
| RequestBodyPostArgNames |
请求身体帖子ArgNames。 |
| RequestBodyJsonArgNames |
RequestBodyJsonArgNames |
scrubbingRuleEntryState
定义日志清理规则的状态。 默认值处于启用状态。
| 值 | 说明 |
|---|---|
| Enabled |
已启用 |
| Disabled |
Disabled |
SecurityPolicyLink
定义安全策略的资源 ID。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
SensitivityType
定义规则的敏感度。
| 值 | 说明 |
|---|---|
| Low |
低灵敏度 - 通过更大的流量峰值触发规则 |
| Medium |
中等灵敏度 - 通过流量的中度峰值触发规则 |
| High |
高灵敏度 - 通过较小的流量峰值触发规则 |
Sku
Web 应用程序防火墙策略的定价层。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
定价层的名称。 |
SkuName
定价层的名称。
| 值 | 说明 |
|---|---|
| Classic_AzureFrontDoor |
Classic_AzureFrontDoor |
| Standard_AzureFrontDoor |
Standard_AzureFrontDoor |
| Premium_AzureFrontDoor |
Premium_AzureFrontDoor |
TransformType
描述在匹配之前应用的转换。
| 值 | 说明 |
|---|---|
| Lowercase |
小写 |
| Uppercase |
大写 |
| Trim |
修剪 |
| UrlDecode |
UrlDecode |
| UrlEncode |
URL编码 |
| RemoveNulls |
RemoveNulls |
VariableName
介绍组依据的受支持变量
| 值 | 说明 |
|---|---|
| SocketAddr |
SocketAddr |
| GeoLocation |
GeoLocation |
| None |
None |
WebApplicationFirewallPolicy
定义 Web 应用程序防火墙策略。
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
获取在更新资源时更改的唯一只读字符串。 |
| id |
string |
资源 ID。 |
| location |
string |
资源位置。 |
| name |
string |
资源名称。 |
| properties.customRules |
描述策略中的自定义规则。 |
|
| properties.frontendEndpointLinks |
描述与此 Web 应用程序防火墙策略关联的前端端点。 |
|
| properties.managedRules |
描述策略中的托管规则。 |
|
| properties.policySettings |
描述策略的设置。 |
|
| properties.provisioningState |
string |
策略的预配状态。 |
| properties.resourceState |
策略的资源状态。 |
|
| properties.routingRuleLinks |
描述与此 Web 应用程序防火墙策略关联的路由规则。 |
|
| properties.securityPolicyLinks |
描述与此 Web 应用程序防火墙策略关联的安全策略。 |
|
| sku |
Web 应用程序防火墙策略的定价层。 如果未指定,则默认为 Classic_AzureFrontDoor。 |
|
| tags |
object |
资源标记。 |
| type |
string |
资源类型。 |
WebApplicationFirewallScrubbingRules
定义日志清理规则的内容。
| 名称 | 类型 | 说明 |
|---|---|---|
| matchVariable |
要从日志中清理的变量。 |
|
| selector |
string |
matchVariable 是集合时,运算符用于指定此规则应用于的集合中的哪些元素。 |
| selectorMatchOperator |
如果 matchVariable 是集合,请对选择器进行操作,以指定此规则应用于的集合中的哪些元素。 |
|
| state |
定义日志清理规则的状态。 默认值处于启用状态。 |
WebApplicationFirewallScrubbingState
日志清理配置的状态。默认值为“已启用”。
| 值 | 说明 |
|---|---|
| Enabled |
已启用 |
| Disabled |
Disabled |