The Simplest Way to Make Active Directory and GCP Secret Manager Work Like They Should
Teams pair active directory and gcp secret manager to tie domain users to cloud secrets. This setup lets staff use one corporate login to fetch stored keys for daily work. Many firms store user groups in a domain controller while apps run in Google Cloud. Linking these two systems stops teams from making separate cloud logins for each person. When a person joins or leaves a group, their cloud permissions update right away. This cuts down on stale accounts and keeps secret rules in one central p
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 active directory and gcp secret manager to tie domain users to cloud secrets. This setup lets staff use one corporate login to fetch stored keys for daily work.
Many firms store user groups in a domain controller while apps run in Google Cloud. Linking these two systems stops teams from making separate cloud logins for each person. When a person joins or leaves a group, their cloud permissions update right away. This cuts down on stale accounts and keeps secret rules in one central place.
How active directory and gcp secret manager share identity data
The workflow starts inside your domain controller where admins organize staff into security groups. A sync tool pushes these user accounts and group lists to Google Cloud identity services. The sync tool only sends profile names and group links, never raw domain passwords. When an engineer logs in, Google Cloud checks their status with the domain server.
Once the user logs in, Google Cloud checks the group rules for the secret store. Admins bind domain security groups to specific cloud roles at the project or secret level. A group might have permission to read one database key but not edit it. Another group might only view secret versions for a test app during work hours.
When an app or user asks for a secret, the cloud checks that role binding. If the group matches the rule, the store returns the secret payload over an encrypted link. Google Cloud then writes an entry to the central audit log with the user name. This log shows who read which secret and when the request took place.
Common failure modes and how to scope roles
A common mistake is using one shared service account for a whole engineering team. Teams often put a static cloud key on a shared server to save setup time. When everyone uses the same account, the audit logs cannot show which person read a key. If someone leaves the firm, you must rotate that shared key across every tool.
Broad group permissions cause another major risk between the domain and the cloud store. Admins sometimes grant secret read rights at the top folder level for all staff. That rule lets any domain user read production keys for databases they do not own. Instead, teams should bind small domain groups to single secrets rather than whole projects.
GCP Secret Manager + Active Directory: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Sync lags between the domain server and the cloud also create security gaps during offboarding. If the sync runs once a day, a removed user keeps their cloud permissions for hours. Set up fast group syncs and force short login sessions for all human users. You should also turn on data read logs in Google Cloud to track every secret fetch.
Keeping fetched secrets safe during database sessions
Even with tight group rules, a user still gets the raw secret on their laptop. Once a developer copies a database password, cloud logs cannot see what queries they run. That password can sit in shell history files or local config files for months. Teams need a way to use stored secrets without handing raw keys to staff.
You also want to protect sensitive fields inside the database once a session starts. Standard secret tools only guard the login step and ignore the data returned by queries. Adding data masking in the session path rewrites emails, phone numbers, and card numbers in results. This step keeps customer data safe while engineers debug live issues.
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 Google Cloud store our domain passwords during sync?
You can set up federated login so the domain server checks all user passwords. In that setup, Google Cloud only receives a signed login token and group names.
How do we stop one group from reading all cloud secrets?
Assign permissions on each individual secret resource instead of the parent cloud project. Map small domain groups to single secrets so teams only read keys for their own apps.
What happens when we remove a user from Active Directory?
The sync tool marks the cloud user as suspended on its next scheduled run. For faster lockouts, revoke active cloud login tokens as part of your offboarding script.
Related guides
In this post