Managed bot protection is a Microsoft-managed Azure WAF rule set for reducing malicious automated traffic against web applications. It uses Microsoft threat intelligence to identify IP addresses associated with malicious bots, whose addresses change over time. Use it alongside OWASP managed rules rather than as a complete defense. section 3.3.1 section 3.7
On Azure Front Door, bot traffic is classified as good, unknown, or bad. Good bots, such as search-engine crawlers, are allowed; unknown bots are allowed and logged; bad bots are treated as malicious and blocked. For Application Gateway, the rule set blocks or logs requests from IP addresses associated with known malicious bots. section 3.3.2 section 3.3.1
Enable the rule set through the WAF policy, then attach that policy to the traffic entry point:
- Create or use an Application Gateway WAF policy, add Microsoft_BotManagerRuleSet, and associate the policy with an Application Gateway v2. section 3.3.1
- Create or use an Azure Front Door WAF policy, add Microsoft_BotManagerRuleSet, then create a security policy that associates it with a Front Door profile and domain. section 3.3.2
- Use the latest available managed-rule-set version; enable the WAF policy and select Prevention mode when matching requests should be blocked. section 3.3.1 section 3.3.2
Add bot protection to an Application Gateway policy
Add Microsoft_BotManagerRuleSet version 0.1 to my-waf-policy in myResourceGroup. The resulting managedRuleSets output includes both the OWASP rule set and Microsoft_BotManagerRuleSet, confirming that bot protection is part of the policy. section 3.3.1
Listing 3.14 Adding managed bot protection to a WAF policy for Azure Front Door
az network front-door waf-policy managed-rules add --policy-name AzFrontDoorWafPolicy #1 --resource-group myResourceGroup #2 --type Microsoft_BotManagerRuleSet #3 --version 1.0 #4 #1 The name of the WAF policy you created #2 The resource group in which the WAF policy is deployed #3 The type of managed rule set; here, you use Microsoft managed bot protection #4 The version of the managed rule set; as a best practice, use the latest version
This Azure CLI command adds Microsoft_BotManagerRuleSet to an Azure Front Door WAF policy; specify the policy, resource group, rule-set type, and version. section 3.3.2
