The Simplest Way to Make Cloud SQL and Opslevel Work Like They Should
You link cloud sql and opslevel to track database ownership and readiness in one catalog. This setup lets teams map every managed database instance to the service that owns it. Platform teams need a clear view of every database in production. An internal developer portal tracks services, owners, and maturity standards. A managed database runs the actual workloads and stores customer records. When you pair them, teams know who owns each database instance. They can also verify if that database me
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.
You link cloud sql and opslevel to track database ownership and readiness in one catalog. This setup lets teams map every managed database instance to the service that owns it.
Platform teams need a clear view of every database in production. An internal developer portal tracks services, owners, and maturity standards. A managed database runs the actual workloads and stores customer records. When you pair them, teams know who owns each database instance. They can also verify if that database meets security rules.
How cloud sql and opslevel share metadata and roles
The developer portal reads metadata about your cloud resources to build a service catalog. It does not need full read rights to the tables inside your database. Instead, it checks resource tags, ownership labels, and basic setup facts. You should separate catalog metadata checks from actual database query rights.
Inside Google Cloud SQL for PostgreSQL, role design works differently than self-hosted databases. It is a managed service, so customers cannot create users with true superuser attributes. A Google-managed system user named cloudsqladmin holds the actual superuser privileges. Customers cannot delete or modify these system roles or users.
Instead, admins use the cloudsqlsuperuser role for high-level database tasks. This role can create extensions, event triggers, and replication users. The default postgres admin user belongs to this group. It has rights to create roles, create databases, and log in. Still, it comes without a password, so you must set one before logging in. It also lacks true superuser or replication attributes.
Common failure modes with shared accounts and broad tokens
Many teams make mistakes when they link their service catalog to database workflows. A common failure mode is using the default postgres user for automated portal checks. Teams share this single password across multiple scripts and catalog jobs. If that key leaks, an attacker gains broad control over database schemas and roles.
Broad API tokens create another major risk. Teams often grant wide cloud project roles to the portal integration account. This gives a simple catalog tool the power to change network rules or delete instances. You should scope the integration role to read-only cloud metadata instead.
End-to-End Encryption + SQL Query Filtering: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged queries also cause problems during incidents. Engineers often jump from a service catalog page straight into a database console. If everyone logs in with the same shared admin account, audit logs lose value. You can see that a query ran, but you cannot see which person ran it.
Scoping database roles and network paths
To fix these issues, give every workflow and user a tight role. Create a dedicated read-only cloud role just for catalog synchronization. That role should only read instance labels and state, never table data. Keep the cloudsqlsuperuser role locked down for rare schema setup tasks.
Next, lock down the network path to the database. Do not expose database ports to the public internet for easy catalog checks. Keep the database on a private network. Make sure both automated checks and human engineers follow strict identity rules before they connect. Also, use data masking to rewrite sensitive fields like emails, phone numbers, and card numbers in query results.
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 OpsLevel need direct SQL access to my Cloud SQL tables?
No, a service catalog only needs cloud metadata to track ownership and maturity. You should grant it read-only cloud API rights rather than direct database login credentials.
Can I give my automation tools a true PostgreSQL superuser role in Cloud SQL?
No, customers cannot create or use true superuser accounts in this managed service. The highest customer role is cloudsqlsuperuser, while the system reserves cloudsqladmin for itself.
How should engineers run queries when they find a database in the catalog?
Engineers should never share the default postgres password to run ad-hoc queries. Each engineer should log in with their own identity so every query links to a real person.
Related guides
In this post