Azure WAF - Replication of Request flagged by Microsoft Default Ruleset

Gerald Tan 0 Reputation points
2025-11-26T02:13:48.3066667+00:00

Hi All,

Seeking for guidance on how i can replicate the request sent into the AGW that is triggering the Microsoft_DefaultRuleSet.

I have replicated using the same RequestURI and the Body but my request triggered from Postman does not trigger any of the rules from Microsoft_DefaultRuleSet

Alternatively am i able to exclude these rules based on RequestURI and or ClientIP ?

User's image

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
{count} votes

1 answer

Sort by: Most helpful
  1. Thanmayi Godithi 2,215 Reputation points Microsoft External Staff Moderator
    2025-11-26T05:14:58.9933333+00:00

    Hi @Gerald Tan,

    Thanks for reaching out on Microsoft Q&A forum.

    I understand that you want to replicate the requests flagged by Microsoft Default Ruleset.

    Even if you reuse the same RequestURI and body, the original WAF match might depend on additional factors such as:

    • HTTP method, headers (for example User-Agent, cookies, custom headers), or query-string parameters.​
    • Encodings or special characters (URL encoding, JSON structure, multipart form data).​
    • The exact Microsoft Default Rule Set version and specific rule ID that was triggered.​

    To accurately replicate the request:

    1.Check the WAF logs (ApplicationGatewayFirewallLog) for the original event and note:

    • Rule set and version (for example, Microsoft_DefaultRuleSet_2.1 or similar).
    • Rule ID and rule group.
    • Matched variable (RequestUri, RequestBody, RequestHeader, etc.).
    • Full request details (method, URI, query string, headers, body).​
    • Web Application Firewall DRS and CRS rule groups and rules

    2.Rebuild the request in Postman to match all of those details.

    There are two main approaches, depending on what exactly you want to exclude.

    1.Exclude specific request attributes for certain rules (recommended when possible):

    • In your WAF policy, go to “Managed rules” → “Add exclusions”.
    • Choose the rule set and rule(s) to apply the exclusion to (for example, the specific MDRS rule ID that is firing).
    • Configure exclusions based on supported match variables such as:Request header name/value, Request cookie name/value,Request attribute name (form field, JSON property, query-string parameter)
    • These exclusions are attribute-based, not URI/IP-based.
    • Web Application Firewall exclusion lists

    2.Use a custom rule to bypass MDRS for certain URIs or IPs:

    • Create a custom WAF rule in the same WAF policy with:
    • Match variable: RequestUri (for example, “Contains” or “BeginsWith” “/your/path”).
    • Or match variable: RemoteAddr for a specific client IP or range.
      • Action: Allow.
    • Custom rules are evaluated before the managed rules; if the custom rule matches and allows, MDRS rules are not evaluated for that request.
    • Exclude/exempt specific IP from WAF managed rules

    In this way you can exempt specific RequestURI patterns or client IPs from managed rule processing, even though MDRS itself does not allow you to attach exclusions directly to ClientIP or RequestURI.​

    Kindly let us know if the above helps or you need further assistance on this issue.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".


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.