The Simplest Way to Make Active Directory and Firestore Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair active directory and firestore by linking Windows groups to Google Cloud roles. This setup lets developers read and write document data using their corporate login. Active Directory holds your user accounts and team groups. Firestore stores your app data as collections and documents in Google Cloud. When you link them, you do not need separate database passwords. Your staff logs in once and gets the right database permissions. How active directory and firestore share identity and d

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 firestore by linking Windows groups to Google Cloud roles. This setup lets developers read and write document data using their corporate login.

Active Directory holds your user accounts and team groups. Firestore stores your app data as collections and documents in Google Cloud. When you link them, you do not need separate database passwords. Your staff logs in once and gets the right database permissions.

How active directory and firestore share identity and data

Active Directory cannot talk to Firestore on its own. You must link your directory to Google Cloud Identity first. A sync tool copies your users and groups into Google Cloud. Then, your login server sends a signed token during sign-in.

Google Cloud checks this token against your synced groups. After that, Google Cloud Identity and Access Management takes over. It matches the user group to a specific Firestore role. A developer might get read permissions for a staging database. A production app gets write permissions for live collections.

Firestore checks these permissions before it runs any query. If the role matches, Firestore returns the requested documents. If the role fails the check, Firestore blocks the read or write. Your directory stays the single source of truth for the whole team.

Common failure modes and how to scope roles

Many teams take shortcuts when they set up database permissions. They create one shared service account key for the whole engineering team. Developers download this key file to their laptops to run local queries. This creates a huge security risk for your company.

Shared keys do not expire unless someone deletes them by hand. If a developer leaves the company, they might still have the key. Worse, your audit logs only show the shared service account name. You cannot tell which person ran a bad delete query.

Active Directory + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Broad roles cause another common problem between these two systems. Google Cloud roles apply to the whole Firestore database by default. You cannot use basic cloud roles to lock down a single collection. Give a developer a broad editor role, and they can read everything. That database might hold emails, phone numbers, card numbers, or national IDs.

To fix this, stop handing out static service account keys to people. Force every engineer to log in through their own directory account. Map specific Active Directory groups to narrow Google Cloud roles. Give read-only roles to most staff for production data.

Next, lock down the network path to your cloud project. Use private network rules so only trusted office networks can reach Firestore. Turn on data read and write logs in Google Cloud. Check these logs often to spot strange queries or role changes. Remove users from directory groups as soon as they change teams.

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

Can Firestore read Active Directory groups on its own?

No, Firestore cannot read Windows directory groups directly. You must sync your groups to Google Cloud Identity first. Then you map those synced groups to cloud roles.

How do we stop developers from sharing service account keys?

Turn off service account key creation in your cloud policy settings. Make developers log in with their own corporate directory accounts instead. Use short session tokens for all local work.

How do we protect sensitive fields inside Firestore documents?

Cloud roles apply to whole databases, not single document fields. To protect emails or card numbers, split sensitive data into separate collections. You can also use data masking to rewrite matched fields in results.

The query runs. The emails stay hidden.