How to Integrate DataGrip and BigQuery Safely

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams pair datagrip and bigquery to run cloud SQL queries from a local desktop app. This setup lets data engineers explore tables, test views, and check warehouse data fast. While this workflow speeds up daily work, local database tools create real security risks. A bad setup can expose cloud keys or allow huge, costly table scans. You need clear rules for how users log in and run queries. How datagrip and bigquery work together DataGrip is a desktop database app built by JetBrains. BigQuery

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 datagrip and bigquery to run cloud SQL queries from a local desktop app. This setup lets data engineers explore tables, test views, and check warehouse data fast.

While this workflow speeds up daily work, local database tools create real security risks. A bad setup can expose cloud keys or allow huge, costly table scans. You need clear rules for how users log in and run queries.

How datagrip and bigquery work together

DataGrip is a desktop database app built by JetBrains. BigQuery is a cloud data warehouse run by Google Cloud. To link them, DataGrip uses a Simba JDBC driver made for Google Cloud.

When an engineer opens DataGrip, the driver talks to the Google Cloud API. The user must log in before the app can see any datasets or tables. You can set up this sign-in step in two main ways.

The first way uses a user account through a browser sign-in flow. The second way uses a Google Cloud service account key file stored on the laptop. Once the user logs in, DataGrip reads the project list and table schemas.

When the user runs a SQL query, DataGrip sends that text to the cloud API. BigQuery runs the job, bills the linked project, and sends the rows back. DataGrip then shows those result rows in a local grid on the user's screen.

Common security risks and how to scope roles

The biggest risk in this setup comes from shared service account key files. Teams often pass one JSON key file around to get new hires working fast. If a laptop gets lost or hacked, that static key gives away wide access.

Shared keys also ruin your audit logs in Google Cloud. Every query looks like it came from the same bot account, not a real person. You cannot tell which engineer read a sensitive table or ran a bad update.

Broad cloud roles create another major problem for data teams. If you give a user a project editor role, they can drop production tables. They can also run huge queries that scan petabytes of data and spike your bill.

BigQuery IAM + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, ban local JSON key files for human users on laptops. Make every engineer log in with their own Google workspace identity instead. This rule ties every single SQL job to a real person in your cloud logs.

Next, split your cloud permissions between job running and data reading. Give users a role that lets them create query jobs in a billing project. Then grant read access only to the specific datasets they need for their work.

Set up custom byte limits on your cloud projects to stop runaway costs. You should also think about sensitive columns like emails, phone numbers, and card numbers. Data masking rewrites matched fields in results so local grids do not hold raw secrets.

Controlling network paths and local data

BigQuery runs on public cloud endpoints by default, unlike databases inside a private network. Any device with a valid token can reach the API from coffee shops or home networks. You should restrict where users can log in from by using cloud context rules.

Set up device checks and IP allowlists in your Google Cloud security settings. These rules block query requests that come from untrusted networks or unmanaged laptops. You also need to check how DataGrip caches data on the local disk.

Desktop tools save query history and schema details in local folders by default. Tell your team to turn off local result caching for sensitive cloud projects. Keep query timeouts short so idle apps do not hold open cloud sessions all day.

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 beside the service as an open-source proxy, a sidecar for your database or API.

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 review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Should engineers use service account keys in DataGrip?

No, engineers should not store service account JSON keys on their laptops. Have them use personal Google accounts with browser login so logs show who ran each query.

How do we stop huge BigQuery bills from DataGrip users?

Set a maximum bytes billed limit on the Google Cloud project used for queries. BigQuery will block any query from DataGrip that tries to scan more data than allowed.

Can we restrict DataGrip users to specific BigQuery tables?

Yes, you can grant IAM read roles at the dataset or table level in Google Cloud. Users will only see and query the tables linked to their personal cloud role.

The query runs. The emails stay hidden.