From a1d13658a39efdc2cfd8bfb6eecdfb819cb17eb1 Mon Sep 17 00:00:00 2001 From: Dylan Reed <71025787+djr1991@users.noreply.github.com> Date: Mon, 25 Oct 2021 19:10:15 -0400 Subject: [PATCH] random string for fw diagnostics + missing FW rule --- .../azure-firewall.tf | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/quickstart/301-machine-learning-hub-spoke-secure/azure-firewall.tf b/quickstart/301-machine-learning-hub-spoke-secure/azure-firewall.tf index c5ab0b41..4c83703d 100644 --- a/quickstart/301-machine-learning-hub-spoke-secure/azure-firewall.tf +++ b/quickstart/301-machine-learning-hub-spoke-secure/azure-firewall.tf @@ -1,4 +1,10 @@ - +# Generate random string for unique firewall diagnostic name +resource "random_string" "fw_diag_prefix" { + length = 8 + upper = false + special = false + number = false +} resource "azurerm_ip_group" "ip_group_hub" { name = "hub-ipgroup" location = azurerm_resource_group.hub_rg.location @@ -61,7 +67,7 @@ resource "azurerm_firewall" "azure_firewall_instance" { } resource "azurerm_monitor_diagnostic_setting" "azure_firewall_instance" { - name = "diagnostics-${var.name}-${var.environment}" + name = "diagnostics-${var.name}-${var.environment}-${random_string.fw_diag_prefix.result}" target_resource_id = azurerm_firewall.azure_firewall_instance.id log_analytics_workspace_id = azurerm_log_analytics_workspace.default.id @@ -168,6 +174,20 @@ application_rule_collection { destination_fqdns = ["github.com"] } + rule { + name = "raw.githubusercontent.com" + protocols { + type = "Https" + port = 443 + } + protocols { + type = "Http" + port = 80 + } + source_ip_groups = [azurerm_ip_group.ip_group_spoke.id] + destination_fqdns = ["raw.githubusercontent.com"] + } + rule { name = "microsoft-metrics-rules" protocols {