Compute instances should not have public IP addresses¶
Compute Engine instances should not have public IP addresses to reduce potential attack surfaces, as public IPs enable direct access via the internet. Instances serving internet traffic should be configured behind load balancers, which provide an additional layer of security.
Google Cloud Console¶
Navigate to VM instances.
Click on the instance name to go to the VM instance details page.
For each Network interface, ensure that External IP is set to None.
Click Done and then click Save.
Describe the Compute Engine instance properties:
gcloud compute instances describe INSTANCE_NAME --zone=ZONE
Identify the access config name that contains the external IP address, and then delete the access config:
gcloud compute instances delete-access-config INSTANCE_NAME --zone=ZONE -- access-config-name "ACCESS_CONFIG_NAME"