Skip to content
tempkey ← Back to blog

Tempkey Blog

How to Manage Contractor Access to Google Cloud BigQuery Without Over-Sharing Data

Learn how to give contractors the BigQuery access they need, scope it to the right datasets, and make sure it disappears when the engagement ends.

To safely grant an external analyst or freelance engineer access to your data warehouse, you need to configure access at the dataset or view layer rather than the Google Cloud project layer. Learning how to manage contractor access to google cloud bigquery ensures your business shares only the specific records required for the job while protecting sensitive customer records, financial tables, and infrastructure billing.

Data exposure and compliance issues with external vendors frequently stem from operational oversight rather than sophisticated exploits—often because an administrator assigned an overly broad role for convenience and forgot to revoke it when the contract concluded. Applying principled bigquery iam for contractors paired with strict expiry timelines gives outside specialists the access they need without creating long-term operational liabilities.

Start With the Data, Not the Person

Google Cloud BigQuery structures its permission boundaries across three distinct hierarchical tiers: the organization or project level, the dataset level, and the individual table or view level. Following the principle of least privilege, a practical rule when learning how to manage contractor access to google cloud bigquery is to configure permissions at the dataset or view tier rather than at the project tier whenever those scopes fulfill the engagement requirements.

Before modifying identity policies in your Google Cloud console, map the specific engagement requirements. Determine exactly what questions the contractor is hired to answer, which underlying tables hold those data points, and whether the analyst needs access to production schemas or curated reporting subsets. For instance, if an analytics contractor is auditing marketing campaign performance, they do not need visibility into your core transaction logs, billing ledgers, or customer authentication tables.

Evaluate these three architectural boundaries before touching permissions:

  • Project Level: Best reserved for core internal infrastructure engineers. Applying roles here exposes metadata and compute defaults across every dataset housed within the Google Cloud project.
  • Dataset Level: The standard boundary for external analytics engagements. You grant read permissions on a specific logical container (such as marketing_marts) without exposing sibling datasets (like billing_internal or pii_vault).
  • Table or View Level: Necessary when a single dataset contains a mix of public aggregates and restricted columns. Using views lets you restrict external visibility down to curated rows or columns without duplicating base tables.

Next, define the technical actions the contractor must perform. In data operations, permissions broadly divide into three capabilities: reading stored data, executing queries (consuming compute slots), and creating or altering tables. Most contract analysts need read permissions on specific tables and compute rights to execute queries, but they rarely need authorization to modify table schemas, export data to external cloud buckets, or delete storage partitions.

Finally, establish an explicit end date before provisioning credentials. Unrestricted, open-ended grants frequently lead to dormant accounts lingering in cloud environments. Document this end date in your project ticket, tracking spreadsheet, or centralized contractor access management checklist before any IAM binding is committed.

Choose the Right BigQuery IAM Role for a Contractor

Assigning appropriate bigquery iam for contractors requires understanding how Google Cloud decouples data storage permissions from compute execution permissions. In BigQuery, having permission to read a table does not automatically grant the compute access required to run a query job against it.

Google Cloud provides several predefined roles for BigQuery, each designed for distinct operational profiles:

  • roles/bigquery.dataViewer: Allows the principal to view dataset contents, table schemas, and table data. This role contains read-only permissions and prevents any modification of underlying storage.
  • roles/bigquery.jobUser: Permits the principal to run query jobs, cancel their own running jobs, and enumerate their own job history inside a designated project, as specified in the Google Cloud BigQuery jobUser documentation. It does not grant read permissions to any tables on its own.
  • roles/bigquery.user: A composite role defined in the BigQuery user role reference that grants permissions to run jobs and create new datasets within the project. This is often overly broad for contractors because it allows them to allocate storage and spin up unmonitored datasets.
  • roles/bigquery.metadataViewer: Outlined in the BigQuery metadataViewer reference, this role lets the user inspect dataset configuration, schemas, and table layouts without reading the actual underlying records. This is ideal for initial scoping or architecture audits.
  • roles/bigquery.dataEditor: Detailed in the BigQuery dataEditor reference, this role permits editing table contents, appending rows, updating views, and truncating tables. This role should rarely be given to an external contractor unless their contractual scope specifically involves building data transformations.
  • roles/bigquery.admin: Documented in the BigQuery admin role reference, this role grants full administrative control over all BigQuery resources in the project, including the ability to delete datasets and alter access policies. Assigning this role to an external contractor is rarely advisable because it exposes project-wide access controls and lifecycle settings.

A common point of confusion for operations leads is the dual-permission requirement: if you assign roles/bigquery.dataViewer on a dataset, the contractor will still encounter permission-denied errors when running a query in the BigQuery console. To run a query, the contractor must also hold roles/bigquery.jobUser on a designated billing project. This architecture allows your company to isolate compute costs: you can grant compute rights in an isolated sandbox project while restricting data access to your analytical datasets.

To view the exhaustive list of specific permissions wrapped inside each predefined role, refer to the official Google Cloud IAM roles reference. If predefined roles do not align with your security posture, custom roles can be defined; however, small teams should weigh the ongoing maintenance overhead of updating custom role definitions against using tightly scoped predefined roles paired with dataset-level IAM.

Where supported, you can enforce time-based boundaries directly inside Google Cloud IAM bindings. Using Google Cloud IAM conditions allows you to specify an expiry timestamp on a role assignment. Once the timestamp passes, the Google Cloud policy evaluation engine automatically ignores the binding, preventing unauthorized querying even if manual offboarding steps are delayed.

Grant Access to a Dataset, Not the Whole Project

When managing contractor access to Google Cloud IAM roles, the most effective isolation technique is binding roles directly to target datasets. This prevents the contractor from listing or probing unauthorized datasets residing within the same Google Cloud project.

Dataset-Level Grant via the Google Cloud Console

To grant scoped dataset access using the console UI:

  1. Navigate to the BigQuery studio in the Google Cloud console.
  2. In the Explorer panel, locate and expand the dataset you need to share.
  3. Click the vertical three-dot menu next to the dataset name and select Share > Manage Permissions.
  4. Click Add Principal.
  5. Enter the contractor's email address or your dedicated contractor group address.
  6. Assign the role BigQuery Data Viewer (roles/bigquery.dataViewer).
  7. Save the binding.

Dataset-Level Grant via the gcloud CLI

For repeatable administration, you can update the access configuration using the bq or gcloud CLI tools. The bq show and bq update commands modify dataset access controls using JSON specifications:

# 1. Export current dataset access configuration
bq show --format=prettyjson my_project:analytics_marts > dataset_meta.json

# 2. Add contractor principal entry to the access array in dataset_meta.json:
# {
#   "role": "READER",
#   "userByEmail": "contractor.external@example.com"
# }

# 3. Update the dataset with the new policy
bq update --source dataset_meta.json my_project:analytics_marts

Terraform Infrastructure as Code

If your team manages Google Cloud infrastructure declaratively, use the google_bigquery_dataset_iam_member resource rather than the authoritative _binding or _policy resources. Using the member resource prevents accidentally overwriting pre-existing permissions granted to other services or colleagues:

resource "google_bigquery_dataset_iam_member" "contractor_data_viewer" {
  dataset_id = "analytics_marts"
  role       = "roles/bigquery.dataViewer"
  member     = "group:contractors-analytics@example.com"
}

resource "google_project_iam_member" "contractor_job_user" {
  project = "billing-compute-sandbox"
  role    = "roles/bigquery.jobUser"
  member  = "group:contractors-analytics@example.com"
}

Exposing Data Safely With Authorized Views

In many analytical engagements, base tables contain columns that contractors must not inspect, such as social security numbers, hashed passwords, internal cost metrics, or customer email addresses. Rather than duplicating tables into a separate staging dataset (which creates drift and synchronization lag), you can deploy authorized views.

An authorized view allows you to expose query results from a secured dataset to specific principals without granting those principals access to the underlying tables. Here is how you structure this pattern:

  1. Create a separate dataset, such as analytics_contractor_views.
  2. Create a SQL view inside that dataset that filters out sensitive columns:
    CREATE VIEW `my_project.analytics_contractor_views.orders_sanitized` AS
    SELECT 
        order_id, 
        order_date, 
        order_total_cents, 
        shipping_country
    FROM `my_project.analytics_private.orders`;
    
  3. Authorize the view inside the source dataset (analytics_private). This grants the view itself permission to read the underlying orders table.
  4. Grant the contractor roles/bigquery.dataViewer on the analytics_contractor_views dataset only.

The contractor can now query orders_sanitized successfully. If they attempt to query the underlying analytics_private.orders table directly, BigQuery will immediately reject the query with an access denied error.

Row-Level and Column-Level Security

When you cannot split schemas across multiple datasets, Google Cloud provides native security controls directly on table schemas:

  • Column-Level Security: Uses policy tags managed in Dataplex to restrict access to specific table columns based on taxonomy IAM roles. A contractor can execute a SELECT * query, but any column tagged with a restricted policy will return an authorization failure unless explicit tag reader access is provided.
  • Row-Level Security: Uses SQL-based access policies attached to the table (CREATE ROW ACCESS POLICY). This filters rows transparently based on session user identity, ensuring contractors only see data tagged for their specific client account or geographic assignment.

Use Groups, Service Accounts, and Identity Provider Controls

Operational complexity increases rapidly when you grant permissions to individual email addresses across various tools. Managing individual user bindings creates security blind spots when contracts conclude, as team members must remember every dataset, project, and service the individual touched.

To streamline external data access, implement a group-based architecture:

Manage Through Google Groups

Instead of applying IAM bindings directly to individual email accounts, map roles to a dedicated Google Group (for example, ext-contractor-analytics@yourcompany.com). When bringing an external analyst on board, configure access to the group via your Google Workspace group settings. When the engagement ends, removing the person from the group immediately revokes their downstream access across all BigQuery datasets and projects assigned to that group.

Identity Federation and Cloud Identity

Small teams often face a dilemma: should you pay for a full Google Workspace seat for a short-term contractor, or allow them to use their personal @gmail.com address? Giving direct permissions to personal Google addresses creates a governance issue: you cannot enforce company multi-factor authentication (MFA) policies, and you lack administrative oversight of the credential lifecycle.

A cost-effective solution is provisioning managed accounts using Cloud Identity Free tier, as outlined in the Google Cloud Identity pricing reference. This provides a managed identity under your domain (e.g., john.contractor@yourcompany.com) without incurring the license cost of a full Workspace productivity suite. You retain the ability to mandate hardware security keys or authenticator apps, suspend the account centrally, and inspect identity logs.

The Danger of Service Account Keys

Teams frequently hand JSON service account keys to contractors so they can connect external business intelligence tools, IDEs, or Python environments to BigQuery. This practice presents significant operational risk. According to the Google Cloud service account documentation, service accounts are designed for server-to-server automated workloads, not human authentication.

Service account keys are long-lived, static credentials that bypass multi-factor authentication. Once exported, a service account key poses a risk of credential leakage and can inadvertently end up stored in source code repositories or other insecure locations, according to Google Cloud documentation. If an analyst needs programmatic access, configure workforce identity federation or require them to authenticate via the Google Cloud CLI (gcloud auth application-default login) using their managed identity. If a service account must be used, enforce short-lived credentials via service account impersonation (roles/iam.serviceAccountTokenCreator) rather than downloading JSON keys.

For operations teams seeking time-delimited policies without maintaining group memberships manually, leveraging Google Cloud IAM conditions for contractor access enables you to attach temporal expiration expressions directly to IAM policy statements.

Set an Expiry Date and a Revocation Checklist

A defined engagement period is only as effective as the offboarding process that concludes it. Every contractor engagement should start with an agreed-upon expiration date registered in your team's operational tracking tools. Relying on memory or informal communication invariably leads to forgotten access grants that remain active months after the final invoice is paid.

To avoid lingering credentials, follow this step-by-step checklist whenever an analytical engagement ends:

  1. Revoke Dataset-Level IAM Roles: Remove the contractor's identity (or group) from all dataset-level roles/bigquery.dataViewer and custom role bindings.
  2. Revoke Project-Level Job Permissions: Remove the contractor from roles/bigquery.jobUser on your query billing projects. This prevents them from running queries against public datasets or cached internal results.
  3. Remove Identity from Access Groups: Remove the user's email from any Google Groups used to bridge dataset permissions.
  4. Audit Scheduled Queries: Open BigQuery > Scheduled Queries. Filter by the contractor's identity. If the contractor scheduled queries that run on their behalf, reassign the query ownership to an internal service account or administrator. Suspending a contractor's identity causes any queries scheduled under their credentials to fail immediately.
  5. Inspect Data Transfer Service Configurations: Check BigQuery Data Transfer Service jobs to ensure automated ingest tasks are not executing under the contractor's identity.
  6. Rotate Associated Service Account Keys: If the contractor was granted access to a service account, immediately delete the associated key pairs in the IAM console and generate new keys for internal services.
  7. Revoke Cloud Storage Export Buckets: If the contractor configured external data exports, verify and revoke permissions on any Google Cloud Storage (GCS) staging buckets used to hold query exports.

While manual checklists establish baseline discipline, fast-moving teams often find coordinating access removal across multiple dashboards difficult to scale. For teams managing external vendors across diverse software stacks, adopting automated access tools removes human error from the offboarding workflow.

Tempkey grants contractor access for a set period, revokes it automatically when the grant expires, reads provider state back to confirm the removal on natively enforced providers, and records each step in an exportable audit trail.

Verify the Revocation Actually Happened

Removing a user from an IAM console does not complete the offboarding loop. Human error, unexpected group inheritance, or caching artifacts can cause access to persist unintentionally. Proper offboarding requires verifying that credentials were fully neutralized.

First, inspect the effective IAM policy on both the dataset and the parent project. You can run the following gcloud command to confirm no residual bindings mention the principal:

gcloud projects get-iam-policy my-production-project \
    --flatten="bindings[].members" \
    --format="table(bindings.role)" \
    --filter="bindings.members:contractor.external@example.com"

If this command returns any roles, the identity still possesses active project privileges. Repeat this verification step for any dataset access lists that were touched during onboarding.

Second, review Google Cloud audit logs to confirm that query activity ceased at the conclusion of the contract. In Cloud Logging, run a query targeting BigQuery audit events associated with the contractor's principal identity:

protoPayload.serviceName="bigquery.googleapis.com"
protoPayload.authenticationInfo.principalEmail="contractor.external@example.com"
timestamp >= "2026-09-01T00:00:00Z"

If you see successful google.cloud.bigquery.v2.JobService.InsertJob or TableService.GetData API calls dated after the formal offboarding date, investigate immediately. This log pattern often points to a secondary service account key or a misconfigured, unmonitored group grant that is still active.

Third, check for indirect data exposure paths. A contractor might no longer have direct dataset permissions, but they could still access reports if internal teams embedded credentials within a Looker Studio report, Google Sheets dashboard, or shared analytics workspace. Confirm that their managed email account is removed from all shared Google Drive folders and visualization tools.

Document the completion of each verification step in your internal change logs. For deeper guidance on managing access lifecycles across Google services, see our guide on managing contractor access to Google Cloud Logging.

Keep a Record You Can Show an Auditor or Client

During enterprise client reviews, security assessments, or insurance underwriting evaluations, proving that your data access policies are enforced is just as critical as enforcing them. Auditors rarely accept informal verbal statements that access was revoked; they require timestamped evidence demonstrating when access was granted, who authorized it, what data scope was included, and the exact moment privileges were terminated.

Maintain an access log containing the following attributes for every external contributor:

Audit Field Operational Purpose Verification Source
Principal Identity Identifies the exact contractor account or managed email. Workspace Directory / Cloud Identity
Target Resource Scope Records the project, dataset, or view name shared. BigQuery IAM Dataset Policy
Assigned Roles Documents permission boundaries (e.g., Data Viewer vs Editor). IAM Policy Audit Record
Approving Manager Records the team lead accountable for authorizing the grant. Internal Ticketing System
Scheduled Expiration The contract end date established during onboarding. Contract Agreement / Work Order
Actual Revocation Timestamp Proves access was terminated promptly. Cloud Audit Logs
Post-Revocation Check Confirms read-back inspection showed zero active bindings. Offboarding Verification Sign-off

Tempkey gives you an exportable, append-only audit trail to support your own compliance and offboarding records. Tempkey does not hold SOC 2, ISO 27001, HIPAA, or PCI certification.

Common Pitfalls When Contractors Touch BigQuery

Operations teams routinely encounter the same failure modes when coordinating external BigQuery access. Knowing these pitfalls helps you safeguard your analytics infrastructure effectively:

1. Over-Privileging for Rapid Troubleshooting

When a freelance analyst hits an unexpected permission error, a well-meaning engineer might grant roles/bigquery.admin to quickly bypass the error. While this unblocks the contractor, it gives them permission to delete partition histories, create publicly exposed datasets, or modify IAM permissions. Diagnose the missing permission directly—which is typically roles/bigquery.jobUser on the query-execution project—rather than inflating permissions to an administrative level.

2. The Personal Google Account Trap

Allowing an external vendor to use their personal @gmail.com address creates multiple governance issues. If the contractor leaves their laptop unattended or lacks device encryption, your internal records become vulnerable. Furthermore, if you accidentally share saved queries, Google Drive tables, or Looker Studio assets with a personal address, revoking their BigQuery IAM role does not revoke their access to downstream analytical exports.

3. Forgetting Scheduled Queries and Saved Pipelines

Contractors often automate their analysis by setting up scheduled queries inside the BigQuery console. These jobs execute using the permissions of the user who configured them. When that account is suspended or deleted, those queries begin throwing failures that can disrupt morning analytics dashboards. Review scheduled queries before deprovisioning a contractor so critical reporting pipelines remain uninterrupted.

4. Assuming Workspace Account Deletion Removes All Cloud Bindings

If you provision a contractor using a standalone Cloud Identity account or an external Google account, deleting or suspending the user inside Google Workspace does not automatically remove the historical IAM role bindings from your BigQuery datasets. If that same email address is later re-registered or repurposed, the old permissions may still be attached to the IAM policy. Operations teams should clean up IAM bindings directly inside Google Cloud alongside any identity directory changes.

5. Uncontrolled Query Spend

BigQuery charges for on-demand queries based on the volume of data scanned by each statement. An unvetted contractor running unpartitioned, unclustered SELECT * queries across terabyte-scale historical tables can run up thousands of dollars in billing over a single weekend. Implement BigQuery custom cost controls by setting per-user daily query byte limits in your billing project settings.

When to Automate Contractor Access to BigQuery

Managing access manually using checklists and console permissions is manageable when you work with one or two external contractors a year. However, as an organization scales, manual workflows quickly become a bottleneck for busy operations leads.

You should consider introducing structured automation when your operational profile exhibits these characteristics:

  • Your organization collaborates with multiple concurrent freelancers, agencies, or outsourced development firms across different departments.
  • Engineers spend valuable time manually configuring, tracking, and debugging IAM roles for temporary projects.
  • Your team prepares for enterprise customer security questionnaires that require documented audit histories of contractor provisioning and deprovisioning.
  • Contractor offboarding is ad hoc, leaving dormant credentials active until someone notices months later.

Understanding where different tools enforce access helps teams construct an effective security framework. Comparing automated access management against manual processes illustrates the operational differences:

Workflow Dimension Manual Console Management Automated Access Orchestration
Provisioning Mechanism Individual clicks in Google Cloud Console or CLI commands Time-boxed access grants initiated from a central portal
Revocation Reliability Dependent on human memory and scheduled calendar reminders Automated scheduled revocation executed when the grant reaches its limit
Post-Revocation Audit Manual inspection using Cloud Logging queries Read-back verification of provider state where natively enforced
Audit Trail Assembly Manually pulling disparate log entries across multiple services Exportable, centralized audit records covering the grant lifecycle

Tempkey natively enforces access on 10 providers — Slack, Google Workspace, Microsoft 365, GitHub, GitLab, Zoom, AWS IAM, Figma, Dropbox, and Asana. Notion and Trello are limited-native (tracked, not fully enforced) and Zapier/Make are best-effort webhook bridges without automated verification. Automatic Slack deactivation uses Slack's SCIM API, which Slack offers on its Business+ and Enterprise plans. On other Slack plans, Tempkey verifies that access was removed rather than removing it.

Because BigQuery access is managed through Google Cloud IAM—which Tempkey does not natively enforce today—teams should combine automated access management for core productivity tools with a disciplined, documented manual checklist for their cloud data warehouse. You can manage the contractor's Google Workspace identity automatically, while applying the specific BigQuery dataset permissions outlined in this guide.

Plans are month-to-month (Free / $39 Team / $99 Business) with active-grant limits of 2 / 10 / 30. Business includes extended audit-history retention. For a broader look at designing operational offboarding systems, read our analysis on automated offboarding vs. manual cleanup. Source: Tempkey source.

Frequently Asked Questions

What is the minimum BigQuery IAM role a contractor needs to run queries?

To run queries against an existing dataset, a contractor needs a minimum of two roles: roles/bigquery.dataViewer assigned at the dataset level, and roles/bigquery.jobUser assigned at the project level. The dataset role permits reading the tables and views, while the project role grants the compute access required to execute query jobs and view their execution output, as outlined in Google Cloud's BigQuery permissions documentation.

Should I grant BigQuery access at the project level or the dataset level?

You should grant data access at the dataset level whenever possible. Granting permissions at the project level exposes all current and future datasets contained within that project to the contractor. Dataset-level grants limit external visibility to specific analytical containers, isolating internal tables, billing details, and unrelated client schemas from external view.

How do I revoke a contractor's BigQuery access when the engagement ends?

To fully revoke access, remove the contractor's identity from the dataset's IAM access list, remove their project-level roles/bigquery.jobUser role, and remove them from any associated Google Groups. Additionally, audit BigQuery Scheduled Queries to reassign or delete recurring jobs created by the contractor, and verify that any temporary Cloud Storage export buckets have their permissions cleared.

Can I set an automatic expiry on BigQuery IAM grants?

Yes. You can use Google Cloud IAM conditions to attach an expiration timestamp to a role binding at both the project and dataset levels. In the Cloud Console or via the gcloud CLI, apply a condition expression such as request.time < timestamp("2026-10-31T00:00:00Z") to the IAM assignment. Once that timestamp passes, Google Cloud automatically treats the binding as inactive.

Does removing a contractor's Google Workspace account remove their BigQuery access?

Suspending or removing a contractor's Google Workspace account prevents them from authenticating into that specific identity. However, it does not purge historical IAM policy bindings from your Google Cloud projects. If the contractor was granted access using an external personal Google account, removing their Workspace account has no effect on their cloud access. Explicitly remove IAM policy bindings directly in Google Cloud.

If you are juggling contractor grants across BigQuery and a dozen other tools, try Tempkey free and see how a time-boxed grant with automatic revocation and an exportable audit trail fits your offboarding process.