你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Microsoft.Network ApplicationGatewayWebApplicationFirewallPolicies 2021-03-01
Bicep 资源定义
ApplicationGatewayWebApplicationFirewallPolicies 资源类型可以使用以下目标操作进行部署:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies 资源,请将以下 Bicep 添加到模板。
resource symbolicname 'Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies@2021-03-01' = {
name: 'string'
location: 'string'
tags: {
tagName1: 'tagValue1'
tagName2: 'tagValue2'
}
properties: {
customRules: [
{
action: 'string'
matchConditions: [
{
matchValues: [
'string'
]
matchVariables: [
{
selector: 'string'
variableName: 'string'
}
]
negationConditon: bool
operator: 'string'
transforms: [
'string'
]
}
]
name: 'string'
priority: int
ruleType: 'string'
}
]
managedRules: {
exclusions: [
{
matchVariable: 'string'
selector: 'string'
selectorMatchOperator: 'string'
}
]
managedRuleSets: [
{
ruleGroupOverrides: [
{
ruleGroupName: 'string'
rules: [
{
ruleId: 'string'
state: 'Disabled'
}
]
}
]
ruleSetType: 'string'
ruleSetVersion: 'string'
}
]
}
policySettings: {
fileUploadLimitInMb: int
maxRequestBodySizeInKb: int
mode: 'string'
requestBodyCheck: bool
state: 'string'
}
}
}
属性值
ApplicationGatewayWebApplicationFirewallPolicies
名称 | 说明 | 值 |
---|---|---|
name | 资源名称 | 字符串 (必需) |
location | 资源位置。 | 字符串 |
标记 | 资源标记。 | 标记名称和值的字典。 请参阅 模板中的标记 |
properties | Web 应用程序防火墙策略的属性。 | WebApplicationFirewallPolicyPropertiesFormat |
WebApplicationFirewallPolicyPropertiesFormat
名称 | 说明 | 值 |
---|---|---|
customRules | 策略中的自定义规则。 | WebApplicationFirewallCustomRule[] |
managedRules | 描述 managedRules 结构。 | 需要 managedRulesDefinition () |
policySettings | 策略的 PolicySettings。 | PolicySettings |
WebApplicationFirewallCustomRule
名称 | 说明 | 值 |
---|---|---|
action | 操作的类型。 | “允许” 'Block' 需要“Log” () |
matchConditions | 匹配条件列表。 | MatchCondition[] (必需) |
name | 策略中唯一的资源的名称。 此名称可用于访问资源。 | 字符串 |
priority | 规则的优先级。 值较低的规则将在具有较高值的规则之前进行评估。 | int (必需) |
ruleType | 规则类型。 | “无效” “MatchRule” (必需) |
MatchCondition
名称 | 说明 | 值 |
---|---|---|
matchValues | 匹配值。 | string[] (必需) |
matchVariables | 匹配变量的列表。 | MatchVariable[] (必需) |
negationConditon | 这是否为否定条件。 | bool |
运算符后的表达式 | 要匹配的运算符。 | 'BeginsWith' “Contains” 'EndsWith' “Equal” “GeoMatch” “GreaterThan” “GreaterThanOrEqual” “IPMatch” “LessThan” “LessThanOrEqual” 需要“正则表达式” () |
转换 | 转换列表。 | 包含任何一项的字符串数组: “HtmlEntityDecode” “小写” 'RemoveNulls' “Trim” 'UrlDecode' 'UrlEncode' |
MatchVariable
名称 | 说明 | 值 |
---|---|---|
选择器 | 匹配变量的选择器。 | 字符串 |
variableName | 匹配变量。 | “PostArgs” “QueryString” “RemoteAddr” 'RequestBody' 'RequestCookies' “RequestHeaders” 'RequestMethod' “RequestUri” (必需) |
ManagedRulesDefinition
名称 | 说明 | 值 |
---|---|---|
排除 | 应用于策略的排除项。 | OwaspCrsExclusionEntry[] |
managedRuleSets | 与策略关联的托管规则集。 | ManagedRuleSet[] (必需) |
OwaspCrsExclusionEntry
名称 | 说明 | 值 |
---|---|---|
matchVariable | 要排除的变量。 | 'RequestArgNames' “RequestCookieNames” “RequestHeaderNames” (必需) |
选择器 | 当 matchVariable 是集合时,运算符用于指定此排除项应用于集合中的哪些元素。 | 字符串 (必需) |
selectorMatchOperator | 当 matchVariable 是集合时,对选择器执行操作以指定此排除项应用于集合中的哪些元素。 | “Contains” 'EndsWith' 'Equals' 'EqualsAny' “StartsWith” (必需) |
ManagedRuleSet
名称 | 说明 | 值 |
---|---|---|
ruleGroupOverrides | 定义要应用于规则集的规则组替代。 | ManagedRuleGroupOverride[] |
ruleSetType | 定义要使用的规则集类型。 | 字符串 (必需) |
ruleSetVersion | 定义要使用的规则集的版本。 | 字符串 (必需) |
ManagedRuleGroupOverride
名称 | 说明 | 值 |
---|---|---|
ruleGroupName | 要替代的托管规则组。 | 字符串 (必需) |
规则 | 将禁用的规则列表。 如果未指定任何规则,则将禁用组中的所有规则。 | ManagedRuleOverride[] |
ManagedRuleOverride
名称 | 说明 | 值 |
---|---|---|
ruleId | 托管规则的标识符。 | 字符串 (必需) |
state | 托管规则的状态。 如果未指定,则默认为 Disabled。 | 'Disabled' |
PolicySettings
名称 | 说明 | 值 |
---|---|---|
fileUploadLimitInMb | WAF 的最大文件上传大小(以 Mb 为单位)。 | int |
maxRequestBodySizeInKb | WAF 的最大请求正文大小(以 Kb 为单位)。 | int |
mode | 策略的模式。 | “检测” “预防” |
requestBodyCheck | 是否允许 WAF 检查请求正文。 | bool |
state | 策略的状态。 | “Disabled” “已启用” |
快速入门模板
以下快速入门模板部署此资源类型。
模板 | 说明 |
---|---|
在 Azure 应用程序网关 上创建 Azure WAF v2 |
此模板在 Azure 应用程序网关 上创建 Azure Web 应用程序防火墙 v2,后端池中具有两个Windows Server 2016服务器 |
具有 NAT 网关和应用程序网关的 AKS 群集 |
此示例演示如何使用 NAT 网关部署 AKS 群集进行出站连接,为入站连接部署应用程序网关。 |
具有应用程序网关源的 Front Door 标准版/高级版 |
此模板创建 Front Door 标准版/高级版和应用程序网关实例,并使用 NSG 和 WAF 策略验证流量是否已通过 Front Door 源。 |
带有容器实例和应用程序网关的 Front Door |
此模板使用容器组和应用程序网关创建 Front Door 标准版/高级版。 |
具有 应用程序网关 入口控制器的 AKS 群集 |
此示例演示如何使用 应用程序网关、应用程序网关 入口控制器、Azure 容器注册表、Log Analytics 和 密钥保管库 部署 AKS 群集 |
使用 WAF 和防火墙策略应用程序网关 |
此模板创建一个应用程序网关,其中配置了 WAF 和防火墙策略 |
ARM 模板资源定义
ApplicationGatewayWebApplicationFirewallPolicies 资源类型可以使用以下目标操作进行部署:
- 资源组 - 请参阅 资源组部署命令
有关每个 API 版本中更改的属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies 资源,请将以下 JSON 添加到模板。
{
"type": "Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies",
"apiVersion": "2021-03-01",
"name": "string",
"location": "string",
"tags": {
"tagName1": "tagValue1",
"tagName2": "tagValue2"
},
"properties": {
"customRules": [
{
"action": "string",
"matchConditions": [
{
"matchValues": [ "string" ],
"matchVariables": [
{
"selector": "string",
"variableName": "string"
}
],
"negationConditon": "bool",
"operator": "string",
"transforms": [ "string" ]
}
],
"name": "string",
"priority": "int",
"ruleType": "string"
}
],
"managedRules": {
"exclusions": [
{
"matchVariable": "string",
"selector": "string",
"selectorMatchOperator": "string"
}
],
"managedRuleSets": [
{
"ruleGroupOverrides": [
{
"ruleGroupName": "string",
"rules": [
{
"ruleId": "string",
"state": "Disabled"
}
]
}
],
"ruleSetType": "string",
"ruleSetVersion": "string"
}
]
},
"policySettings": {
"fileUploadLimitInMb": "int",
"maxRequestBodySizeInKb": "int",
"mode": "string",
"requestBodyCheck": "bool",
"state": "string"
}
}
}
属性值
ApplicationGatewayWebApplicationFirewallPolicies
名称 | 说明 | Value |
---|---|---|
type | 资源类型 | “Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies” |
apiVersion | 资源 API 版本 | '2021-03-01' |
name | 资源名称 | 字符串 (必需) |
location | 资源位置。 | 字符串 |
标记 | 资源标记。 | 标记名称和值的字典。 请参阅 模板中的标记 |
properties | Web 应用程序防火墙策略的属性。 | WebApplicationFirewallPolicyPropertiesFormat |
WebApplicationFirewallPolicyPropertiesFormat
名称 | 说明 | 值 |
---|---|---|
customRules | 策略中的自定义规则。 | WebApplicationFirewallCustomRule[] |
managedRules | 介绍 managedRules 结构。 | ManagedRulesDefinition (必需) |
policySettings | 策略的 PolicySettings。 | PolicySettings |
WebApplicationFirewallCustomRule
名称 | 说明 | 值 |
---|---|---|
action | 操作的类型。 | “允许” “阻止” “Log” (必需) |
matchConditions | 匹配条件列表。 | MatchCondition[] (必需的) |
name | 策略中唯一的资源的名称。 此名称可用于访问资源。 | 字符串 |
priority | 规则的优先级。 值较低的规则将在具有较高值的规则之前进行评估。 | int (必需) |
ruleType | 规则类型。 | “无效” “MatchRule” (必需) |
MatchCondition
名称 | 说明 | 值 |
---|---|---|
matchValues | 匹配值。 | string[] (必需的) |
matchVariables | 匹配变量的列表。 | MatchVariable[] (必需) |
negationConditon | 这是否为否定条件。 | bool |
运算符后的表达式 | 要匹配的运算符。 | “BeginsWith” “Contains” “EndsWith” “Equal” “GeoMatch” “GreaterThan” “GreaterThanOrEqual” “IPMatch” “LessThan” “LessThanOrEqual” “Regex” (必需) |
转换 | 转换列表。 | 包含任意项的字符串数组: “HtmlEntityDecode” “小写” “RemoveNulls” “Trim” “UrlDecode” “UrlEncode” |
MatchVariable
名称 | 说明 | 值 |
---|---|---|
选择器 | 匹配变量的选择器。 | 字符串 |
variableName | 匹配变量。 | “PostArgs” “QueryString” “RemoteAddr” “RequestBody” “RequestCookies” “RequestHeaders” “RequestMethod” “RequestUri” (必需) |
ManagedRulesDefinition
名称 | 说明 | 值 |
---|---|---|
排除 | 应用于策略的排除项。 | OwaspCrsExclusionEntry[] |
managedRuleSets | 与策略关联的托管规则集。 | ManagedRuleSet[] (必需的) |
OwaspCrsExclusionEntry
名称 | 说明 | 值 |
---|---|---|
matchVariable | 要排除的变量。 | “RequestArgNames” “RequestCookieNames” “RequestHeaderNames” (必需) |
选择器 | 当 matchVariable 是集合时,运算符用于指定此排除项适用于集合中的哪些元素。 | 字符串 (必需) |
selectorMatchOperator | 当 matchVariable 是集合时,对选择器执行操作以指定此排除项适用于集合中的哪些元素。 | “Contains” “EndsWith” “Equals” “EqualsAny” “StartsWith” (必需) |
ManagedRuleSet
名称 | 说明 | 值 |
---|---|---|
ruleGroupOverrides | 定义要应用于规则集的规则组替代。 | ManagedRuleGroupOverride[] |
ruleSetType | 定义要使用的规则集类型。 | 字符串 (必需) |
ruleSetVersion | 定义要使用的规则集的版本。 | 字符串 (必需) |
ManagedRuleGroupOverride
名称 | 说明 | 值 |
---|---|---|
ruleGroupName | 要替代的托管规则组。 | 字符串 (必需) |
规则 | 将禁用的规则列表。 如果未指定任何规则,则将禁用组中的所有规则。 | ManagedRuleOverride[] |
ManagedRuleOverride
名称 | 说明 | 值 |
---|---|---|
ruleId | 托管规则的标识符。 | 字符串 (必需) |
state | 托管规则的状态。 如果未指定,则默认为 Disabled。 | “Disabled” |
PolicySettings
名称 | 说明 | 值 |
---|---|---|
fileUploadLimitInMb | WAF 的最大文件上传大小(以 Mb 为单位)。 | int |
maxRequestBodySizeInKb | WAF 的最大请求正文大小(以 Kb 为单位)。 | int |
mode | 策略的模式。 | “检测” “预防” |
requestBodyCheck | 是否允许 WAF 检查请求正文。 | bool |
state | 策略的状态。 | “Disabled” “已启用” |
快速入门模板
以下快速入门模板部署此资源类型。
模板 | 说明 |
---|---|
在 Azure 应用程序网关 上创建 Azure WAF v2 |
此模板在 Azure 应用程序网关 上创建 Azure Web 应用程序防火墙 v2,后端池中具有两个Windows Server 2016服务器 |
具有 NAT 网关和应用程序网关的 AKS 群集 |
此示例演示如何使用 NAT 网关部署 AKS 群集进行出站连接,为入站连接部署应用程序网关。 |
具有应用程序网关源的 Front Door 标准版/高级版 |
此模板创建 Front Door 标准版/高级版和应用程序网关实例,并使用 NSG 和 WAF 策略验证流量是否已通过 Front Door 源。 |
带有容器实例和应用程序网关的 Front Door |
此模板使用容器组和应用程序网关创建 Front Door 标准版/高级版。 |
具有 应用程序网关 入口控制器的 AKS 群集 |
此示例演示如何使用 应用程序网关、应用程序网关 入口控制器、Azure 容器注册表、Log Analytics 和 密钥保管库 部署 AKS 群集 |
使用 WAF 和防火墙策略应用程序网关 |
此模板创建一个应用程序网关,其中配置了 WAF 和防火墙策略 |
Terraform (AzAPI 提供程序) 资源定义
ApplicationGatewayWebApplicationFirewallPolicies 资源类型可以使用以下目标操作进行部署:
- 资源组
有关每个 API 版本中更改的属性的列表,请参阅 更改日志。
资源格式
若要创建 Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies 资源,请将以下 Terraform 添加到模板。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies@2021-03-01"
name = "string"
location = "string"
parent_id = "string"
tags = {
tagName1 = "tagValue1"
tagName2 = "tagValue2"
}
body = jsonencode({
properties = {
customRules = [
{
action = "string"
matchConditions = [
{
matchValues = [
"string"
]
matchVariables = [
{
selector = "string"
variableName = "string"
}
]
negationConditon = bool
operator = "string"
transforms = [
"string"
]
}
]
name = "string"
priority = int
ruleType = "string"
}
]
managedRules = {
exclusions = [
{
matchVariable = "string"
selector = "string"
selectorMatchOperator = "string"
}
]
managedRuleSets = [
{
ruleGroupOverrides = [
{
ruleGroupName = "string"
rules = [
{
ruleId = "string"
state = "Disabled"
}
]
}
]
ruleSetType = "string"
ruleSetVersion = "string"
}
]
}
policySettings = {
fileUploadLimitInMb = int
maxRequestBodySizeInKb = int
mode = "string"
requestBodyCheck = bool
state = "string"
}
}
})
}
属性值
ApplicationGatewayWebApplicationFirewallPolicies
名称 | 说明 | Value |
---|---|---|
type | 资源类型 | “Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies@2021-03-01” |
name | 资源名称 | 字符串 (必需) |
location | 资源位置。 | 字符串 |
parent_id | 若要部署到资源组,请使用该资源组的 ID。 | 字符串 (必需) |
标记 | 资源标记。 | 标记名称和值的字典。 |
properties | Web 应用程序防火墙策略的属性。 | WebApplicationFirewallPolicyPropertiesFormat |
WebApplicationFirewallPolicyPropertiesFormat
名称 | 说明 | 值 |
---|---|---|
customRules | 策略中的自定义规则。 | WebApplicationFirewallCustomRule[] |
managedRules | 描述 managedRules 结构。 | 需要 managedRulesDefinition () |
policySettings | 策略的 PolicySettings。 | PolicySettings |
WebApplicationFirewallCustomRule
名称 | 说明 | 值 |
---|---|---|
action | 操作的类型。 | “允许” “阻止” “Log” (必需) |
matchConditions | 匹配条件列表。 | MatchCondition[] (必需) |
name | 策略中唯一的资源的名称。 此名称可用于访问资源。 | 字符串 |
priority | 规则的优先级。 值较低的规则将在具有较高值的规则之前进行评估。 | int (必需) |
ruleType | 规则类型。 | “无效” “MatchRule” (必需) |
MatchCondition
名称 | 说明 | 值 |
---|---|---|
matchValues | 匹配值。 | string[] (必需) |
matchVariables | 匹配变量的列表。 | MatchVariable[] (必需) |
negationConditon | 这是否为否定条件。 | bool |
运算符后的表达式 | 要匹配的运算符。 | “BeginsWith” “Contains” “EndsWith” “Equal” “GeoMatch” “GreaterThan” “GreaterThanOrEqual” “IPMatch” “LessThan” “LessThanOrEqual” 需要“正则表达式” () |
转换 | 转换列表。 | 包含任何一项的字符串数组: “HtmlEntityDecode” “小写” “RemoveNulls” “Trim” “UrlDecode” “UrlEncode” |
MatchVariable
名称 | 说明 | 值 |
---|---|---|
选择器 | 匹配变量的选择器。 | 字符串 |
variableName | 匹配变量。 | “PostArgs” “QueryString” “RemoteAddr” “RequestBody” “RequestCookies” “RequestHeaders” “RequestMethod” 需要“RequestUri” () |
ManagedRulesDefinition
名称 | 说明 | 值 |
---|---|---|
排除 | 应用于策略的排除项。 | OwaspCrsExclusionEntry[] |
managedRuleSets | 与策略关联的托管规则集。 | ManagedRuleSet[] (必需) |
OwaspCrsExclusionEntry
名称 | 说明 | 值 |
---|---|---|
matchVariable | 要排除的变量。 | “RequestArgNames” “RequestCookieNames” “RequestHeaderNames” (必需) |
选择器 | 当 matchVariable 是集合时,运算符用于指定此排除项应用于集合中的哪些元素。 | 字符串 (必需) |
selectorMatchOperator | 当 matchVariable 是集合时,对选择器执行操作以指定此排除项应用于集合中的哪些元素。 | “Contains” “EndsWith” “Equals” “EqualsAny” “StartsWith” (必需) |
ManagedRuleSet
名称 | 说明 | 值 |
---|---|---|
ruleGroupOverrides | 定义要应用于规则集的规则组替代。 | ManagedRuleGroupOverride[] |
ruleSetType | 定义要使用的规则集类型。 | 字符串 (必需) |
ruleSetVersion | 定义要使用的规则集的版本。 | 字符串 (必需) |
ManagedRuleGroupOverride
名称 | 说明 | 值 |
---|---|---|
ruleGroupName | 要替代的托管规则组。 | 字符串 (必需) |
规则 | 将禁用的规则列表。 如果未指定任何规则,则将禁用组中的所有规则。 | ManagedRuleOverride[] |
ManagedRuleOverride
名称 | 说明 | 值 |
---|---|---|
ruleId | 托管规则的标识符。 | 字符串 (必需) |
state | 托管规则的状态。 如果未指定,则默认为 Disabled。 | “Disabled” |
PolicySettings
名称 | 说明 | 值 |
---|---|---|
fileUploadLimitInMb | WAF 的最大文件上传大小(以 Mb 为单位)。 | int |
maxRequestBodySizeInKb | WAF 的最大请求正文大小(以 Kb 为单位)。 | int |
mode | 策略的模式。 | “检测” “预防” |
requestBodyCheck | 是否允许 WAF 检查请求正文。 | bool |
state | 策略的状态。 | “Disabled” “Enabled” |
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈