Skip to main content
Five Steps for Cloud Compliance Readiness·A practical playbook for security teamsDownload
CIS Google Cloud Platform Foundation v5.0.0 · 6.7

Cloud SQL instances should use private IP addresses only

  • Level 2
  • Cloud SQL

This check looks at whether each Cloud SQL instance has a public IPv4 address assigned. The safe setting is private IP only, so the instance is reachable just from your VPC network.

Why it matters

A Cloud SQL instance with a public IP address can receive connection attempts from the internet. Authorized networks and SSL settings can limit who gets in, but the database is still a reachable target, and a mistake in those settings can expose it widely. An instance with private IP only is reachable through your VPC network, which keeps database traffic off the public internet.

Google describes the private option in Configure private IP in the Cloud SQL documentation.

How to check it yourself

In the Google Cloud console open SQL, select an instance and view Overview > Connect to this instance; a Public IP address entry means one is assigned. To list all instances in a project, run this read-only command:

gcloud sql instances list \
  --project=<project-id> \
  --format="yaml(name,ipAddresses)"

Instances whose address types include PRIMARY have a public address; PRIVATE alone is the safe state. The command only lists instances.

How to fix it

First make sure private services access is set up for the VPC network and that the instance has a private IP. In the console choose Edit on the instance, open Connections, tick Private IP and select the network, save, then clear Public IP and save again. With gcloud:

gcloud sql instances patch <instance-name> \
  --network=projects/<project-id>/global/networks/<network-name> \
  --no-assign-ip

Applying the change can restart the instance, so schedule it. ConfigCobra itself uses read-only access and never changes your project; these steps are yours to run.

What changes when you fix it

Everything that connects through the public address stops working: developers on laptops, external tools, applications hosted outside Google Cloud and anything using an authorized-networks entry. Those clients need a private path, such as the Cloud SQL Auth Proxy running inside the VPC, a VPN, or Cloud Interconnect. Applications already inside the same VPC keep working with the private address. Expect a short restart while the change applies and update connection strings that used the old public address. ConfigCobra's remediation impact analysis lists affected resources and identities for a failing control before you apply the fix.

Included in

BenchmarkCIS IDProfile
CIS Google Cloud Platform Foundation v5.0.06.7Level 2

Check this on your Google Cloud

ConfigCobra runs this check with every other control of the CIS Google Cloud Platform Foundation Benchmark, read-only.

Get in touch

Let's talk.

Whether you're evaluating ConfigCobra, running an audit, or managing a client fleet — we respond within one business day.

Free trial