Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Updated with latest APRL recommendations. #79

Merged
merged 69 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from 65 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
d4ee921
Update _index.md
jimays-avila Sep 13, 2023
fa32673
Update appgw-1.kql
jimays-avila Sep 13, 2023
173c0be
Update appgw-2.kql
jimays-avila Sep 13, 2023
1cb0e7d
Update appgw-3.kql
jimays-avila Sep 13, 2023
85781e7
Update appgw-4.kql
jimays-avila Sep 13, 2023
919c19d
Update appgw-5.kql
jimays-avila Sep 13, 2023
c3e3085
Update appgw-6.kql
jimays-avila Sep 13, 2023
8c1cbae
Update appgw-7.kql
jimays-avila Sep 13, 2023
4120ac1
Update appgw-8.kql
jimays-avila Sep 13, 2023
1d46263
Update _index.md
jimays-avila Sep 13, 2023
7840b1b
Create appgw-9.kql
jimays-avila Sep 13, 2023
86fd561
Update _index.md
jimays-avila Sep 14, 2023
9f89b83
Update _index.md
jimays-avila Sep 14, 2023
11721e1
Update appgw-9.kql
jimays-avila Sep 15, 2023
e74b4ad
Update appgw-8.kql
jimays-avila Sep 15, 2023
4d8ffbe
Update appgw-7.kql
jimays-avila Sep 15, 2023
d69d820
Update appgw-6.kql
jimays-avila Sep 15, 2023
282a69e
Update appgw-5.kql
jimays-avila Sep 15, 2023
7230ed6
Update appgw-4.kql
jimays-avila Sep 15, 2023
3503f81
Update appgw-3.kql
jimays-avila Sep 15, 2023
24ee22c
Update appgw-2.kql
jimays-avila Sep 15, 2023
98c6702
Update appgw-1.kql
jimays-avila Sep 15, 2023
c45fbe1
Update appgw-9.kql
jimays-avila Sep 15, 2023
dcd23c6
Update appgw-2.kql
jimays-avila Oct 3, 2023
871d60b
Update appgw-5.kql
jimays-avila Oct 3, 2023
c0f30ed
Update appgw-1.kql
jimays-avila Oct 3, 2023
4e056f2
Update appgw-2.kql
jimays-avila Oct 3, 2023
cf05551
Update appgw-3.kql
jimays-avila Oct 3, 2023
dcee2cb
Update appgw-4.kql
jimays-avila Oct 3, 2023
45a0fdf
Update appgw-6.kql
jimays-avila Oct 3, 2023
6bf5214
Update appgw-7.kql
jimays-avila Oct 3, 2023
94a9774
Update appgw-8.kql
jimays-avila Oct 3, 2023
9b689f8
Update appgw-9.kql
jimays-avila Oct 3, 2023
3d3cfaa
Update appgw-1.kql
jimays-avila Oct 3, 2023
f879f15
Update appgw-2.kql
jimays-avila Oct 3, 2023
01cd1fb
Update appgw-3.kql
jimays-avila Oct 3, 2023
50055fb
Update appgw-4.kql
jimays-avila Oct 3, 2023
9ab83fa
Update appgw-6.kql
jimays-avila Oct 3, 2023
4a64fe2
Update appgw-7.kql
jimays-avila Oct 3, 2023
ff5d03a
Update appgw-8.kql
jimays-avila Oct 3, 2023
8a4292c
Update appgw-1.kql
jimays-avila Oct 3, 2023
d3bba05
Update appgw-2.kql
jimays-avila Oct 3, 2023
7c48699
Update appgw-3.kql
jimays-avila Oct 3, 2023
b857ae5
Update appgw-4.kql
jimays-avila Oct 3, 2023
2e7c310
Update appgw-6.kql
jimays-avila Oct 3, 2023
75f71a0
Update appgw-7.kql
jimays-avila Oct 3, 2023
434b336
Update appgw-8.kql
jimays-avila Oct 3, 2023
45ec3c6
Rename _index.md to _index.md
jimays-avila Oct 5, 2023
80684fd
Rename appgw-1.kql to agw-1.kql
jimays-avila Oct 5, 2023
1431f81
Rename appgw-2.kql to agw-2.kql
jimays-avila Oct 5, 2023
d437396
Rename appgw-3.kql to agw-3.kql
jimays-avila Oct 5, 2023
7fcaa0e
Rename appgw-4.kql to agw-4.kql
jimays-avila Oct 5, 2023
d611077
Rename appgw-5.kql to agw-5.kql
jimays-avila Oct 5, 2023
2ff91be
Rename appgw-6.kql to agw-6.kql
jimays-avila Oct 5, 2023
ac1a140
Rename appgw-7.kql to agw-7.kql
jimays-avila Oct 5, 2023
e1b22b2
Rename appgw-8.kql to agw-8.kql
jimays-avila Oct 5, 2023
b1eccb6
Rename appgw-9.kql to agw-9.kql
jimays-avila Oct 5, 2023
7a29cb0
Fixing merge conflicts (#3)
oZakari Oct 6, 2023
51d01f9
Merge remote-tracking branch 'upstream/main' into main
jimays-avila Oct 6, 2023
70ff951
Update _index.md
jimays-avila Oct 9, 2023
529e2b0
Create vmss-10.kql
jimays-avila Oct 9, 2023
e396d4e
Latest merge (#5)
oZakari Oct 9, 2023
9997a63
Update _index.md
jimays-avila Oct 10, 2023
965fe8b
Update agw-8.kql
jimays-avila Oct 10, 2023
dba62d9
Update vmss-10.kql
jimays-avila Oct 10, 2023
7adf199
Merge branch 'Azure:main' into main
jimays-avila Oct 17, 2023
a98e39f
ARG changes made
jimays-avila Oct 17, 2023
5b91ea9
Merge branch 'main' of https://github.com/jimays-avila/Azure-Proactiv…
jimays-avila Oct 17, 2023
69530db
updating index due to error
jimays-avila Oct 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The presented resiliency recommendations in this guidance include Virtual Machin
| [VMSS-7 - Configure Allocation Policy Spreading algorithm to Max Spreading](#vmss-7---configure-allocation-policy-spreading-algorithm-to-max-spreading) | Medium | Preview | Yes |
| [VMSS-8 - Deploy VMSS across availability zones with VMSS Flex](#vmss-8---deploy-vmss-across-availability-zones-with-vmss-flex) | High | Preview | Yes |
| [VMSS-9 - Set Patch orchestration options to Azure-orchestrated](#vmss-9---set-patch-orchestration-options-to-azure-orchestrated) | Low | Preview | No |

{{< /table >}}

{{< alert style="info" >}}
Expand Down Expand Up @@ -260,3 +261,4 @@ Enabling automatic VM guest patching for your Azure VMs helps ease update manage
{{< /collapse >}}

<br><br>

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Azure Resource Graph Query
// This query will check if the VMSS are currently using the latest image. If not the Image reference will be empty
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| extend VMSSName = name
| extend ImageReference = tostring(properties.virtualMachineProfile.storageProfile.imageReference.version)
| project recommendationId="vmss-10",name,id, param1="ImageReference"
27 changes: 23 additions & 4 deletions docs/content/services/networking/application-gateway/_index.md
jimays-avila marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ The presented resiliency recommendations in this guidance include Application Ga
| [AGW-2 - Secure all incoming connections with SSL](#agw-2---secure-all-incoming-connections-with-ssl) | High | Preview | Yes |
| [AGW-3 - Enable WAF policies](#agw-3---enable-web-application-firewall-policies) | High | Preview | Yes |
| [AGW-4 - Use Application GW V2 instead of V1](#agw-4---use-application-gw-v2-instead-of-v1) | High | Preview | Yes |
| [AGW-5 - Monitor and Log the configurations and traffic](#agw-5---monitor-and-log-the-configurations-and-traffic) | Medium | Preview | Yes |
| [AGW-5 - Monitor and Log the configurations and traffic](#agw-5---monitor-and-log-the-configurations-and-traffic) | Medium | Preview | No |
| [AGW-6 - Use Health Probes to detect backend availability](#agw-6---use-health-probes-to-detect-backend-availability) | Medium | Preview | Yes |
| [AGW-7 - Deploy backends in a zone-redundant configuration](#agw-7---deploy-backends-in-a-zone-redundant-configuration) | High | Preview | Yes |
| [AGW-7 - Deploy backends in a zone-redundant configuration](#agw-7---deploy-backends-in-a-zone-redundant-configuration) | High | Preview | No |
| [AGW-8 - Plan for backend maintenance by using connection draining](#agw-8---plan-for-backend-maintenance-by-using-connection-draining) | Medium | Preview | Yes |
| [AGW-9 - Ensure Application Gateway Subnet is using a /24 subnet mask](#agw-9---ensure-application-gateway-subnet-is-using-a-24-subnet-mask) | High | Preview | Yes |

{{< /table >}}

========
{{< alert style="info" >}}

Definitions of states can be found [here]({{< ref "../../../_index.md#definitions-of-terms-used-in-aprl">}})
Expand Down Expand Up @@ -227,11 +228,29 @@ Plan for backend maintenance by using connection draining. Connection draining h
- [Application Gateway Connection Draining HTTP Settings](https://learn.microsoft.com/azure/application-gateway/configuration-http-settings#connection-draining)

**Resource Graph Query/Scripts**

jimays-avila marked this conversation as resolved.
Show resolved Hide resolved
{{< collapse title="Show/Hide Query/Script" >}}

{{< code lang="sql" file="code/agw-8/agw-8.kql" >}} {{< /code >}}

{{< /collapse >}}

<br><br>

### AGW-9 - Ensure Application Gateway Subnet is using a /24 subnet mask

**Impact: High**

**Recommendation/Guidance**

Application Gateway (Standard_v2 or WAF_v2 SKU) can support up to 125 instances. Although a /24 subnet isn't required per Application Gateway v2 SKU deployment, it is highly recommended. This is to ensure that Application Gateway v2 has sufficient space for autoscaling expansion and maintenance upgrades.

**Resources**

- [Azure Application Gateway infrastructure configuration | Microsoft Learn](https://learn.microsoft.com/en-us/azure/application-gateway/configuration-infrastructure#size-of-the-subnet)

**Resource Graph Query/Scripts**

{{< collapse title="Show/Hide Query/Script" >}}
{{< code lang="sql" file="code/agw-1/agw-9.kql" >}} {{< /code >}}
{{< /collapse >}}
<br><br>
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ resources
| where isnull(properties.capacity.autoScaleConfiguration) or properties.capacity.autoScaleConfiguration.minCapacity <= 1
| project recommendationId = "agw-1", name, id, param1 = "autoScaleConfiguration: isNull or MinCapacity <= 1"
| order by id asc

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// Azure Resource Graph Query
// You can use the following Azure Resource Graph query to check if an HTTP rule is using an SSL certificate or is using Azure Key Vault to store the certificates
resources
| where type == "microsoft.network/applicationGateways"
| extend ssl_enabled = tobool(isnotnull(properties.sslCertificates[0].keyVaultSecretId) or isnotnull(properties.sslCertificates[0].keyVaultSecretUrl))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Resources
| where isnull(properties.webApplicationFirewallConfiguration)
| project recommendationId = "agw-3", name, id, param1 = "webApplicationFirewallConfiguration: isNull"
| order by id asc

Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ resources
| where sku != "waf_v2" and sku != "standard_v2"
| project recommendationId = "agw-4", name, id, param1 = "sku: v1"
| order by id asc

Original file line number Diff line number Diff line change
@@ -1,42 +1 @@
// under development
// resources
// where type == "microsoft.network/applicationGateways"
//| extend resourceId = tostring(id)
//| join (Resources
// | where type == "microsoft.insights/components"
// | extend componentName = name
// | extend componentResourceId = id
// | project componentResourceId, componentName
// ) on $left.resourceId == $right.componentResourceId
//| extend startDateTime = ago(30d)
//| extend endDateTime = now()
//| mvexpand componentName
//| summarize by name, componentName, componentResourceId
//| project name, componentName, componentResourceId,
// appGatewayLogs = make_list(
// {
// type = "ApplicationGatewayAccess",
// workspace = componentName,
// startDateTime = startDateTime,
// endDateTime = endDateTime,
// resourceId = resourceId
// }
// ),
// appGatewayConfigLogs = make_list(
// {
// type = "ApplicationGatewayConfig",
// workspace = componentName,
// startDateTime = startDateTime,
// endDateTime = endDateTime,
// resourceId = resourceId
// }
// ),
// appGatewayWafLogs = make_list(
// {
// type = "ApplicationGatewayFirewallLog",
// workspace = componentName,
// startDateTime = startDateTime,
// endDateTime = endDateTime,
// resourceId = resourceId
// }
// )
// cannot-be-validated-with-arg
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Azure Resource Graph Query
// You can use the following Azure Resource Graph query to check which App GWs are not using SSL certs
//under development
//Resources
//| where type == "microsoft.network/applicationGateways"
//| extend appGatewayResourceId = tostring(id)
//| mvexpand probeConfig = properties.probes
//| where probeConfig.probeName != "GatewaySslCertificate"
//| where iif(isnotempty(probeConfig.pickHostName), "Yes", "No")
//| project recommendationId="agw-6",name, id, param1=strcat("appGatewayResourceId: ", appGatewayResourceId), param2=strcat("customHealthProbeUsed :", customHealthProbeUsed)
Resources
| where type == "microsoft.network/applicationGateways"
| extend appGatewayResourceId = tostring(id)
| mvexpand probeConfig = properties.probes
| where probeConfig.probeName != "GatewaySslCertificate"
| where iif(isnotempty(probeConfig.pickHostName), "Yes", "No")
| project recommendationId="agw-6",name, id, param1=strcat("appGatewayResourceId: ", appGatewayResourceId), param2=strcat("customHealthProbeUsed :", customHealthProbeUsed)

oZakari marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Azure Resource Graph Query
// You can use the following Azure Resource Graph Query to see if the Application Gateway is zone redundant
Resources
| where type == "microsoft.network/applicationGateways"
| extend appGatewayResourceId = tostring(id)
| extend zoneRedundant = tostring(properties.enableZoneRedundancy)
| project appGatewayResourceId, zoneRedundant

oZakari marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Azure Resource Graph Query
// This query will check if connection draining is enabled
Resources
| where type == "microsoft.network/applicationGateways"
| extend appGatewayResourceId = tostring(id)
| extend connectionDrainingEnabled = tostring(properties.backendAddressPoolSettings.connectionDraining.enabled)
| project appGatewayResourceId, connectionDrainingEnabled
| project recommendationId = "agw-8", name, id, param1 = "appGatewayResourceId", param2 ="connectionDrainingEnabled"

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// cannot-be-validated-with-arg