The Simplest Way to Make Dataproc and GitHub Actions Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use dataproc and github actions together to run big data jobs from code changes. When a developer merges code, the runner builds the app and starts a cluster job. This workflow turns manual data tasks into repeatable pipelines. Data teams test and ship Spark or Hadoop jobs on every commit. Yet linking a build runner to a cloud cluster creates security risks. You must handle identities, roles, and network rules with care. How dataproc and github actions share permissions and data The wo

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 dataproc and github actions together to run big data jobs from code changes. When a developer merges code, the runner builds the app and starts a cluster job.

This workflow turns manual data tasks into repeatable pipelines. Data teams test and ship Spark or Hadoop jobs on every commit. Yet linking a build runner to a cloud cluster creates security risks. You must handle identities, roles, and network rules with care.

How dataproc and github actions share permissions and data

The workflow starts when a developer pushes code to a repo. The runner wakes up and reads the workflow file. Next, the runner must prove its identity to Google Cloud. In the past, teams stored static JSON keys as repo secrets. That approach is risky because static keys do not expire on their own.

Today, teams use federated identity to link the two tools. The runner requests a signed token from its own host. It sends that token to Google Cloud to trade it for a cloud token. Google Cloud checks the repo name and branch name in the token. If the rules match, the cloud grants a temporary token for one service account.

Once logged in, the runner sends the packaged job code to cloud storage. Then the runner calls the cluster API to start a new job. The cluster pulls the code from storage and runs it against the data. As the job runs, the cluster writes logs and output back to cloud buckets. The runner watches the job status and marks the build as pass or fail.

Common failure modes and how to scope roles

Many teams fail by using one shared service account for every repo. When every workflow uses the same role, any branch can touch production data. A bad pull request from a test branch could wipe a core table. Another common mistake is granting broad editor or owner roles to the runner. If a workflow leaks its token, an attacker gains full control over the cloud project.

Unlogged queries and blind spots also hurt data teams. When ten developers trigger workflows, the cloud logs only show one service account name. You cannot tell which person or commit ran a heavy query or read sensitive tables. Also, some jobs process tables with emails, phone numbers, or card numbers. Without field controls, test jobs may write raw data into shared build logs.

GitHub Actions Security + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix these issues, create separate service accounts for test and production branches. Bind your federated trust rules to specific branches or tags, not the whole repo. Give the runner role only the right to submit jobs and write code artifacts. Give the cluster worker role only the right to read the buckets it needs.

Securing network paths and runtime data

Network setup matters just as much as identity setup. Cloud clusters should run on private networks without public IP addresses. Hosted runners live outside your private network, so they call the cloud control plane. Keep the cluster nodes isolated so they cannot reach the public internet.

When jobs query sensitive tables, use data masking to protect fields in results. Masking rewrites matched fields like national IDs or card numbers before output leaves the database. This step keeps test runs safe while letting engineers check job logic.

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 GitHub Actions log in to Google Cloud for Dataproc jobs?

Use workload identity federation instead of saved JSON service account keys. The runner trades a short token for temporary cloud permissions tied to your repo.

Should the runner and the Dataproc cluster use the same service account?

No, split them into two separate roles with distinct permissions. The runner submits jobs, while the cluster nodes read and write the actual data.

How do we stop pull requests from running jobs on production clusters?

Restrict your cloud trust policy so only the main branch can assume the production role. Pull requests should only get a test role linked to an isolated test cluster.

The query runs. The emails stay hidden.