The Simplest Way to Make GCP Secret Manager and Metabase Work Like They Should
Teams pair gcp secret manager and metabase to store database keys and run charts. This setup pulls stored credentials at startup so analysts can query data. Data teams want fast charts without leaving plain passwords in app files. Storing database credentials in a cloud vault keeps those strings out of code. The analytics app reads the secret when it boots up. Then it opens a pool of database sessions for the whole team. How gcp secret manager and metabase share keys and data The workflow st
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 pair gcp secret manager and metabase to store database keys and run charts. This setup pulls stored credentials at startup so analysts can query data.
Data teams want fast charts without leaving plain passwords in app files. Storing database credentials in a cloud vault keeps those strings out of code. The analytics app reads the secret when it boots up. Then it opens a pool of database sessions for the whole team.
How gcp secret manager and metabase share keys and data
The workflow starts inside your Google Cloud project. You store the database password or service key in the secret vault. Next, you give the app host an identity role in Google Cloud. That role lets the host read only the specific secret it needs.
When the analytics container starts, a startup script fetches the secret value. The script passes that password into the app runtime variables. The analytics app uses those variables to log in to its own state database. Teams also use cloud secrets to store keys for data warehouses.
Once the app starts, users log in through their normal single sign-on provider. They pick a dataset and run reports in their browser. The app sends those queries to the database over the network. The database checks the shared password and returns the rows to the app.
Common failure modes with shared service accounts
The secret vault solves password storage, but runtime risks still remain. The analytics tool usually logs in to the warehouse with one shared account. Every chart and SQL query runs under that single database user. When fifty people run queries, the database sees only one account name.
This shared account makes audit logs hard to read during an incident. You cannot tell which user ran a slow or broad query from database logs. Teams often give that single service account wide read permissions across all tables. Then anyone with SQL access in the tool can read raw tables.
GCP Secret Manager + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Raw tables often hold private data like emails, phone numbers, and card numbers. If a user writes a direct query, those fields show up in results. Secret rotation also takes extra work in this setup. When you update a password in the vault, the app does not know right away.
You often have to restart the app container to pull the new secret. Or a human admin must paste the new password into the admin settings page. If someone forgets to update the app, charts break across the company.
How to scope roles and network paths
You can fix many of these issues by tightening roles on both sides. First, give the app host a strict role in Google Cloud. It should read only the single secret made for the analytics tool. Never give the app host permission to list or read all project secrets.
Second, split your database accounts by team or data level. Create separate read-only database roles for finance, product, and support data. Store a unique password for each role in your cloud secret vault. Then set up separate database entries inside the analytics tool for each group.
Third, lock down the network path between the app and the database. Put both systems inside a private network and block public traffic. Use firewall rules so only the analytics host IP can reach the database port. Finally, set alerts on your secret vault logs to watch for odd reads.
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 Metabase pull database passwords directly from Google Cloud?
The app does not fetch vault secrets for target databases on its own. Your host startup script pulls the secret and sets runtime variables at boot.
What happens when you rotate a secret in Google Cloud?
Adding a new secret version does not update active database pools right away. You must restart the app task or update the database settings to load it.
How can teams limit what data analysts read in SQL queries?
Create read-only database roles that only have permission to read specific views. Pair those roles with data masking that rewrites emails and card numbers in results.
Related guides
In this post