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: 80 pattern: ^[a-zA-Z0-9_\-\(\)\.]*[^\.]$ |
Azure 订阅中的资源组的名称。 |
|
subscription
|
path | True |
string |
唯一标识 Microsoft Azure 订阅的订阅凭据。 订阅 ID 构成了每个服务调用的 URI 的一部分。 |
|
api-version
|
query | True |
string |
客户端 API 版本。 |
请求正文
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
获取在更新资源时更改的唯一只读字符串。 |
| location |
string |
资源位置。 |
| properties.customRules |
描述策略中的自定义规则。 |
|
| properties.managedRules |
描述策略中的托管规则。 |
|
| properties.policySettings |
描述策略的设置。 |
|
| sku |
Web 应用程序防火墙策略的定价层。 如果未指定,则默认为 Classic_AzureFrontDoor。 |
|
| tags |
object |
资源标记。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
OK. 请求已成功。 |
|
| 201 Created |
创建。 请求已满足,并创建了新的保护策略。 |
|
| 202 Accepted |
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": {
"policySettings": {
"enabledState": "Enabled",
"mode": "Prevention",
"redirectUrl": "http://www.bing.com",
"customBlockResponseStatusCode": 429,
"customBlockResponseBody": "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==",
"requestBodyCheck": "Disabled",
"javascriptChallengeExpirationInMinutes": 30,
"captchaExpirationInMinutes": 30,
"logScrubbing": {
"state": "Enabled",
"scrubbingRules": [
{
"matchVariable": "RequestIPAddress",
"selectorMatchOperator": "EqualsAny",
"selector": null,
"state": "Enabled"
}
]
}
},
"customRules": {
"rules": [
{
"name": "Rule1",
"priority": 1,
"ruleType": "RateLimitRule",
"rateLimitThreshold": 1000,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"operator": "IPMatch",
"matchValue": [
"192.168.1.0/24",
"10.0.0.0/24"
]
}
],
"action": "Block"
},
{
"name": "Rule2",
"priority": 2,
"ruleType": "MatchRule",
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"operator": "GeoMatch",
"matchValue": [
"CH"
]
},
{
"matchVariable": "RequestHeader",
"operator": "Contains",
"selector": "UserAgent",
"matchValue": [
"windows"
],
"transforms": [
"Lowercase"
]
}
],
"action": "Block"
},
{
"name": "Rule3",
"priority": 1,
"ruleType": "RateLimitRule",
"rateLimitThreshold": 1000,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"operator": "ServiceTagMatch",
"matchValue": [
"AzureBackup",
"AzureBotService"
]
}
],
"action": "CAPTCHA"
}
]
},
"managedRules": {
"managedRuleSets": [
{
"ruleSetType": "DefaultRuleSet",
"ruleSetVersion": "1.0",
"ruleSetAction": "Block",
"exclusions": [
{
"matchVariable": "RequestHeaderNames",
"selectorMatchOperator": "Equals",
"selector": "User-Agent"
}
],
"ruleGroupOverrides": [
{
"ruleGroupName": "SQLI",
"exclusions": [
{
"matchVariable": "RequestCookieNames",
"selectorMatchOperator": "StartsWith",
"selector": "token"
}
],
"rules": [
{
"ruleId": "942100",
"enabledState": "Enabled",
"action": "Redirect",
"exclusions": [
{
"matchVariable": "QueryStringArgNames",
"selectorMatchOperator": "Equals",
"selector": "query"
}
]
},
{
"ruleId": "942110",
"enabledState": "Disabled"
}
]
}
]
},
{
"ruleSetType": "Microsoft_HTTPDDoSRuleSet",
"ruleSetVersion": "1.0",
"ruleGroupOverrides": [
{
"ruleGroupName": "ExcessiveRequests",
"rules": [
{
"ruleId": "500100",
"enabledState": "Enabled",
"action": "Block",
"sensitivity": "High"
}
]
}
]
}
]
}
},
"sku": {
"name": "Premium_AzureFrontDoor"
}
}
示例响应
{
"name": "Policy1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/Policy1",
"type": "Microsoft.Network/frontdoorwebapplicationfirewallpolicies",
"tags": {
"key1": "value1",
"key2": "value2"
},
"location": "WestUs",
"properties": {
"resourceState": "Enabled",
"provisioningState": "Succeeded",
"policySettings": {
"enabledState": "Enabled",
"mode": "Prevention",
"redirectUrl": "http://www.bing.com",
"customBlockResponseStatusCode": 429,
"customBlockResponseBody": "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==",
"requestBodyCheck": "Disabled",
"javascriptChallengeExpirationInMinutes": 30,
"logScrubbing": {
"state": "Enabled",
"scrubbingRules": [
{
"matchVariable": "RequestIPAddress",
"selectorMatchOperator": "EqualsAny",
"selector": null,
"state": "Enabled"
}
]
}
},
"customRules": {
"rules": [
{
"name": "Rule1",
"priority": 1,
"enabledState": "Enabled",
"ruleType": "RateLimitRule",
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 1000,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"selector": null,
"operator": "IPMatch",
"negateCondition": false,
"matchValue": [
"192.168.1.0/24",
"10.0.0.0/24"
],
"transforms": []
}
],
"action": "Block"
},
{
"name": "Rule2",
"priority": 2,
"enabledState": "Enabled",
"ruleType": "MatchRule",
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 0,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"selector": null,
"operator": "GeoMatch",
"negateCondition": false,
"matchValue": [
"CH"
]
},
{
"matchVariable": "RequestHeader",
"selector": "UserAgent",
"operator": "Contains",
"negateCondition": false,
"matchValue": [
"windows"
],
"transforms": [
"Lowercase"
]
}
],
"action": "Block"
},
{
"name": "rule3",
"enabledState": null,
"priority": 1,
"ruleType": "RateLimitRule",
"rateLimitDurationInMinutes": null,
"rateLimitThreshold": 1000,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"selector": null,
"operator": "ServiceTagMatch",
"negateCondition": false,
"matchValue": [
"AzureBackup",
"AzureBotService"
],
"transforms": []
}
],
"action": "CAPTCHA"
}
]
},
"managedRules": {
"managedRuleSets": [
{
"ruleSetType": "DefaultRuleSet",
"ruleSetVersion": "1.0",
"ruleSetAction": "Block",
"exclusions": [
{
"matchVariable": "RequestHeaderNames",
"selectorMatchOperator": "Equals",
"selector": "User-Agent"
}
],
"ruleGroupOverrides": [
{
"ruleGroupName": "SQLI",
"exclusions": [
{
"matchVariable": "RequestCookieNames",
"selectorMatchOperator": "StartsWith",
"selector": "token"
}
],
"rules": [
{
"ruleId": "942100",
"enabledState": "Enabled",
"action": "Redirect",
"exclusions": [
{
"matchVariable": "QueryStringArgNames",
"selectorMatchOperator": "Equals",
"selector": "query"
}
]
},
{
"ruleId": "942110",
"enabledState": "Disabled"
}
]
}
]
},
{
"ruleSetType": "Microsoft_HTTPDDoSRuleSet",
"ruleSetVersion": "1.0",
"ruleGroupOverrides": [
{
"ruleGroupName": "ExcessiveRequests",
"rules": [
{
"ruleId": "500100",
"enabledState": "Enabled",
"action": "Block",
"sensitivity": "High"
}
]
}
]
}
]
},
"frontendEndpointLinks": [],
"securityPolicyLinks": []
},
"sku": {
"name": "Premium_AzureFrontDoor"
}
}
{
"name": "Policy1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/Policy1",
"type": "Microsoft.Network/frontdoorwebapplicationfirewallpolicies",
"tags": {
"key1": "value1",
"key2": "value2"
},
"location": "WestUs",
"properties": {
"resourceState": "Enabled",
"provisioningState": "Succeeded",
"policySettings": {
"enabledState": "Enabled",
"mode": "Prevention",
"redirectUrl": "http://www.bing.com",
"customBlockResponseStatusCode": 429,
"customBlockResponseBody": "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==",
"requestBodyCheck": "Disabled",
"logScrubbing": {
"state": "Enabled",
"scrubbingRules": [
{
"matchVariable": "RequestIPAddress",
"selectorMatchOperator": "EqualsAny",
"selector": null,
"state": "Enabled"
}
]
}
},
"customRules": {
"rules": [
{
"name": "Rule1",
"priority": 1,
"enabledState": "Enabled",
"ruleType": "RateLimitRule",
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 1000,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"selector": null,
"operator": "IPMatch",
"negateCondition": false,
"matchValue": [
"192.168.1.0/24",
"10.0.0.0/24"
],
"transforms": []
}
],
"action": "Block"
},
{
"name": "Rule2",
"priority": 2,
"enabledState": "Enabled",
"ruleType": "MatchRule",
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 0,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"selector": null,
"operator": "GeoMatch",
"negateCondition": false,
"matchValue": [
"CH"
]
},
{
"matchVariable": "RequestHeader",
"selector": "UserAgent",
"operator": "Contains",
"negateCondition": false,
"matchValue": [
"windows"
],
"transforms": [
"Lowercase"
]
}
],
"action": "Block"
}
]
},
"managedRules": {
"managedRuleSets": [
{
"ruleSetType": "DefaultRuleSet",
"ruleSetVersion": "1.0",
"exclusions": [
{
"matchVariable": "RequestHeaderNames",
"selectorMatchOperator": "Equals",
"selector": "User-Agent"
}
],
"ruleGroupOverrides": [
{
"ruleGroupName": "SQLI",
"exclusions": [
{
"matchVariable": "RequestCookieNames",
"selectorMatchOperator": "StartsWith",
"selector": "token"
}
],
"rules": [
{
"ruleId": "942100",
"enabledState": "Enabled",
"action": "Redirect",
"exclusions": [
{
"matchVariable": "QueryStringArgNames",
"selectorMatchOperator": "Equals",
"selector": "query"
}
]
},
{
"ruleId": "942110",
"enabledState": "Disabled"
}
]
}
]
}
]
},
"frontendEndpointLinks": [],
"securityPolicyLinks": []
},
"sku": {
"name": "Classic_AzureFrontDoor"
}
}
{
"name": "Policy1",
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/Policy1",
"type": "Microsoft.Network/frontdoorwebapplicationfirewallpolicies",
"tags": {
"key1": "value1",
"key2": "value2"
},
"location": "WestUs",
"properties": {
"resourceState": "Enabled",
"provisioningState": "Succeeded",
"policySettings": {
"enabledState": "Enabled",
"mode": "Prevention",
"redirectUrl": "http://www.bing.com",
"customBlockResponseStatusCode": 429,
"customBlockResponseBody": "PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg==",
"requestBodyCheck": "Disabled",
"logScrubbing": {
"state": "Enabled",
"scrubbingRules": [
{
"matchVariable": "RequestIPAddress",
"selectorMatchOperator": "EqualsAny",
"selector": null,
"state": "Enabled"
}
]
}
},
"customRules": {
"rules": [
{
"name": "Rule1",
"priority": 1,
"enabledState": "Enabled",
"ruleType": "RateLimitRule",
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 1000,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"selector": null,
"operator": "IPMatch",
"negateCondition": false,
"matchValue": [
"192.168.1.0/24",
"10.0.0.0/24"
],
"transforms": []
}
],
"action": "Block"
},
{
"name": "Rule2",
"priority": 2,
"enabledState": "Enabled",
"ruleType": "MatchRule",
"rateLimitDurationInMinutes": 0,
"rateLimitThreshold": 0,
"matchConditions": [
{
"matchVariable": "RemoteAddr",
"selector": null,
"operator": "GeoMatch",
"negateCondition": false,
"matchValue": [
"CH"
]
},
{
"matchVariable": "RequestHeader",
"selector": "UserAgent",
"operator": "Contains",
"negateCondition": false,
"matchValue": [
"windows"
],
"transforms": [
"Lowercase"
]
}
],
"action": "Block"
}
]
},
"managedRules": {
"managedRuleSets": [
{
"ruleSetType": "DefaultRuleSet",
"ruleSetVersion": "1.0",
"ruleSetAction": "Block",
"exclusions": [
{
"matchVariable": "RequestHeaderNames",
"selectorMatchOperator": "Equals",
"selector": "User-Agent"
}
],
"ruleGroupOverrides": [
{
"ruleGroupName": "SQLI",
"exclusions": [
{
"matchVariable": "RequestCookieNames",
"selectorMatchOperator": "StartsWith",
"selector": "token"
}
],
"rules": [
{
"ruleId": "942100",
"enabledState": "Enabled",
"action": "Redirect",
"exclusions": [
{
"matchVariable": "QueryStringArgNames",
"selectorMatchOperator": "Equals",
"selector": "query"
}
]
},
{
"ruleId": "942110",
"enabledState": "Disabled"
}
]
}
]
},
{
"ruleSetType": "Microsoft_HTTPDDoSRuleSet",
"ruleSetVersion": "1.0",
"ruleGroupOverrides": [
{
"ruleGroupName": "ExcessiveRequests",
"rules": [
{
"ruleId": "500100",
"enabledState": "Enabled",
"action": "Block",
"sensitivity": "High"
}
]
}
]
}
]
},
"frontendEndpointLinks": [],
"securityPolicyLinks": []
},
"sku": {
"name": "Premium_AzureFrontDoor"
}
}
定义
| 名称 | 说明 |
|---|---|
|
scrubbing |
如果 matchVariable 是集合,请对选择器进行操作,以指定此规则应用于的集合中的哪些元素。 |
|
scrubbing |
定义日志清理规则的状态。 默认值处于启用状态。 |
|
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 |
要从日志中清理的变量。 |
|
Security |
定义安全策略的资源 ID。 |
|
Sensitivity |
定义规则的敏感度。 |
| Sku |
Web 应用程序防火墙策略的定价层。 |
|
Sku |
定价层的名称。 |
|
Transform |
描述在匹配之前应用的转换。 |
|
Variable |
介绍组依据的受支持变量 |
|
Web |
定义 Web 应用程序防火墙策略。 |
|
Web |
定义日志清理规则的内容。 |
|
Web |
日志清理配置的状态。默认值为“已启用”。 |
scrubbingRuleEntryMatchOperator
如果 matchVariable 是集合,请对选择器进行操作,以指定此规则应用于的集合中的哪些元素。
| 值 | 说明 |
|---|---|
| EqualsAny | |
| Equals |
scrubbingRuleEntryState
定义日志清理规则的状态。 默认值处于启用状态。
| 值 | 说明 |
|---|---|
| Enabled | |
| Disabled |
ActionType
定义对规则匹配执行的作。
| 值 | 说明 |
|---|---|
| Allow | |
| Block | |
| Log | |
| Redirect | |
| AnomalyScoring | |
| JSChallenge | |
| CAPTCHA |
CustomRule
定义 Web 应用程序规则的内容
| 名称 | 类型 | 说明 |
|---|---|---|
| action |
描述规则匹配时要应用的作。 |
|
| enabledState |
描述自定义规则是否处于启用或禁用状态。 如果未指定,则默认为 Enabled。 |
|
| groupBy |
描述用于对速率限制请求进行分组的变量列表 |
|
| matchConditions |
匹配条件列表。 |
|
| name |
string maxLength: 128 |
描述规则的名称。 |
| priority |
integer |
描述规则的优先级。 在具有较高值的规则之前,将评估具有较低值的规则。 |
| rateLimitDurationInMinutes |
integer minimum: 0maximum: 5 |
重置速率限制计数的时间窗口。 默认值为 1 分钟。 |
| rateLimitThreshold |
integer minimum: 0 |
时间范围内每个客户端允许的请求数。 |
| ruleType |
描述规则的类型。 |
CustomRuleEnabledState
描述自定义规则是否处于启用或禁用状态。 如果未指定,则默认为 Enabled。
| 值 | 说明 |
|---|---|
| Disabled | |
| Enabled |
CustomRuleList
定义自定义规则的内容
| 名称 | 类型 | 说明 |
|---|---|---|
| rules |
规则列表 |
ErrorResponse
错误响应指示 Front Door 服务无法处理传入请求。 错误消息中提供了原因。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| message |
string |
指示操作失败的原因的错误消息。 |
FrontendEndpointLink
定义前端端点的资源 ID。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
GroupByVariable
描述可用于对速率限制请求进行分组的变量
| 名称 | 类型 | 说明 |
|---|---|---|
| variableName |
介绍组依据的受支持变量 |
ManagedRuleEnabledState
描述托管规则是否处于启用或禁用状态。
| 值 | 说明 |
|---|---|
| Disabled | |
| Enabled |
ManagedRuleExclusion
从托管规则评估中排除变量。
| 名称 | 类型 | 说明 |
|---|---|---|
| matchVariable |
要排除的变量类型。 |
|
| selector |
string |
此排除项适用于集合中哪些元素的选择器值。 |
| selectorMatchOperator |
在指定此排除项适用于集合中的哪些元素时应用于选择器的比较运算符。 |
ManagedRuleExclusionMatchVariable
要排除的变量类型。
| 值 | 说明 |
|---|---|
| RequestHeaderNames | |
| RequestCookieNames | |
| QueryStringArgNames | |
| RequestBodyPostArgNames | |
| 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 | |
| Redirect |
ManagedRuleSetList
定义策略的托管规则集列表。
| 名称 | 类型 | 说明 |
|---|---|---|
| managedRuleSets |
规则集列表。 |
MatchCondition
定义匹配条件。
| 名称 | 类型 | 说明 |
|---|---|---|
| matchValue |
string[] |
可能的匹配值列表。 |
| matchVariable |
请求变量进行比较。 |
|
| negateCondition |
boolean |
描述是否应否定此条件的结果。 |
| operator |
用于与变量值匹配的比较类型。 |
|
| selector |
string |
与 QueryString、PostArgs、RequestHeader 或 Cookies 变量中的特定键进行匹配。 默认值为 null。 |
| transforms |
转换列表。 |
MatchVariable
请求变量进行比较。
| 值 | 说明 |
|---|---|
| RemoteAddr | |
| RequestMethod | |
| QueryString | |
| PostArgs | |
| RequestUri | |
| RequestHeader | |
| RequestBody | |
| Cookies | |
| SocketAddr |
Operator
用于与变量值匹配的比较类型。
| 值 | 说明 |
|---|---|
| Any | |
| IPMatch | |
| GeoMatch | |
| Equal | |
| Contains | |
| LessThan | |
| GreaterThan | |
| LessThanOrEqual | |
| GreaterThanOrEqual | |
| BeginsWith | |
| EndsWith | |
| RegEx | |
| ServiceTagMatch |
PolicyEnabledState
描述策略是处于启用状态还是禁用状态。 如果未指定,则默认为 Enabled。
| 值 | 说明 |
|---|---|
| Disabled | |
| Enabled |
PolicyMode
描述它在策略级别是否处于检测模式或预防模式。
| 值 | 说明 |
|---|---|
| Prevention | |
| Detection |
PolicyRequestBodyCheck
描述策略托管规则是否将检查请求正文内容。
| 值 | 说明 |
|---|---|
| Disabled | |
| Enabled |
PolicyResourceState
策略的资源状态。
| 值 | 说明 |
|---|---|
| Creating | |
| Enabling | |
| Enabled | |
| Disabling | |
| 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 |
如果操作类型为块,客户可以替代响应状态代码。 |
| 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 |
scrubbingRuleEntryMatchVariable
要从日志中清理的变量。
| 值 | 说明 |
|---|---|
| RequestIPAddress | |
| RequestUri | |
| QueryStringArgNames | |
| RequestHeaderNames | |
| RequestCookieNames | |
| RequestBodyPostArgNames | |
| RequestBodyJsonArgNames |
SecurityPolicyLink
定义安全策略的资源 ID。
| 名称 | 类型 | 说明 |
|---|---|---|
| id |
string |
资源 ID。 |
SensitivityType
定义规则的敏感度。
| 值 | 说明 |
|---|---|
| Low |
低灵敏度 - 通过更大的流量峰值触发规则 |
| Medium |
中等灵敏度 - 通过流量的中度峰值触发规则 |
| High |
高灵敏度 - 通过较小的流量峰值触发规则 |
Sku
Web 应用程序防火墙策略的定价层。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
定价层的名称。 |
SkuName
定价层的名称。
| 值 | 说明 |
|---|---|
| Classic_AzureFrontDoor | |
| Standard_AzureFrontDoor | |
| Premium_AzureFrontDoor |
TransformType
描述在匹配之前应用的转换。
| 值 | 说明 |
|---|---|
| Lowercase | |
| Uppercase | |
| Trim | |
| UrlDecode | |
| UrlEncode | |
| RemoveNulls |
VariableName
介绍组依据的受支持变量
| 值 | 说明 |
|---|---|
| SocketAddr | |
| GeoLocation | |
| 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 |