Azure network security group open to the whole internet
A network security group (NSG) is Azure's firewall for subnets and NICs. An inbound rule with source 'Any' / 0.0.0.0/0 / the 'Internet' service tag makes the port reachable from every address online.
Why it matters
Azure IP ranges are scanned continuously. Management ports left open — SSH (22), RDP (3389), WinRM (5985/5986) — are brute-forced within minutes of becoming reachable.
A single Allow rule with a lower priority than your Deny rules silently wins, so an exposure can hide behind what looks like a locked-down NSG.
How to check for it
- In the portal, open each NSG → Inbound security rules and look for Source 'Any' or 'Internet' on anything but 80/443.
- az network nsg rule list -g <rg> --nsg-name <nsg> --query "[?access=='Allow' && (sourceAddressPrefix=='*' || sourceAddressPrefix=='0.0.0.0/0' || sourceAddressPrefix=='Internet')]".
How to fix it
- Change the rule's source to your office/VPN CIDR or an application security group; never leave admin ports open to Internet.
- Reach VMs through Azure Bastion instead of a public RDP/SSH port, and delete the public rule.
SkyShield checks this automatically
Connect your AWS, Cloudflare, GitHub, GitLab, Hetzner or DigitalOcean account read-only and SkyShield flags this across every account and region, with the fix in plain words — alongside the agent that watches your servers. Start free.
FAQ
- Is the 'Internet' service tag the same as 0.0.0.0/0?
- Effectively yes for inbound exposure — it matches any public IP address, so an Allow rule using it is open to the whole internet.