NSG vs Firewall

Handian Sudianto 6,096 Reputation points
2023-09-08T03:12:43.67+00:00

Hello,

If our vnet using NSG and Firewall and i need to block some internet access from azure VM, should i make an rule in NSG or Azure Firewall?

Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
779 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,762 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 124.9K Reputation points Volunteer Moderator
    2023-09-08T04:08:54.5066667+00:00

    Hi,

    That depends on exactly how you need/want to block the access and possibly your preference. Some ways of blocking access are not possible using NSG, so of course in one of those cases you would need to use Firewall.

    For example, say you wanted to block HTTP/S access to a list of 50 different FQDNs (*.domain1.com, *.domain2.com, etc.). In this case you would use Azure Firewall since NSG doesn't allow you to block at the Application Layer.

    On the other hand, say you wanted to block outgoing port 25 (SMTP). You could do this using NSG, or via Azure Firewall, or both. My preference (in this example) would be to block it via NSG so that Azure Firewall doesn't need to process the traffic.

    One thing to know is Azure Firewall can essentially do everything NSG can, plus more. Assuming all Internet traffic is flowing through Azure Firewall you could have it do all blocking if you wanted to.

    Please click Accept Answer if the above was helpful

    Thanks.

    -TP


0 additional answers

Sort by: Most helpful

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.