From 5ea01bb50d036cfb0a8c1ecbe3fa7c8e156e8372 Mon Sep 17 00:00:00 2001 From: Matthew Frahry Date: Mon, 19 Aug 2024 23:34:41 -0700 Subject: [PATCH] `azurerm_web_application_firewall_policy` - remove `disabled_rules` from tests (#27104) * azurerm_web_application_firewall_policy - remove disabled_rules from tests * terrafmt --- ...plication_firewall_policy_resource_test.go | 213 ++++++++++++------ ...ice_email_domain_association.html.markdown | 2 +- 2 files changed, 146 insertions(+), 69 deletions(-) diff --git a/internal/services/network/web_application_firewall_policy_resource_test.go b/internal/services/network/web_application_firewall_policy_resource_test.go index f69c72ff3eb5..737dbee2cbe2 100644 --- a/internal/services/network/web_application_firewall_policy_resource_test.go +++ b/internal/services/network/web_application_firewall_policy_resource_test.go @@ -888,13 +888,22 @@ resource "azurerm_web_application_firewall_policy" "test" { version = "3.2" rule_group_override { - disabled_rules = [ - "800112", - "800111", - "800110", - "800100", - "800113", - ] + rule { + id = "800112" + } + rule { + id = "800111" + } + rule { + id = "800110" + } + rule { + id = "800100" + } + rule { + id = "800113" + } + rule_group_name = "Known-CVEs" } } @@ -994,10 +1003,12 @@ resource "azurerm_web_application_firewall_policy" "test" { rule_group_override { rule_group_name = "REQUEST-920-PROTOCOL-ENFORCEMENT" - disabled_rules = [ - "920300", - "920440", - ] + rule { + id = "920300" + } + rule { + id = "920440" + } } } } @@ -1053,10 +1064,12 @@ resource "azurerm_web_application_firewall_policy" "test" { rule_group_override { rule_group_name = "REQUEST-920-PROTOCOL-ENFORCEMENT" - disabled_rules = [ - "920300", - "920440", - ] + rule { + id = "920300" + } + rule { + id = "920440" + } } } } @@ -1168,10 +1181,12 @@ resource "azurerm_web_application_firewall_policy" "test" { rule_group_override { rule_group_name = "REQUEST-920-PROTOCOL-ENFORCEMENT" - disabled_rules = [ - "920300", - "920440", - ] + rule { + id = "920300" + } + rule { + id = "920440" + } } } } @@ -1215,42 +1230,72 @@ resource "azurerm_web_application_firewall_policy" "test" { rule_group_override { rule_group_name = "REQUEST-931-APPLICATION-ATTACK-RFI" - disabled_rules = ["931130"] + rule { + id = "931130" + } } rule_group_override { rule_group_name = "REQUEST-920-PROTOCOL-ENFORCEMENT" - disabled_rules = [ - "920320", # Missing User Agent Header - "920230" # Multiple URL Encoding Detected - ] + rule { + id = "920320" + } + rule { + id = "920230" + } } rule_group_override { rule_group_name = "REQUEST-942-APPLICATION-ATTACK-SQLI" - disabled_rules = [ - "942450", - "942430", - "942440", - "942370", - "942340", - "942260", - "942200", - "942330", - "942120", - "942110", - "942150", - "942410", - "942130", - "942100" - ] + rule { + id = "942450" + } + rule { + id = "942430" + } + rule { + id = "942440" + } + rule { + id = "942370" + } + rule { + id = "942340" + } + rule { + id = "942260" + } + rule { + id = "942200" + } + rule { + id = "942330" + } + rule { + id = "942120" + } + rule { + id = "942110" + } + rule { + id = "942150" + } + rule { + id = "942410" + } + rule { + id = "942130" + } + rule { + id = "942100" + } } rule_group_override { rule_group_name = "REQUEST-941-APPLICATION-ATTACK-XSS" - disabled_rules = [ - "941340" - ] + rule { + id = "941340" + } } } } @@ -1289,48 +1334,80 @@ resource "azurerm_web_application_firewall_policy" "test" { rule_group_override { rule_group_name = "REQUEST-931-APPLICATION-ATTACK-RFI" - disabled_rules = ["931130"] + rule { + id = "931130" + } } rule_group_override { rule_group_name = "REQUEST-920-PROTOCOL-ENFORCEMENT" - disabled_rules = [ - "920320", # Missing User Agent Header - "920230" # Multiple URL Encoding Detected - ] + rule { + id = "920320" + } + rule { + id = "920230" + } } #NEW BLOCK rule_group_override { rule_group_name = "REQUEST-932-APPLICATION-ATTACK-RCE" - disabled_rules = ["932100"] + rule { + id = "932100" + } } rule_group_override { rule_group_name = "REQUEST-942-APPLICATION-ATTACK-SQLI" - disabled_rules = [ - "942450", - "942430", - "942440", - "942370", - "942340", - "942260", - "942200", - "942330", - "942120", - "942110", - "942150", - "942410", - "942130", - "942100" - ] + rule { + id = "942450" + } + rule { + id = "942430" + } + rule { + id = "942440" + } + rule { + id = "942370" + } + rule { + id = "942340" + } + rule { + id = "942260" + } + rule { + id = "942200" + } + rule { + id = "942330" + } + rule { + id = "942120" + } + rule { + id = "942110" + } + rule { + id = "942150" + } + rule { + id = "942410" + } + rule { + id = "942130" + } + rule { + id = "942100" + } } rule_group_override { rule_group_name = "REQUEST-941-APPLICATION-ATTACK-XSS" - disabled_rules = [ - "941340" - ] + rule { + id = "941340" + } } } } diff --git a/website/docs/r/communication_service_email_domain_association.html.markdown b/website/docs/r/communication_service_email_domain_association.html.markdown index 08aa7cbdd0ee..5336df77da78 100644 --- a/website/docs/r/communication_service_email_domain_association.html.markdown +++ b/website/docs/r/communication_service_email_domain_association.html.markdown @@ -71,4 +71,4 @@ Communication service email domain association can be imported using the `resour ```shell terraform import azurerm_communication_service_email_domain_association.example "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Communication/communicationServices/communicationService1|/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Communication/emailServices/emailCommunicationService1/domains/domain1" -``` \ No newline at end of file +```