Azure WAF best practice for specific rules

Eddie Vincent 205 Reputation points
2025-09-18T15:17:19.12+00:00

Hi,

Looking for some very specific help regarding Azure Web application rules.

Some URI'S are hitting various WAF rules within the OWASP Ruleset (using version 3.2 currently) and I am looking to exclude these from those specific rules (2 in question being hit) can the ruleset/rules in question be changed specifically for selected URI's? and if yes what is the best method to achieve this?Excluding the URI in question looks like a fairly broad option (I have successfully achieved this with a custom rule) however it seems as if a mixture of the two rule types (OWASP and Custom) is needed for this specific requirement, any advise would be appreciated.

Note: I am aware that the OWASP ruleset has an update pending however all information I have currently found suggests that upgrading would not effect this behaviour.

Thanks!!

Azure Web Application Firewall
{count} votes

1 answer

Sort by: Most helpful
  1. Praveen Bandaru 8,770 Reputation points Microsoft External Staff Moderator
    2025-10-17T12:07:48.5033333+00:00

    Hello Eddie Vincent
    I understand you're interested in creating a custom rule in the Azure Application Gateway WAF using PowerShell. Please refer to the following documents for more details:

    https://free.blessedness.top/en-us/azure/web-application-firewall/ag/configure-waf-custom-rules

    https://free.blessedness.top/en-us/azure/web-application-firewall/ag/create-custom-waf-rules

    If you want to block a specific custom response code or body in the WAF policy settings, you can use the following resource:

    https://free.blessedness.top/en-us/azure/web-application-firewall/ag/configure-custom-response-code

    You can also configure single rules directly through the portal. If you need to deny a specific request body, please review the relevant scenario in the documentation and let me know your results.

    User's image Based on your requirements, you can implement custom rules to block specific IP addresses by entering the IP address in the match variable field. Geo location-based blocking is also possible.

    If a default rule is blocking something in your environment and you want to allow it, you can use the exclusion option.

    check the below document:

    https://free.blessedness.top/en-us/azure/web-application-firewall/ag/application-gateway-waf-configuration?tabs=portal


    Hope the above answer helps! Please let us know do you have any further queries.

    Please do not forget to “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.