The Simplest Way to Make JetBrains Space and Spanner Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use jetbrains space and spanner to run code builds and update global databases. Space runs your build jobs while Spanner stores your app data across regions. This setup lets developers ship schema changes and test app code in one place. Yet linking a build tool to a live database brings real security risks. You must manage how jobs log in and what data they can read. How jetbrains space and spanner share identity and data JetBrains Space holds your git repos, code reviews, and automati

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 use jetbrains space and spanner to run code builds and update global databases. Space runs your build jobs while Spanner stores your app data across regions.

This setup lets developers ship schema changes and test app code in one place. Yet linking a build tool to a live database brings real security risks. You must manage how jobs log in and what data they can read.

How jetbrains space and spanner share identity and data

JetBrains Space holds your git repos, code reviews, and automation jobs. Google Cloud Spanner runs as a managed relational database with strong consistency. When a Space job runs, it needs a valid cloud identity for Spanner.

In a standard setup, Space jobs use a Google Cloud service account. The job exchanges an identity token or reads a stored secret key. Google Cloud checks this identity against its own role rules.

If the role allows it, the Space worker opens a network session to Spanner. The worker then runs schema migrations, integration tests, or data checks. Spanner sends the query results back to the Space worker log. Your team sees the pass or fail status right in their Space project.

Common failure modes with shared keys and broad roles

Many teams start by putting a static service account key into Space secrets. This quick fix creates a big problem over time. Static keys do not expire unless someone rotates them by hand. If a key leaks in a build log, anyone can use it.

Overly broad roles cause another common failure. Teams often give the Space worker a full admin role on the database. That single role lets any build script drop tables or read live user rows. A bad script in a pull request can wipe out production data.

Unlogged queries also hurt security and audits. When ten developers trigger jobs that share one service account, logs look the same. Cloud logs show the service account name, not the person who triggered the job. You cannot tell who ran a specific query during an incident.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Database rows often hold private data like emails, phone numbers, and card numbers. If a build job prints query results to debug an issue, that data leaks. Anyone who can read the Space build log will see those sensitive fields.

Scoping roles and network paths for safer builds

You can fix these issues by tightening how the two tools talk. First, stop using long-lived JSON keys in your project store. Use federated identity so Space workers request short tokens from Google Cloud. These tokens expire right after the build job finishes.

Second, split your service accounts by task and stage. Give your test runner a read-only role on a staging database. Give your migration job schema change rights, and lock it to your main branch. No automated job should hold full admin rights across all databases.

Third, lock down the network path between your workers and Google Cloud. Run self-hosted Space workers inside your own private cloud network. Keep database traffic on private routes instead of the public internet. Set firewall rules so only approved worker nodes can reach the database port.

Finally, protect sensitive columns during debug and test runs. Data masking rewrites matched fields in results, such as national IDs or emails. This step keeps private user details out of your build logs.

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 should JetBrains Space jobs log in to Google Cloud Spanner?

Use workload identity federation instead of static JSON keys. Space sends a short-lived token to Google Cloud to get temporary database access. This approach removes stored keys from your project settings.

How do we stop build jobs from reading sensitive user data in Spanner?

Give your build jobs a strict role that only reads test tables. For live data checks, use data masking to rewrite emails and card numbers. This keeps real user details out of your Space job logs.

Why should we separate service accounts for Space automation?

A shared account makes it hard to track which job ran a bad query. Separate accounts let you limit permissions for each step, like testing versus schema updates. You also get cleaner audit logs in Google Cloud.

The query runs. The emails stay hidden.