Azure Front Door WAF rate-limit behind NAT

Pantelis, Vasilis 1 Reputation point
2022-03-30T09:52:31.163+00:00

Hello,

I was researching Azure FrontDoor rate-limiting capabilities and as far as I can tell rate-limiting happens on an IP level, ie: when an IP surpasses the limit set for a given threshold it's blocked from calling the backend for a certain amount of time (I think 1 minute by default, not sure if that's configurable at all).

My question is, if the offending client is behind a NAT network (a corporate network for example), then the whole network and all other clients in it are also rate-limited. Is there a way in Azure FrontDoor WAF to set the rate-limit for that client only? For example, is there a way to rate limit depending on a header value or some way to differentiate the offending client from all the other clients behind the same network and IP?

Thank you,
Vasilis

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
677 questions
Azure Web Application Firewall
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. GitaraniSharma-MSFT 49,591 Reputation points Microsoft Employee
    2022-03-31T12:41:10.023+00:00

    Hello @Pantelis, Vasilis ,

    Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.

    I understand that you would like to know if there is a way to rate limit on Azure Front Door WAF depending on a header value or some way to differentiate the offending client from all the other clients sitting behind NAT?

    It should be possible.
    As documented in our documentation,

    Rate limits can be combined with additional match conditions such as HTTP(S) parameter matches for granular rate control.

    So, you can combine the rate limit rules with HTTP/HTTPS request parameters such as query strings, POST args, Request URI, Request Header, and Request Body.

    Refer the below doc on how to configure a WAF rate limit rule using Azure PowerShell & linking it to Azure Front Door:
    https://video2.skills-academy.com/en-us/azure/web-application-firewall/afds/waf-front-door-rate-limit-powershell?toc=/azure/frontdoor/toc.json

    From Azure Portal, you can configure the same WAF policies --> custom policies --> Add custom rule as below:

    188715-image.png

    In the match conditions, you can configure "matchVariable": "RequestHeader".
    Refer the below article for how to define the HTTP match parameters:
    https://video2.skills-academy.com/en-us/azure/web-application-firewall/afds/waf-front-door-custom-rules#waf-custom-rules-example-based-on-http-parameters

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

    ----------------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


Your answer

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