The Simplest Way to Make GitHub Actions and Google Cloud Deployment Manager Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use github actions and google cloud deployment manager to build cloud resources from code. When you push code, the workflow runs and updates your cloud setup right away. This setup stops manual changes in the cloud console. Every cloud change goes through code review first. Your team can see who changed what and when it happened. How github actions and google cloud deployment manager work together The workflow starts when a developer pushes a template file to a repo. GitHub starts a ru

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 github actions and google cloud deployment manager to build cloud resources from code. When you push code, the workflow runs and updates your cloud setup right away.

This setup stops manual changes in the cloud console. Every cloud change goes through code review first. Your team can see who changed what and when it happened.

How github actions and google cloud deployment manager work together

The workflow starts when a developer pushes a template file to a repo. GitHub starts a runner to handle the job. That runner needs a way to log in to Google Cloud.

The best way to log in is workload identity federation. The runner sends a short token from GitHub to Google Cloud. Google checks that token against a trust rule you set up.

If the check passes, Google gives the runner a temporary cloud token. The runner then sends the template files to the deployment service. The service reads the templates and creates or updates the cloud resources.

During this step, the deployment service uses its own cloud service account. That account makes the actual API calls to build networks, disks, or servers. When the job finishes, the runner drops the temporary token and shuts down.

Common risks with shared keys and broad roles

Many teams still use static JSON keys stored in repo secrets. These keys do not expire unless someone deletes them by hand. If a key leaks, an attacker can use it from anywhere.

Broad roles cause another big problem for cloud teams. People often give the runner an owner or editor role to fix permission errors fast. If a bad pull request runs, it can wipe out production data.

GitHub Actions Security + GCP Access Context Manager: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Google Cloud also uses a default service account for the deployment API. By default, this account gets very wide rights across the whole project. Anyone who can trigger a deployment can use those wide rights.

Unlogged runs also hurt security and slow down fixes. When five workflows share one service account, the cloud logs look the same. You cannot tell which repo or branch broke a resource.

How to lock down roles and network paths

Start by getting rid of all saved JSON keys in your repos. Set up identity federation so runners only get tokens that last for minutes. Lock the trust rule to one specific repo and branch name.

Next, create a separate service account for each app or team. Give each account only the exact roles needed for its resources. Do not let different apps share one cloud identity.

You should also replace the default deployment account with a custom one. Give the runner permission to act only as that single custom account. Keep staging and production in separate cloud projects with separate roles.

Finally, check your network rules and audit logs. Use private runners if your cloud project blocks public internet traffic. Turn on admin and data logs so you can track every API call.

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 we use JSON service account keys in GitHub secrets?

No, static JSON keys stay valid until you delete them by hand. Use identity federation instead so each job gets a short token that expires fast.

How do we stop a workflow from changing the wrong project?

Create separate cloud projects and separate service accounts for test and production setups. Lock your identity trust rule so only your main branch can reach production.

Why did my deployment pass in review but fail during the run?

The runner identity and the deployment service account need different permissions in Google Cloud. Check that the deployment account has the right roles to build the target resources.

The query runs. The emails stay hidden.