Complete the code to enable the Web Application Firewall (WAF) on the Application Gateway.
az network application-gateway waf-config set --gateway-name myAppGateway --resource-group myResourceGroup --[1] EnabledThe correct parameter to enable WAF on the Application Gateway is --waf-enabled.
Complete the code to create a WAF policy with prevention mode.
az network application-gateway waf-policy create --name myWafPolicy --resource-group myResourceGroup --mode [1]The WAF policy mode to actively block threats is Prevention.
Fix the error in the command to associate the WAF policy with the Application Gateway.
az network application-gateway update --name myAppGateway --resource-group myResourceGroup --[1] myWafPolicyThe correct parameter to associate a WAF policy is --waf-policy-id, which requires the full resource ID.
Fill both blanks to configure custom rules in the WAF policy.
az network application-gateway waf-policy custom-rule create --policy-name myWafPolicy --resource-group myResourceGroup --name myRule --priority [1] --action [2] --rule-type MatchRule
The priority should be a number like 100, and the action to block requests is Block.
Fill all three blanks to create a match condition for the custom WAF rule.
az network application-gateway waf-policy custom-rule condition create --policy-name myWafPolicy --resource-group myResourceGroup --rule-name myRule --match-variables [1] --operator [2] --match-values [3]
The match variable is RequestHeaders, the operator is Contains, and the match value is User-Agent header.