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".