- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个可用的 ARM 模板来部署启用了 WAF 的应用程序网关,当前始终启用防火墙并根据参数设置防火墙模式。
我们希望参数化启用WAF,以便可以在没有WAF的情况下部署AGW
属性中的对象如下所示:
"webApplicationFirewallConfiguration": {
"enabled": "[parameters('applicationGateway').firewallEnabled]",
"firewallMode": "[parameters('applicationGateway').firewallMode]",
"ruleSetType": "OWASP",
"ruleSetVersion": "3.0"
}
参数文件设置了这些:
"firewallEnabled": false,
"Tier": "Standard",
"skuSize": "Standard_Medium",
但是在部署时尝试启用防火墙时会出错
New-AzResourceGroupDeployment : 11:28:27 AM - Error:
Code=ApplicationGatewayFirewallCannotBeEnabledForSelectedSku;
Message=Application Gateway
/subscriptions//providers/Microsoft.Network/applicationGatewa
ys/EXAMPLE-AGW does not support WebApplicationFirewall with the
selected SKU tier Standard
看起来它仍在尝试启用防火墙,即使“enabled:”属性为 false,我认为它会忽略对象中的其余属性,但显然不会。谁能看到我在这里做错了什么吗?
最佳答案
失败原因:由于标准层 AppGateway 不支持 WebApplicationFirewall,因此即使启用设置为 false,模板验证也会失败,因为验证会将“webApplicationFirewallConfiguration” key 本身视为对标准层无效。
修复:使用嵌套模板创建应用程序网关模板的子部署,如果防火墙已禁用,则不带“webApplicationFirewallConfiguration”,否则,如果启用防火墙以及防火墙模式值,则创建包含“webApplicationFirewallConfiguration”的应用程序网关模板的子部署在参数文件中。
工作示例:请在下面找到用于部署的根模板以及两个启用和禁用防火墙的模板。然后,它有两个参数文件 - 一个用于启用防火墙,另一个用于禁用防火墙。
要试用此示例,请按照以下步骤操作:
根模板(VNet + 子部署):
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"applicationGateway": {
"type": "object",
"metadata": {
"description": "Application gateway specific information"
}
},
"virtualNetworkName": {
"type": "string",
"metadata": {
"description": "virtual network name"
}
},
"vnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/16",
"metadata": {
"description": "virtual network address range"
}
},
"subnetName": {
"type": "string",
"defaultValue": "subnet1",
"metadata": {
"description": "Subnet Name"
}
},
"subnetPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/24",
"metadata": {
"description": "Subnet prefix"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {
"subnetRef": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworkName'), parameters('subnetName'))]",
"appGatewaysTemplateWaffalse": "https://da2.blob.core.windows.net/templates/app-gateway-waf-false.json",
"appGatewaysTemplateWaftrue": "https://da2.blob.core.windows.net/templates/app-gateway-waf-true.json"
},
"resources": [
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Network/virtualNetworks",
"name": "[parameters('virtualNetworkName')]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[parameters('vnetAddressPrefix')]"
]
},
"subnets": [
{
"name": "[parameters('subnetName')]",
"properties": {
"addressPrefix": "[parameters('subnetPrefix')]"
}
}
]
}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2015-01-01",
"name": "azure-appGateways-non-waf-deployment",
"dependsOn": [
"[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]"
],
"properties": {
"mode": "Incremental",
"templateLink": {
"uri": "[variables(concat('appGatewaysTemplateWaf',string(parameters('applicationGateway').firewallEnabled)))]"
},
"parameters": {
"applicationGateway": {
"value": "[parameters('applicationGateway')]"
},
"location": {
"value": "[parameters('location')]"
},
"subnetRef": {
"value": "[variables('subnetRef')]"
}
}
}
}
]
}
没有 webApplicationFirewallConfiguration 的子模板:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"applicationGateway": {
"type": "object",
"metadata": {
"description": "Application gateway specific information"
}
},
"subnetRef": {
"type": "string",
"defaultValue": "subnet id",
"metadata": {
"description": "Subnet Id"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {},
"resources": [
{
"apiVersion": "2017-06-01",
"name": "[parameters('applicationGateway').applicationGatewayName]",
"type": "Microsoft.Network/applicationGateways",
"location": "[parameters('location')]",
"dependsOn": [],
"properties": {
"sku": {
"name": "[parameters('applicationGateway').applicationGatewaySize]",
"tier": "[parameters('applicationGateway').skuTier]",
"capacity": "[parameters('applicationGateway').applicationGatewayInstanceCount]"
},
"gatewayIPConfigurations": [
{
"name": "appGatewayIpConfig",
"properties": {
"subnet": {
"id": "[parameters('subnetRef')]"
}
}
}
],
"frontendIPConfigurations": [
{
"name": "appGatewayFrontendIP",
"properties": {
"subnet": {
"id": "[parameters('subnetRef')]"
}
}
}
],
"frontendPorts": [
{
"name": "appGatewayFrontendPort",
"properties": {
"Port": "[parameters('applicationGateway').frontendPort]"
}
}
],
"backendAddressPools": [
{
"name": "appGatewayBackendPool",
"properties": {
"BackendAddresses": "[parameters('applicationGateway').backendIPAddresses]"
}
}
],
"backendHttpSettingsCollection": [
{
"name": "appGatewayBackendHttpSettings",
"properties": {
"Port": "[parameters('applicationGateway').backendPort]",
"Protocol": "Http",
"CookieBasedAffinity": "[parameters('applicationGateway').cookieBasedAffinity]"
}
}
],
"httpListeners": [
{
"name": "appGatewayHttpListener",
"properties": {
"FrontendIpConfiguration": {
"Id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/frontendIPConfigurations/appGatewayFrontendIP')]"
},
"FrontendPort": {
"Id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/frontendPorts/appGatewayFrontendPort')]"
},
"Protocol": "Http",
"SslCertificate": null
}
}
],
"requestRoutingRules": [
{
"Name": "rule1",
"properties": {
"RuleType": "Basic",
"httpListener": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/httpListeners/appGatewayHttpListener')]"
},
"backendAddressPool": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/backendAddressPools/appGatewayBackendPool')]"
},
"backendHttpSettings": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/backendHttpSettingsCollection/appGatewayBackendHttpSettings')]"
}
}
}
]
}
}
]
}
带有 webApplicationFirewallConfiguration 的子模板:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"applicationGateway": {
"type": "object",
"metadata": {
"description": "Application gateway specific information"
}
},
"subnetRef": {
"type": "string",
"defaultValue": "subnet id",
"metadata": {
"description": "Subnet Id"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"variables": {},
"resources": [
{
"apiVersion": "2017-06-01",
"name": "[parameters('applicationGateway').applicationGatewayName]",
"type": "Microsoft.Network/applicationGateways",
"location": "[parameters('location')]",
"dependsOn": [],
"properties": {
"sku": {
"name": "[parameters('applicationGateway').applicationGatewaySize]",
"tier": "[parameters('applicationGateway').skuTier]",
"capacity": "[parameters('applicationGateway').applicationGatewayInstanceCount]"
},
"gatewayIPConfigurations": [
{
"name": "appGatewayIpConfig",
"properties": {
"subnet": {
"id": "[parameters('subnetRef')]"
}
}
}
],
"frontendIPConfigurations": [
{
"name": "appGatewayFrontendIP",
"properties": {
"subnet": {
"id": "[parameters('subnetRef')]"
}
}
}
],
"frontendPorts": [
{
"name": "appGatewayFrontendPort",
"properties": {
"Port": "[parameters('applicationGateway').frontendPort]"
}
}
],
"backendAddressPools": [
{
"name": "appGatewayBackendPool",
"properties": {
"BackendAddresses": "[parameters('applicationGateway').backendIPAddresses]"
}
}
],
"backendHttpSettingsCollection": [
{
"name": "appGatewayBackendHttpSettings",
"properties": {
"Port": "[parameters('applicationGateway').backendPort]",
"Protocol": "Http",
"CookieBasedAffinity": "[parameters('applicationGateway').cookieBasedAffinity]"
}
}
],
"httpListeners": [
{
"name": "appGatewayHttpListener",
"properties": {
"FrontendIpConfiguration": {
"Id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/frontendIPConfigurations/appGatewayFrontendIP')]"
},
"FrontendPort": {
"Id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/frontendPorts/appGatewayFrontendPort')]"
},
"Protocol": "Http",
"SslCertificate": null
}
}
],
"webApplicationFirewallConfiguration": {
"enabled": "[parameters('applicationGateway').firewallEnabled]",
"firewallMode": "[parameters('applicationGateway').firewallMode]",
"ruleSetType": "OWASP",
"ruleSetVersion": "3.0"
},
"requestRoutingRules": [
{
"Name": "rule1",
"properties": {
"RuleType": "Basic",
"httpListener": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/httpListeners/appGatewayHttpListener')]"
},
"backendAddressPool": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/backendAddressPools/appGatewayBackendPool')]"
},
"backendHttpSettings": {
"id": "[concat(resourceId('Microsoft.Network/applicationGateways', parameters('applicationGateway').applicationGatewayName), '/backendHttpSettingsCollection/appGatewayBackendHttpSettings')]"
}
}
}
]
}
}
]
}
禁用防火墙的参数:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"applicationGateway": {
"value": {
"firewallEnabled": "false",
"skuTier": "Standard",
"applicationGatewayName": "yourappgateway",
"applicationGatewaySize": "Standard_Small",
"applicationGatewayInstanceCount": 1,
"frontendPort": 80,
"backendPort": 80,
"backendIPAddresses": [
{
"IpAddress": "10.0.0.7"
},
{
"IpAddress": "10.0.0.8"
},
{
"IpAddress": "10.0.0.9"
}
],
"cookieBasedAffinity": "Disabled"
}
},
"virtualNetworkName": {
"value": "yourvnetname"
},
"vnetAddressPrefix": {
"value": "10.0.0.0/16"
},
"subnetName": {
"value": "yoursubnet"
},
"subnetPrefix": {
"value": "10.0.0.0/24"
}
}
}
启用防火墙的参数:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"applicationGateway": {
"value": {
"firewallEnabled": "true",
"firewallMode": "Detection",
"skuTier": "WAF",
"applicationGatewayName": "yourappgateway",
"applicationGatewaySize": "WAF_Medium",
"applicationGatewayInstanceCount": 1,
"frontendPort": 80,
"backendPort": 80,
"backendIPAddresses": [
{
"IpAddress": "10.0.0.7"
},
{
"IpAddress": "10.0.0.8"
},
{
"IpAddress": "10.0.0.9"
}
],
"cookieBasedAffinity": "Disabled"
}
},
"virtualNetworkName": {
"value": "yourvnetname"
},
"vnetAddressPrefix": {
"value": "10.0.0.0/16"
},
"subnetName": {
"value": "yoursubnet"
},
"subnetPrefix": {
"value": "10.0.0.0/24"
}
}
}
关于azure - 应用程序网关 ARM 模板 - 启用防火墙的参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55272127/
据我了解,无论如何,您的 Istio 网关前都会有一个 NLB 或 ALB? 但我很困惑,因为 Istio Gateway 似乎为 ALB 为第 7 层甚至更多做了很多事情? 所以我读了 ALB ->
只是一般的好奇,我还没有找到任何关于它的信息。 我最近开始学习微服务及其相关内容,例如 API 网关。我知道 API 网关可以是 Web 应用程序等的单一入口点。但是,如果有多个服务,每个服务都有自己
我对网关和虚拟机的设置有多个疑问,所以这就是我的实际情况。 我有一个应用程序网关和两个 VM Ubuntu,所有内容都托管在 Azure 上。它们都位于同一个虚拟网络上。两个虚拟机都只有一个私有(pr
在 spring-boot-integration 应用程序中,编写了一个自定义储物柜,在锁定之前重命名原始文件 (fileToLock.getAbsolutePath() + ".lock") 并预
网卡eth0 IP修改为 102.168.0.1 复制代码 代码如下: ifconfig eth0 102.168.0.1 netma
CFSDN坚持开源创造价值,我们致力于搭建一个资源共享平台,让每一个IT人在这里找到属于你的精彩世界. 这篇CFSDN的博客文章Linux系统下修改IP地址、网关、DNS的基本方法由作者收集整理,如果
我正在考虑改变我的背部将 rest api 微服务结束到 grpc 服务器。我使用 tyk 作为 api 网关来路由 http 请求。 api 网关如何处理 grpc 请求? 最佳答案 使用 gRPC
我在 AWS ApiGateway 上配置/使用身份验证时遇到了一些问题。我已经使用接收 AWS 身份验证模型的代码设置了我的 lambda 函数,见下文,它基本上解码 JWT token 并验证给定
虚拟网络网关与 VPN 网关之间有哪些区别?是什么决定了使用哪一个? 我能找到的最接近的定义是 “VPN 网关是一种特定类型的虚拟网络网关,用于通过公共(public) Internet 在 Azur
我有一个调用 _getFile 函数的输入字段 获取文件 _getFile(event) { this.loading = true; const file = event.target.f
对于微服务,常用的设计模式是 API-Gateway。我对它的实现和影响有点困惑。我的问题/疑虑如下: 为什么一般不讨论微服务的其他模式?如果是,那么我错过了他们吗? 如果我们部署一个网关服务器,那不
我们正在尝试将我们的单体核心拆分为微服务,并添加一些使用消息系统(例如 Kafka)相互连接的新服务。 下一阶段是创建 API 端点,以便通过 Api 网关在移动应用程序和微服务之间进行通信。 开发
我在本地网关上创建连接时遇到问题。 当我创建连接时,Vnet 网关是可选的,但当我选择它时,Azure 未填充或实际选择网关,不确定原因。我是否需要任何下标,或者我的 vnet 网关创建不正确? 最佳
我正在用 Java 开发 Web 服务。现在假设我有 10 项服务,并且我希望只能通过 Apigateway 访问我的所有服务。 现在假设我有一个 API 调用,需要调用 4 个服务,例如 A、B、C
我正在做一个学校项目,我的任务是制作一个简单的 api 网关,它可以放置在任何第 3 方 api 和最终用户之间,该网关可用于定义 api 的使用限制或做一些安全分析,我对此完全陌生,我知道API网关
我正在尝试集成 AWS Api Gateway 和 AWS Lambda, 我能够调用 Lambda 函数并获得响应。 但是当我使用 AWS API Gateway 并使用 GET 方法调用我的 La
我对 Spring 和 Activiti 都是个菜鸟,所以这应该是一个很大的问题。如果我的问题结构不佳或其他什么问题,我提前道歉。 这是我的 Activity 图的一部分: 首先要做的事情: 在服务任
我正在尝试将 API 网关与 Lambda 代理集成, API 服务器接收带有这些参数的请求,即邮政编码和房屋 https://api.domain.com/getAddressproxy?postc
在我们的案例中,我们需要用户在注册期间或进行任何业务交易之前预先批准他们的付款。 一旦授权,我们需要每月从他们的账户中扣除 $X。X 将根据他们当月的收入而有所不同。此外,对于某些用户,我们需要每月支
我正在尝试使用 ActiveMerchant 创建一个 Paypal express 交易。有没有办法将收款人设置为负责支付任何应计费用的实体? payment_hash = { ip: ip
我是一名优秀的程序员,十分优秀!