Cloud SQL instances should use private IP addresses only
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-ipApplying 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
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Google Cloud Platform Foundation v5.0.0 | 6.7 | Level 2 |
Go further
- CIS Google Cloud Platform Foundation v5.0.093 controls
- CIS Google Cloud Platform Foundation checklistEvery control in one list, as CSV
- RemediationSee what a fix changes in your tenant before you apply it, then use the generated script
- Monitoring & DriftScheduled scans, drift detection and email alerts when a control regresses
Check this on your Google Cloud
ConfigCobra runs this check with every other control of the CIS Google Cloud Platform Foundation Benchmark, read-only.