Check ID: network_ssh_internet_access_restricted
Provider: Azure
Service: network
Severity: HIGH
Categories: internet-exposed
Resource type: microsoft.network/networksecuritygroups

What this check verifies

Azure NSG inbound rules that allow SSH on TCP 22 from 0.0.0.0/0, Internet, or * are identified, including rules where port ranges include 22 and protocol is TCP or *. Indicates NSGs exposing SSH to the Internet.

Risk

Public SSH access weakens confidentiality and integrity. Open 22 invites brute force and key theft, enabling remote shell control, persistence, and lateral movement. Attackers can pivot into VNets, exfiltrate data, deploy crypto-miners, and impact availability.

Recommendation

Apply least privilege on SSH:
  • Remove public rules to TCP 22 from 0.0.0.0/0
  • Allowlist specific admin IPs or management subnets
  • Prefer Azure Bastion, JIT access, or VPN/ExpressRoute for admin
  • Use key-based auth, disable passwords, and remove unnecessary public IPs
Adopt defense in depth with logging and periodic reviews.

Remediation

az network nsg rule delete —resource-group <RESOURCE_GROUP> —nsg-name <NSG_NAME> —name <RULE_NAME>

References

Where this check fires

This check runs on every scheduled scan against your Azure account. Findings appear at Cloud Security → Findings filterable by Check ID = network_ssh_internet_access_restricted. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to Azure checks