How to Configure Firestore Revoke Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up firestore revoke access by removing cloud roles and updating database rules. You must also cancel active user tokens and delete old service account keys. Most teams manage database rights through cloud roles and client security rules. Broad roles let engineers read or delete production documents by mistake. A lost key or active token also keeps working until someone cancels it. How firestore revoke access works in the cloud Firestore uses two main ways to control who reads or write

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.

You set up firestore revoke access by removing cloud roles and updating database rules. You must also cancel active user tokens and delete old service account keys. Most teams manage database rights through cloud roles and client security rules. Broad roles let engineers read or delete production documents by mistake. A lost key or active token also keeps working until someone cancels it.

How firestore revoke access works in the cloud

Firestore uses two main ways to control who reads or writes data. Client apps use security rules and identity tokens to talk to the database. Backend servers and engineers use cloud roles and service account keys instead. When someone leaves the team, you must check both paths right away.

First, remove the user from your cloud project roles. This stops them from opening the cloud console or running admin tools. Next, check your service accounts for any downloaded key files. If a user had a key file on their laptop, delete that key. Deleting the key stops any local scripts from talking to the database.

For client apps, removing a user does not stop their current token right away. Identity tokens stay valid until their timer runs out. You can use the admin tool to cancel a user's refresh tokens. Then you update your security rules to check when the token was cancelled. If a request uses an old token, the security rule blocks the read.

Why role changes take time to take effect

Cloud role changes do not always stop active work in the same second. The cloud system caches role data for a short window to stay fast. During that window, an open session might still run a few reads or writes. The same problem happens with client identity tokens that last for an hour.

Long-lived service account keys create an even bigger risk for teams. Engineers often share these keys in local files to test code fast. When one engineer moves to a new team, rotating that shared key breaks apps. So teams often leave the old key active for months. This means the former team member still holds full rights to the data.

Customer Support Access to Production: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native controls solve and what they miss

Cloud roles and security rules do a good job of blocking outside users. They let you decide which account can log in to the project. They also help you block whole collections from client apps.

Still, these native tools only check who logs in at the start. They do not inspect what each query or update does in flight. An engineer with a valid role can still pull a whole collection of data. Native roles also do not rewrite sensitive fields like emails or phone numbers. If a user has read rights, the database sends back every field in full.

Audit logs can tell you that a bad write happened after the fact. They cannot pause a dangerous delete command before it runs. Teams also have to revoke roles by hand across many projects. Without a central way to check each query, wide roles remain a daily risk.

Add runtime guardrails and masking beside your databases and APIs

Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.

Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.

Frequently asked questions

How do I stop a leaked service account key right away?

Go to your cloud console and delete the specific key ID from the account. Any script or app using that key will fail to log in soon after.

Why can a user still read data after I revoke their token?

Short-lived tokens stay active until they expire on their own. You must add a check in your database security rules to block revoked tokens.

Does removing a cloud role stop active database sessions?

Removing a role stops new logins and blocks console access. Due to cloud caching, an open session may work for a few more minutes.

The query runs. The emails stay hidden.