Is It Safe to Use 'Any' Protocol in Azure NSG Rules?

June 5, 2025 4 answers
Asked by brick by brick
Hey everyone! I'm diving into Azure Network Security Groups (NSGs) and I've got some questions about setting rules properly. Is it a no-go to use 'Any' protocol in inbound rules for specific ports? Also, why do we sometimes see rules like '65001 AllowinternetOutbound Any Any Any Destination="Internet"'? That seems a bit risky to me. I'd love to hear your thoughts and any real-life examples you might have. Thanks!

Answers

PAGE_breaks_here
Iโ€™m dealing with this too, especially in a large environment. My focus has been on port restrictions for inbound traffic by creating individual NSGs per subnet, and then routing outbound through a load balancer to firewalls. For now, Iโ€™ve had to allow 'Any' for outbound, but it's certainly on my agenda to tighten those rules later on.

3 paws on patrol: I totally get that! Outbound rules can get complicated because not all apps document their necessary outgoing ports. Keeping an eye on outgoing traffic and adjusting NSGs accordingly can really help.

Reply to this answer
two-stage-filter
Definitely avoid using 'Any' when you can. Good practice is all about being explicit with rules while not making management overly difficult. It's important to have a clear security strategy in place.
Reply to this answer
hazelnut shell
In our experience, each subnet typically has its own NSG. By default, outbound rules are open, while inbound rules tend to be more controlled. This setup allows internal communication while still providing room to implement stricter security if needed. It's all about tailoring it to your organizationโ€™s specific needs.
Reply to this answer
-just-out-of-frame
Allowing 'Any' protocol is generally a bad idea. The principle of least privilege suggests that rules should be specific to grant just enough access for whatโ€™s necessary. While it's tempting to keep things simple, balancing security with convenience is tricky. Many organizations end up using more permissive rules for outbound traffic, which can lead to vulnerabilities.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions