Forum Discussion

Ganesh1903's avatar
Ganesh1903
Copper Contributor
Sep 24, 2023

Azure web application firewall policy terratest is failing

hello All

 

Creating Application Gateway Web Application Firewall Policy: (Name "test-waf-policy-13" / Resource Group "rg--devops-01"): network.WebApplicationFirewallPoliciesClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ApplicationGatewayFirewallMatchValueNoCollection" Message="Custom Rule 'customruletest' doesn not have a valid collection match variable 'RemoteAddr' which support selector in its condition in context 'properties.customRules[0].matchConditions[0].matchVariables[0]'." Details=[]

 

 

Below is the tfvars file 

"waf_policy_rglocation": "northeurope",
"waf_policy_custom_rules_name" : "customruletest",
"waf_policy_custom_rules_priority" : "1",
"waf_policy_custom_rules_rule_type" : "MatchRule",
"waf_policy_match_variable_name" : "RemoteAddr",
"waf_policy_operator" : "IPMatch",
"waf_policy_negation_condition" : false,
"waf_policy_match_values" : []string{"192.168.1.0/24"},
"waf_policy_custom_rules_action" : "Block",
"waf_policy_enabled" : true,
"waf_policy_mode" :"Prevention",
"waf_policy_request_body_check" :  true,
"waf_policy_file_upload_limit_in_mb" : 100,
"waf_policy_match_variables_selector" : "UserAgent",
"waf_policy_managed_rules_variable" : "RequestHeaderNames",
"waf_policy_managed_rules_selector" : "x-company-secret-header",
"waf_policy_managed_rules_operator" : "Contains",
"waf_policy_set_type" :"OWASP",
"waf_policy_version" : "3.2",
"waf_policy_managed_rules_rule_group_name" : "REQUEST-944-APPLICATION-ATTACK-JAVA",
"waf_policy_override_rule_id" : "944130",
"waf_policy_rule_enabled" : true,
"waf_policy_rule_action" : "Block",

 

No RepliesBe the first to reply

Resources