How to block China and Russia IP address ranges from my VM?

GNB 20 Reputation points
2023-04-03T17:44:24.7566667+00:00

Without incurring any additional subscription costs for firewall services (beyond our existing core B2s subscription), how can we block all IP address ranges from China and Russia from accessing my Azure VM? We're not running an e-commerce site and only need to allow access to US IP address ranges.

Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
787 questions
Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,218 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dillon Silzer 57,831 Reputation points Volunteer Moderator
    2023-04-03T18:47:19.2333333+00:00

    Hi GNB, This is not possible with the basic Azure VM (Networking NSG) function. This is a function that allows you to create inbound and outbound rules with limitations. Unfortunately, what you will need is:

    Geomatch custom rules

    https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/geomatch-custom-rules

    Create and use Web Application Firewall v2 custom rules on Application Gateway

    https://learn.microsoft.com/en-us/azure/web-application-firewall/ag/create-custom-waf-rules

    Understanding Pricing for Azure Application Gateway and Web Application Firewall https://learn.microsoft.com/en-us/azure/application-gateway/understanding-pricing If this is helpful please accept answer.


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.