Azure Web Application Firewall (WAF) inspects HTTP and HTTPS requests before they reach protected applications. It evaluates request attributes such as headers, cookies, query strings, and supported request bodies against managed and custom rules. Managed rules detect patterns associated with SQL injection, cross-site scripting, protocol violations, and other common attacks. WAF reduces exposure to known attack techniques, but it does not replace secure application development, authentication, authorization, or vulnerability remediation.
Choose the hosting platform according to the application's traffic path. Azure Front Door applies WAF policies at Microsoft's global edge and can protect applications with origins in multiple regions or outside Azure. Front Door Premium supports managed rules and the full WAF feature set; Front Door Standard supports custom rules only. Application Gateway WAF_v2 provides regional inspection through a gateway deployed in an Azure virtual network. Application Gateway for Containers provides a WAF option for Kubernetes Gateway API workloads, with a platform-specific feature set.
A WAF policy contains enforcement settings, custom rules, managed rule selections, and tuning configuration. On Application Gateway WAF_v2, policies can be associated with the gateway, individual listeners, or path-based routing rules. Front Door Premium supports policy associations at profile, domain, and route scope. Use application-specific policies or appropriately scoped associations when applications require different exclusions, request limits, or enforcement controls. Keep policy definitions in source control and deploy changes through infrastructure-as-code workflows.
Introduce new policies and managed rule upgrades in Detection mode, collect representative production traffic, and investigate matches before enabling Prevention mode. Detection mode provides visibility rather than blocking protection. Tune false positives with narrowly scoped exclusions, exceptions, or rule overrides instead of broadly disabling inspection. Custom rules run before managed rules, so review allow rules carefully because they can bypass subsequent evaluation. Test sign-in, uploads, API requests, and administrative workflows after every material policy change.
Configure rate limits to reduce scraping, repeated login attempts, and request floods, while accounting for legitimate clients that share public IP addresses. Enable supported bot protection when automated traffic is a concern. Review request body inspection and size settings against application requirements; inspection limits and supported controls differ between platforms and rule set versions. WAF is not an API schema validator or a substitute for application-level quotas and authorization.
Prevent attackers from bypassing inspection by restricting direct access to application origins. For Front Door, use supported private origin connectivity where appropriate, or combine network restrictions with validation of the expected Front Door instance. Export diagnostic logs to Azure Monitor and correlate them with access logs and application telemetry. Configure sensitive-data scrubbing where supported, retain a known-good policy for rollback, and verify enforcement and logging after regional failover. For public regional endpoints, evaluate Azure DDoS Protection separately because WAF does not replace network-layer DDoS protection.