How to Configure Spanner Revoke Access
To set up spanner revoke access, remove cloud IAM bindings and drop fine-grained database roles. You must check both the cloud project level and the database level. Most teams start by granting broad database roles to get apps running fast. Over time, those broad roles let users read or change far too much data. When an engineer changes teams, old rights often stay active by mistake. How native spanner revoke access works Google Cloud Spanner controls user rights through two separate layers o
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.
To set up spanner revoke access, remove cloud IAM bindings and drop fine-grained database roles. You must check both the cloud project level and the database level. Most teams start by granting broad database roles to get apps running fast. Over time, those broad roles let users read or change far too much data. When an engineer changes teams, old rights often stay active by mistake.
How native spanner revoke access works
Google Cloud Spanner controls user rights through two separate layers of rules. The first layer is cloud IAM, which sets rules for the whole database. The second layer is fine-grained access control, which works inside the database itself. To run a full spanner revoke access workflow, you must check both places.
At the cloud layer, admins grant roles to users, groups, or service accounts. These bindings sit at the project, instance, or database level in the cloud. If you remove a user at the database level, project rules may still apply. Inherited roles from higher folders or projects will still let that user log in. You must trace the full folder path to find every active role binding.
Inside the database, fine-grained roles control who can read or write specific tables. Admins use standard role statements to pull back permissions from a database role. They also revoke the database role from the specific cloud user or group. Both layers must match, or the user might keep unintended rights to read data.
Where role removal falls short in daily work
Native role removal works well when someone leaves the company or changes jobs. It stops a user from starting new sessions once the cloud rules update. Still, role changes are too slow and blunt for daily support tasks.
Engineers often need temporary rights to fix a broken app in production. Granting a cloud role and revoking it later takes manual tracking and time. If someone forgets to remove the role, the user keeps permanent production rights. Also, cloud roles decide who can log in, not what queries they run. While a role is active, a user can run a broad read query. That query can return sensitive fields like emails, phone numbers, and card numbers. Native role revocation cannot rewrite those sensitive fields in query results during a session.
Customer Support Access to Production: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Why cached sessions delay role changes
Removing a role in the cloud console does not always stop active sessions right away. Cloud IAM changes take time to spread across every node in the system. Active database sessions may keep running until the client refreshes its auth token.
Shared service accounts make this problem much harder for security teams to fix. Many teams still let multiple engineers or apps share one service account key. If you revoke a role from that shared account, you break other working apps. If you rotate the key, you must update every app that uses it. Teams need a way to control each user action without breaking shared setups. They also need clear logs showing which person ran each statement and when.
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
How do I remove a user from a Spanner database right away?
Remove their IAM role binding at the database, instance, and project levels. If you use fine-grained roles, drop their user mapping from the database role too.
Why can a user still read data after I remove their database role?
They likely inherit a broader role from the cloud project or folder level. Check the full IAM policy tree for group memberships or inherited reader roles.
What is the difference between IAM revocation and fine-grained role revocation?
IAM revocation stops a user from reaching the whole database instance or project. Fine-grained revocation removes rights to specific tables, views, or columns inside the database.
Related guides
In this post