Check ID: compute_instance_public_ip
Provider: GCP
Service: compute
Severity: HIGH
Categories: internet-exposed
Resource type: compute.googleapis.com/Instance

What this check verifies

Compute Engine VM instances with an assigned external (public) IP address on any network interface are identified. Instances without an external IP are considered internal-only.

Risk

Internet-exposed VMs face automated scanning, brute force, and remote exploit attempts. Compromise can enable data exfiltration, service account abuse, and lateral movement within the VPC, while public endpoints invite DDoS, degrading availability.

Recommendation

Adopt private-only VMs and remove external IPs.
  • Place workloads behind load balancers or reverse proxies
  • Use Cloud NAT for egress; admin access via IAP, VPN, or a hardened bastion
  • Apply least privilege firewall rules and network segmentation for defense in depth

Remediation

gcloud compute instances delete-access-config <example_resource_name> --access-config-name="External NAT" --zone=<example_resource_zone>

References

Where this check fires

This check runs on every scheduled scan against your GCP account. Findings appear at Cloud Security → Findings filterable by Check ID = compute_instance_public_ip. 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 GCP checks