Analyze Azure Network Security Group rules for security issues and best practices.
Last verified: April 2026
Output will appear here...Azure Network Security Groups (NSGs) filter traffic to and from Azure resources within a virtual network using priority-based rules that are evaluated in order from lowest to highest number. Unlike AWS security groups, NSGs support both allow and deny rules, and rule priority conflicts can produce unexpected behavior where a lower-priority allow is overridden by a higher-priority deny or vice versa. This linter analyzes your NSG rules for common security issues including unrestricted inbound access from the Internet service tag, overly broad port ranges, conflicting rules at different priorities, and missing deny-all rules at the end of your rule set.
After a security assessment flags your Azure environment, you need to audit 34 NSGs across 3 subscriptions. Running them through the linter reveals 7 rules allowing RDP from the Internet service tag — leftover from when the team was troubleshooting a connectivity issue three months ago. It also catches a priority conflict where rule 200 (Allow SSH from VNet) is overridden by rule 150 (Deny all inbound from VNet) that someone added without realizing the priority implications.
NSG rules applied at the subnet level and NIC level are evaluated cumulatively — both must allow the traffic. A common gotcha is adding a permissive subnet NSG but forgetting that the NIC-level NSG still blocks the traffic. Always check both levels when troubleshooting connectivity issues.
Unlike AWS Security Groups, Azure NSG priority numbers determine which rule wins. Leave gaps between priorities (use 100, 200, 300 instead of 100, 101, 102) so you can insert exception rules later without renumbering. Teams that use sequential priorities inevitably need a painful reordering when a new rule needs to go between two existing ones.
Application Security Groups (ASGs) are Azure's answer to managing NSG rules at scale. Instead of maintaining IP-based rules that break when VMs scale or get new IPs, assign VMs to ASGs and reference those groups in NSG rules. The linter flags IP-based rules that could be simplified with ASGs.
The linter parses each NSG rule and evaluates it against a severity-weighted rule set. It checks source and destination addresses against risky patterns (Internet service tag, 0.0.0.0/0, *), validates port ranges for sensitive services (SSH/22, RDP/3389, database ports), detects priority conflicts where a higher-priority deny overrides a lower-priority allow (or vice versa), and verifies that a deny-all rule exists at the end of the rule chain. Each finding includes the rule priority, direction, and a specific remediation recommendation.
Was this tool helpful?
Disclaimer: This tool runs entirely in your browser. No data is sent to our servers. Always verify outputs before using them in production. AWS, Azure, and GCP are trademarks of their respective owners.