IP Groups association with WAF

Natarajan, Raja 0 Reputation points
2025-11-25T07:07:23.2+00:00

I want to block dynamic bulk malicious IPs in all Application Gateways which is associated with WAF. I need solution like using IP Group, so that I call this IP Group in one custom rule to match IPs which is being added/removed.

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

1 answer

Sort by: Most helpful
  1. Thanmayi Godithi 2,215 Reputation points Microsoft External Staff Moderator
    2025-11-25T07:44:36.7433333+00:00

    Hi @Natarajan, Raja,

    Thank you for reaching out on Microsoft Q&A forum.

    I understand that you want a solution to block malicious IPs using Azure Web Application Firewall (WAF) on Application Gateway.

    Currently, Azure Web Application Firewall (WAF) policies do not support a dedicated "IP Group" resource that you can dynamically reference in custom rules for blocking malicious IPs. Instead, WAF custom rules allow you to specify IP addresses or CIDR ranges directly in match conditions to block or allow traffic. This means you need to list out IP addresses or IP ranges explicitly within the custom rule.

    User's image

    You can create custom rules with the IPMatch operator on the RemoteAddr or SocketAddr variable, specifying CIDR-formatted IP ranges to match and block malicious IPs. However, there is a limit on the number of IP ranges per match condition (typically around 600), so this approach works best for a moderate number of IPs.

    Refer: https://learn.microsoft.com/en-us/answers/questions/1329570/azure-waf-limitationsUser's imageRefer: https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/custom-waf-rules-overview#match-variable-required

    Besides manually adding IP ranges, Azure WAF provides managed rule sets you can enable to block known malicious traffic patterns automatically. These managed rules cover common vulnerabilities and attack vectors without the need to specify IPs.

    Additionally, there is an Anomaly Scoring mode in Azure WAF that evaluates request patterns and blocks based on suspicious activity, which can help with dynamic protection beyond static IP blocking.

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

    Thanks,

    Thanmayi

    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.