The Simplest Way to Make Cloud SQL and F5 Work Like They Should
Teams use cloud sql and f5 together to route app traffic into managed databases. F5 handles network load and traffic rules while Cloud SQL stores your core data. This pair helps engineering teams scale database reads and control network paths across clouds. You get stable network paths from F5 and managed database backups from Google Cloud. Yet putting them together requires clear rules for network paths and database roles. Without careful limits, network access and shared accounts can expose
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Teams use cloud sql and f5 together to route app traffic into managed databases. F5 handles network load and traffic rules while Cloud SQL stores your core data.
This pair helps engineering teams scale database reads and control network paths across clouds. You get stable network paths from F5 and managed database backups from Google Cloud.
Yet putting them together requires clear rules for network paths and database roles. Without careful limits, network access and shared accounts can expose private data.
How cloud sql and f5 handle network traffic and logins
In a standard setup, F5 sits at the network edge or inside your private network. It takes incoming traffic from your apps and routes packets to backend targets.
Cloud SQL runs inside a Google Cloud network and listens on a private IP address. F5 forwards database traffic over a peered network or VPN tunnel to that IP.
Notice that F5 directs the network packets, while Cloud SQL checks the database login. You still must manage who can log in to the database engine itself.
Cloud SQL for PostgreSQL is a managed service with strict limits on admin accounts. Customers cannot create or use database accounts that hold full superuser rights.
A Google system account called cloudsqladmin holds the actual superuser rights on the instance. Customers cannot delete or change these built-in system roles or users.
Instead, you assign the cloudsqlsuperuser role to your top database admins. This role lets admins create extensions, event triggers, and replication users.
The default postgres admin user belongs to this role and can create roles and databases. It starts with no password, so you must set one before you log in.
It also lacks true superuser and replication attributes by design. Knowing these role limits helps you plan how apps log in through F5.
End-to-End Encryption + SQL Query Filtering: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Common failure modes and how to scope roles
Many teams make the mistake of trusting network rules alone to protect data. Once F5 has a network path to the database, any allowed app can reach it.
If an app uses the default postgres account, it gets way too much power. That account can create new roles and databases, which a normal app never needs.
Shared service accounts also make audit logs hard to read during an incident. When ten developers share one login through F5, you cannot see who ran a query.
Unlogged queries and broad database permissions put sensitive fields like emails and phone numbers at risk. A single bad query can dump card numbers or national IDs without clear user tracking.
To fix this, split your network routing rules from your database role design. Set up F5 so only specific app servers can reach the Cloud SQL private IP.
Do not let human users route directly through the same F5 virtual server as apps. Next, create narrow database roles inside Cloud SQL for each separate app.
Give read-only apps a role that can only select data from approved tables. Reserve the cloudsqlsuperuser role for setup tasks, and never put it in app configs.
Securing human database sessions and sensitive data
App traffic through F5 follows predictable patterns, but human database access is very different. Engineers need to run ad-hoc queries to check data and fix bugs.
Opening a direct network path on F5 for engineer laptops creates a wide attack surface. You also have to hand out database passwords that stay valid for too long.
A better pattern maps each engineer to their own identity before a query runs. You also want to log every statement and mask sensitive fields in query results.
When data masking rewrites emails or card numbers in results, engineers can still debug issues safely. This keeps your database clean and gives security teams clear logs of every action.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Does F5 replace database role checks in Cloud SQL?
No, F5 manages network traffic and routing to your database IP address. Cloud SQL still checks the database user and role before running any query.
Can I give an F5 health check user superuser rights in Cloud SQL?
No, customers cannot create true superuser accounts in Cloud SQL for PostgreSQL. Use a dedicated user with minimal login rights for network health checks instead.
How do I stop shared logins when routing through F5?
Create separate database roles for each app instead of sharing the default postgres user. For human users, link database sessions to individual work identities and log every query.
Related guides
In this post