The Simplest Way to Make GCP Secret Manager and Microsoft Entra ID Work Like They Should
Integrating gcp secret manager and microsoft entra id lets users fetch cloud secrets with work logins. This setup ties secret reads to human identities and stops teams from sharing static keys. Most companies run apps on Google Cloud while keeping their staff directory in Microsoft. Bridging these two tools removes the need to manage two separate sets of user accounts. Engineers log in once through Microsoft and read only the Google Cloud secrets their job needs. Security teams can turn off sec
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.
Integrating gcp secret manager and microsoft entra id lets users fetch cloud secrets with work logins. This setup ties secret reads to human identities and stops teams from sharing static keys.
Most companies run apps on Google Cloud while keeping their staff directory in Microsoft. Bridging these two tools removes the need to manage two separate sets of user accounts. Engineers log in once through Microsoft and read only the Google Cloud secrets their job needs. Security teams can turn off secret reads in one central place when a person leaves.
How gcp secret manager and microsoft entra id work together
The link between gcp secret manager and microsoft entra id starts with identity federation. You set up Microsoft as the trusted identity source for your Google Cloud workspace. When an engineer logs in, Microsoft checks their password and two-factor prompt first.
After a clean login, Microsoft sends a signed identity token over to Google Cloud. Google Cloud reads the user email and group names inside that signed token. Next, Google Cloud maps those Microsoft groups to specific roles in its own system.
When an engineer or app asks for a secret, Google checks the mapped role. If the role allows secret reads, the vault sends the secret value back. If the role lacks permission, the vault blocks the read request right away.
Every login and secret fetch writes an entry to your central cloud audit logs. Those logs show the exact Microsoft user account that asked for each secret key. Auditors can trace a database password read back to a real person in seconds.
Common failure modes and how to scope roles
Many teams set up the identity bridge well but fail on role scoping. The most common mistake is granting secret read rights at the whole project level. A broad project role lets one user read every secret inside that cloud project. If an attacker steals one user session, they can dump all project secrets fast.
Another common trap is falling back to shared service account keys for scripts. Teams often create a static JSON key when federated login feels too hard to script. Those static keys end up on laptops, in chat rooms, and inside build servers. Once a static key leaks, anyone can read secrets without passing a Microsoft check.
GCP Secret Manager + Microsoft Entra ID (Azure AD): architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged secret reads also create big blind spots during a security review. If data access logs are off in Google Cloud, you only see login events. You will know someone logged in, but not which secrets they opened.
To fix this, bind Microsoft groups to single secrets instead of whole projects. Create small groups in Microsoft that match specific app teams or job tasks. Give each group read rights only to the three or four secrets they need. Give admin rights to a separate group so builders cannot edit their own permissions.
Keeping secret usage safe after the fetch
Identity federation solves how a user proves who they are to the vault. Still, a serious risk starts the moment a user downloads a raw secret value. Once an engineer copies a database password to their laptop, central tracking stops.
The engineer can paste that password into any local client to run queries. Your Microsoft logs will not show what tables they read with that password. Your Google Cloud logs will only show that they fetched the secret hours ago.
To close this gap, pair tight secret roles with strict query and masking rules. Data masking rewrites matched fields like emails, phone numbers, card numbers, and national IDs in results. This keeps sensitive fields safe even when an engineer has valid database permissions.
You should also require fresh logins and short group assignments for production tasks. When an engineer finishes a task, remove them from the active Microsoft group. Short group memberships shrink the time window where an account can fetch production secrets.
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
Do engineers still need static Google Cloud keys with this setup?
No, engineers do not need static keys on their laptops anymore. They log in with their Microsoft work account to get short tokens instead.
What happens in Google Cloud when we disable a user in Microsoft?
Disabling the user in Microsoft stops them from getting new login tokens right away. Once their active token expires, Google Cloud blocks all new secret reads.
How do we restrict a Microsoft group to one single secret?
Attach the group role directly on the individual secret resource inside Google Cloud. Never attach secret reader roles at the broad folder or project level.
Related guides
In this post