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 publicIpAddressTerraform
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.
Related Azure rules
- Action Group should be enabled
- Activity Log Alert should be enabled
- AKS cluster logs should be sent to Log Analytics
- AKS cluster must enable RBAC
- AKS cluster must enable RBAC
- AKS cluster should be a private cluster
- AKS cluster should disable local accounts
- AKS cluster should enable Azure RBAC for Kubernetes