The Simplest Way to Make Cloud SQL and Windows Server 2019 Work Like They Should
Running cloud sql and windows server 2019 together lets Windows apps use managed databases. Your server hosts the app code while Google manages the database backups and updates. Many teams move old Windows apps to the cloud in steps. They keep the app on Windows Server 2019 and move data to Cloud SQL. This setup saves time for the team. Still, it can create gaps in how users log in and run queries. If you do not plan roles well, one bad password leaks all your data. How cloud sql and windows
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.
Running cloud sql and windows server 2019 together lets Windows apps use managed databases. Your server hosts the app code while Google manages the database backups and updates.
Many teams move old Windows apps to the cloud in steps. They keep the app on Windows Server 2019 and move data to Cloud SQL. This setup saves time for the team. Still, it can create gaps in how users log in and run queries. If you do not plan roles well, one bad password leaks all your data.
How cloud sql and windows server 2019 share data and logins
A Windows Server 2019 host runs background services, scheduled tasks, or web apps. These apps open network links to the Cloud SQL database to read and write data. You must set up both systems so they trust each other over the network.
Cloud SQL is a managed service, so customers cannot create true superuser accounts. A Google system user named cloudsqladmin holds the real superuser rights on the database. Customers cannot delete or change these built-in system roles at all.
Instead, you get a default admin user named postgres. This user is created without a password, so you must set one before logging in. It belongs to the cloudsqlsuperuser role, which gives it some special admin rights. For example, this role can create extensions, event triggers, and replication users. The default postgres user can also create roles, create databases, and log in. Still, it does not have true superuser or replication attributes.
When your Windows Server 2019 app logs in, it should never use the postgres account. You should use the postgres account only to set up smaller, safer database roles. Then, give your Windows app a role that only reads or writes specific tables.
Common risks with shared accounts and wide network paths
The biggest risk in this setup is a shared database login on the Windows host. Teams often put one strong database password inside a text file on Windows Server 2019. Every app and engineer on that server then uses that same login. If an engineer logs into Windows and runs a bad query, the logs blame the app. You cannot tell which human actually ran the command.
Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Giving the Windows app the cloudsqlsuperuser role is another common mistake. If an attacker breaks into the Windows server, they can control the whole database. They can drop tables, read all customer rows, or change event triggers. Always create a narrow database user for each Windows service instead.
You also need to lock down the network path between the two machines. Do not open your database to the public internet with wide firewall rules. Place the Windows Server 2019 host and the database on a private network path. Set your firewall rules so only the specific Windows host IP can reach the database port.
Scoping roles and protecting sensitive fields
Human users on Windows Server 2019 need different rules than background apps. Engineers often log into the Windows box to check app errors or test data. They should not use the app login file to check the database. Give each engineer their own database role with read-only rights for daily checks.
Even with read-only roles, raw tables often hold private data like emails and phone numbers. Database results can also show card numbers or national IDs during basic checks. Data masking helps here by rewriting matched fields in query results before they reach the screen. This lets engineers fix app bugs on Windows without exposing raw customer details.
Finally, make sure you log every query and role change on the database. Review which accounts create new roles or add extensions using cloudsqlsuperuser privileges. Good logs and strict roles keep your Windows and database pair safe every day.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Does the default postgres user have full superuser rights in Cloud SQL?
No, customers cannot get true superuser accounts in this managed service. The postgres user belongs to cloudsqlsuperuser, which gives limited admin rights like creating extensions.
Should my Windows Server 2019 app log in with the cloudsqlsuperuser role?
No, that role has too much power and can change database triggers and users. Create a separate database user with only the table rights your Windows app needs.
Why can I not log in with the default postgres account right away?
The default postgres user is created without a password for safety. You must set a password for it before you can use it to log in.
Related guides
In this post