Network Interface should not have a public IP address

High Azure General networkinterfaces-network-interface-public-address

Applies to

  • Microsoft.Network/networkInterfaces

What CGPulse checks

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

How to fix it

Remove the public IP and use Azure Bastion, VPN, or a load balancer for secure access. In Azure Portal: NIC > IP configurations > dissociate public IP. See: https://learn.microsoft.com/en-us/azure/virtual-network/ip-services/remove-public-ip-address-vm

Careful: Removing the public IP disconnects direct internet access. Ensure alternative access methods (Bastion, VPN) are configured first

CLI

az network nic ip-config update --ids "{id}/ipConfigurations/ipconfig1" --remove publicIpAddress

Terraform

resource "azurerm_network_interface" "{name}" {
  name                = "{name}"
  resource_group_name = "{rg}"
  location            = var.location
  ip_configuration {
    name                          = "ipconfig1"
    subnet_id                     = var.subnet_id
    private_ip_address_allocation = "Dynamic"
    # No public_ip_address_id — removes public IP
  }
}

Compliance frameworks

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.