The database was wide open to the public internet. Nobody knew until the bill spiked and the logs told the truth.
Securing database access on Google Cloud Platform is not just about setting a strong password or limiting SQL commands. When traffic routes through an External Load Balancer, the attack surface changes. Requests may appear from shared IPs, health checks may be treated as valid connections, and firewall rules might accidentally expose sensitive endpoints.
An External Load Balancer decouples clients from backend services, but if the database is downstream without proper controls, anyone who reaches the balancer might reach the database. GCP provides multiple layers to fix this:
- Private IP configuration so that the database is only reachable inside your VPC.
- IAM database authentication to limit access by identity, not just by network.
- Serverless VPC Access when bridging from Cloud Run or Functions to a private database.
- Network firewall rules tightly scoped to the load balancer’s proxy-only subnet instead of open ranges.
TLS should terminate as close to the database as possible. If the External Load Balancer handles TLS, make sure the hop between the load balancer and the database remains encrypted. Use Cloud SQL's SSL configuration or configure client certificates for self-managed instances.