The Simplest Way to Make Active Directory and BigQuery Work Like They Should
Integrating active directory and bigquery lets teams log in to cloud data with directory groups. This setup syncs user accounts and maps them to database roles for daily queries. Data teams need fast access to analytics tables without managing separate passwords. Directory admins want one place to add or remove staff members. Linking these two systems gives both teams what they need. When a user leaves the company, disabling their directory profile stops their database access. How active dire
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 active directory and bigquery lets teams log in to cloud data with directory groups. This setup syncs user accounts and maps them to database roles for daily queries.
Data teams need fast access to analytics tables without managing separate passwords. Directory admins want one place to add or remove staff members. Linking these two systems gives both teams what they need. When a user leaves the company, disabling their directory profile stops their database access.
How active directory and bigquery share user roles
The link between your directory and Google Cloud starts with user sync. A sync tool copies user names and groups from your local directory to the cloud. It does not copy passwords if you use single sign-on. Instead, Google Cloud trusts your directory to check who the user is.
When an analyst wants to run a query, they log in first. Google Cloud sends the login request back to your directory server. Your server checks the password and sends back a signed token. This token lists the user identity and their group names.
Next, Google Cloud checks its IAM rules for those specific group names. Admins bind directory groups to dataset roles inside the cloud project. For example, a finance group gets read rights on billing tables. A data engineering group gets write rights on staging datasets. The database checks these rules before it runs any SQL command.
Common failure modes with shared keys and broad groups
Many teams hit roadblocks when they connect external apps or local scripts. Desktop tools often struggle with browser login flows. To fix this fast, engineers create service accounts and download static JSON keys. They share these key files across the team or put them on shared servers.
Shared service keys break the link back to a single person. When five analysts use one key, the audit log shows only the service account. You cannot tell which person ran an expensive or harmful query. Worse, static keys do not expire unless an admin deletes them by hand.
Active Directory + BigQuery IAM: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Broad directory groups cause another major risk in large companies. Over time, staff move between teams and keep their old group memberships. If an old group maps to a full project role, users keep wide rights. They can read private tables across the whole cloud project.
Unlogged queries and raw data exposure create more risk for security teams. Analysts often query tables that hold emails, phone numbers, or card numbers. Standard role checks are all or nothing at the table or column level. If a user has read rights, the query returns the full raw text.
Scoping permissions and network paths for safer queries
To keep data safe, stop using project-level roles for directory groups. Map each directory group to a single dataset or table instead. Create clean groups just for data access rather than reusing old email lists. Review group members every month to remove people who changed jobs.
Replace downloaded JSON key files with short-lived tokens tied to real users. Require every person to log in with their own directory account before running scripts. Set up private network paths so query traffic stays off the public internet. Use data masking rules so queries rewrite emails and national IDs in results.
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
How long does it take for directory group changes to reach BigQuery?
Sync times depend on your directory sync schedule and cloud cache rules. Most group updates take effect within a few minutes to an hour.
Can we control BigQuery access without syncing passwords to Google Cloud?
Yes, you can set up federated single sign-on with your directory server. Your directory checks the password locally and sends a signed token to Google Cloud.
Why do service account keys weaken Active Directory security controls?
Service account keys bypass directory logins and do not tie actions to one person. Anyone who copies the key file can run queries even after leaving the team.
Related guides
In this post