Google Cloud Secret Manager

Published
Length
3 min read

Luis Felipe Dias

All posts

Google cloud secret manager is a tool that stores keys, passwords, and certificates in one safe place. You set it up by making a secret container, adding a version, and giving out IAM roles. Most teams use this tool to keep plain text keys out of code files. When teams give out broad roles to save time, too many people can read production passwords. Once an engineer or app reads that password, the secret store cannot control how they use it. How google cloud secret manager works in your setup

GCP Secret Manager: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

Google cloud secret manager is a tool that stores keys, passwords, and certificates in one safe place. You set it up by making a secret container, adding a version, and giving out IAM roles. Most teams use this tool to keep plain text keys out of code files. When teams give out broad roles to save time, too many people can read production passwords. Once an engineer or app reads that password, the secret store cannot control how they use it.

How google cloud secret manager works in your setup

The tool splits each secret into two main parts. The first part is the named container that holds settings and rules. The second part is the secret version that holds the actual password text. When you change a password, you add a new version to the same container. Your apps can ask for the newest version or a fixed version number. This design helps teams roll back to an old key if a new one breaks an app.

Google Cloud IAM controls who can view or change each secret container. You can grant roles at the project level or on a single secret. A metadata role lets someone see that a secret exists without reading the password text. An accessor role lets an app or user pull the raw password value. Cloud Audit Logs record every time a user or service account asks for a secret version. You can also set up rotation alerts that ping a topic on a set schedule.

What the native secret store solves and what it misses

Storing passwords in a central cloud tool stops teams from putting keys in source code. It also gives security teams a clear log of who fetched which key and when. Encryption at rest keeps the stored versions safe inside the cloud project. Version tracking makes key updates much cleaner for automated build pipelines and cloud apps.

Still, a secret store only guards the password while it sits in the vault. Once an engineer fetches a database password, they can log in directly from a laptop. After that login happens, the secret store has no view into the live session. It cannot see which queries run or which tables the user reads. It cannot rewrite sensitive fields like emails, phone numbers, card numbers, or national IDs in query results. If an engineer runs a bad command, IAM logs only show that they read the password earlier. Also, a shared database password gives everyone who fetches it the exact same database rights.

GCP Secret Manager: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Best ways to tighten secret roles and rotation

Start by giving each app its own service account and its own secret role. Do not grant secret accessor roles at the broad project or folder level. Grant permissions on the single secret that the specific app needs to run. Separate the role that creates secret containers from the role that reads secret versions. Keep human users out of production secret accessor groups whenever you can.

Set up automated rotation so passwords change on a fixed schedule without manual work. Disable old secret versions right after your apps switch to the new version. Watch your audit logs for unusual spikes in secret read calls from human accounts. Turn on destroy protection or check retention rules before anyone deletes an old version.

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 sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses 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

What is the difference between a secret and a secret version?

A secret is the top container that holds the name, labels, and IAM policy rules. A secret version holds the actual password string, and you add a new version to rotate it.

How do you stop everyone in a project from reading a secret?

Avoid granting secret reader roles at the project level to broad team groups. Bind the accessor role directly to the individual secret for only the specific service account that needs it.

Does rotating a secret cut off active database sessions?

No, adding a new secret version only updates the stored value in the cloud vault. You must also update the target database password and close existing sessions to cut off old logins.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.