Cloud SQL Networking: Public IP, Private IP, and the Auth Proxy

GCP Study Hub
May 16, 2026

Connecting to a Cloud SQL instance comes down to a few networking choices that control who can reach the database and how that traffic is secured. The Professional Cloud Database Engineer exam tends to test the differences between these options, because several of them overlap in what they do but carry different security tradeoffs. The pieces worth knowing are the Cloud SQL Auth Proxy, the authorized networks setting, and the choice between a public IP and a private IP. Getting these straight makes most connectivity questions easier to reason through.

The Cloud SQL Auth Proxy

The Cloud SQL Auth Proxy is a secure method for connecting applications and users to Cloud SQL databases. Rather than opening the database to the network and managing IP ranges by hand, the proxy uses IAM-based authentication to control which services can connect to the instance. That means access is governed by identity and permissions instead of by network location.

The proxy gives you a few things at once. It ensures the connection between your application and the Cloud SQL instance is encrypted, protecting the data in transit. It hides the IP of the Cloud SQL instance from everyone else, which prevents direct access attempts against the database. And it works with both service accounts and user identities through IAM. For access management specifically, the proxy relies on the cloudsql.instances.connect permission. A service account that needs to reach the instance through the Auth Proxy has to be granted that permission, or the connection will not be authorized.

The flow is straightforward. Picture an application running on Google Kubernetes Engine, though it could be any application on any service or environment. The application sends its requests through the Cloud SQL Auth Proxy, which is configured to handle all connectivity to the instance. The proxy works together with Cloud IAM to manage authentication and permissions, so only authorized services or users holding cloudsql.instances.connect get through. Once that check passes, the proxy establishes a secure, encrypted connection to the Cloud SQL instance. The application can then interact with the database without exposing the database's IP or requiring direct network access.

Authorized networks

The authorized networks setting is the other way to control who can reach a Cloud SQL instance. It restricts access by IP range, so only traffic from the IP addresses you list can reach the database. This is network-level access control rather than identity-based control.

There are two points here that come up often. The first is how authorized networks relates to the Auth Proxy. When you are using the Cloud SQL Auth Proxy, you can leave the authorized networks section blank. The proxy handles the secure connection for you, so there is no need to specify IP ranges manually. The two are not meant to be configured in parallel for the same access path.

The second point is a configuration to avoid. Do not add 0.0.0.0/0 to authorized networks. That range exposes the instance to the entire internet, which is a significant security risk unless you have additional layers of security in place, such as a proxy or IAM controls. On its own it should be strictly avoided.

Public IP versus private IP

A Cloud SQL instance can be reached over a public, external IP or a private, internal IP. As a best practice, we would generally lean toward a private IP over a public one. Keeping traffic on a private, internal IP keeps it off the public internet, which reduces the surface for unauthorized network access and gives the instance a stronger security posture. Choosing private IP is one of the simplest ways to limit who can even attempt to reach the database at the network level.

This connects back to the earlier settings. Public IP combined with a wide-open authorized networks range is the configuration that exposes a database the most, while private IP and the Auth Proxy together represent the more defensive setup. When a question asks how to reduce unauthorized network access to a Cloud SQL instance, preferring private IP is usually the answer the Professional Cloud Database Engineer exam is looking for.

Connection pools

One related topic that sits alongside networking is connection pooling. A connection pool maintains a cache of reusable database connections. Instead of creating a new connection every time a user makes a request, the system checks one out from the pool and returns it when the task is done. That reduces connection overhead, improves request latency, and keeps the database from being overwhelmed by connection management. The application sends its requests through the connection pool rather than opening a direct session each time, and the pool maintains established paths to Cloud SQL.

For the exam, it helps to know that Cloud SQL has built-in connection pools, and that is likely to appear as the correct option in a scenario. ProxySQL and PgBouncer are external open source tools for connection pooling that may also show up as choices, so it is worth recognizing them, but the built-in option is the one to expect as the answer.

Our Professional Cloud Database Engineer course covers Cloud SQL networking alongside IAM-based access and connection pooling, with practice questions that drill these distinctions.

Get tips and updates from GCP Study Hub

arrow