Check ID: cloudsql_instance_private_ip_assignment
Provider: GCP
Service: cloudsql
Severity: HIGH
Categories: internet-exposed
Resource type: sqladmin.googleapis.com/Instance

What this check verifies

Cloud SQL instances are evaluated for IP assignment, highlighting instances that have any public IP instead of being restricted to private IP only.

Risk

Public database endpoints expose services to Internet scanning, brute-force logins, and exploit attempts. A compromise can cause data exfiltration (confidentiality), unauthorized changes (integrity), and outages or DDoS impact (availability), while bypassing VPC isolation and enabling lateral movement.

Recommendation

Use private IP-only connectivity for databases. Remove public IPs, segment access to required VPCs/subnets, and enforce least privilege with strong auth and TLS. For external access, use secure private channels (VPN/Interconnect) or a hardened bastion. Monitor connections as part of defense in depth.

Remediation

gcloud beta sql instances patch <example_resource_id> --project=<example_project_id> --network=projects/<example_project_id>/global/networks/<example_resource_name> --no-assign-ip

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 = cloudsql_instance_private_ip_assignment. 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