NSG must not allow RDP from Internet

Critical Azure General nsg-nsg-allow-rdp-from

Applies to

  • Microsoft.Network/networkSecurityGroups

What CGPulse checks

A resource passes this rule when allowsRdpFromInternet must equal false. Anything else is reported as a finding with the evaluated property value attached as evidence.

How to fix it

Restrict RDP (port 3389) access to specific IP ranges to prevent brute-force attacks. In Azure Portal: NSG > Inbound security rules > restrict RDP source IPs. See: https://learn.microsoft.com/en-us/azure/virtual-network/network-security-groups-overview

Careful: Removing RDP rules may break remote access. Ensure VPN or Azure Bastion is configured first

CLI

az network nsg rule list --nsg-name {name} -g {rg} -o table

Terraform

resource "azurerm_network_security_rule" "deny_rdp_internet" {
  name                        = "deny-rdp-from-internet"
  priority                    = 101
  direction                   = "Inbound"
  access                      = "Deny"
  protocol                    = "Tcp"
  destination_port_range      = "3389"
  source_address_prefix       = "Internet"
  destination_address_prefix  = "*"
  source_port_range           = "*"
  resource_group_name         = "{rg}"
  network_security_group_name = "{name}"
}

Compliance frameworks

Vendor documentation

Is your environment compliant with this rule?

CGPulse checks it — and 621 others — against your Azure and AWS accounts with read-only access.

Run a free scan

Related Azure rules

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.