The Simplest Way to Make Google Compute Engine and Harness Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing google compute engine and harness lets your team automate virtual machine deployments. Harness triggers pipeline steps that spin up, update, and check cloud servers. This setup moves code from your source repo straight to live cloud instances. Teams save time and cut manual release errors across staging and production projects. How google compute engine and harness work together The link between google compute engine and harness starts with a cloud service account. Harness uses a run

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.

Pairing google compute engine and harness lets your team automate virtual machine deployments. Harness triggers pipeline steps that spin up, update, and check cloud servers.

This setup moves code from your source repo straight to live cloud instances. Teams save time and cut manual release errors across staging and production projects.

How google compute engine and harness work together

The link between google compute engine and harness starts with a cloud service account. Harness uses a runner called a delegate to talk to your cloud project. You place this delegate inside your network or on a dedicated virtual machine. When a pipeline runs, the delegate calls the cloud API to manage instances.

You have two main ways to handle the login step between these tools. First, you can store a cloud service account key inside the Harness secret store. Second, the delegate can inherit a role straight from the host virtual machine. The inherited role approach is safer because you never export a static key file.

Once logged in, the pipeline reads image lists and instance group states. It then creates new virtual machines or updates existing groups with fresh boot images. Data flows over encrypted cloud API calls, while SSH handles direct host script runs. Your pipeline waits for health checks to pass before it marks the rollout done.

Common failure modes and how to scope roles

Many teams start by giving the pipeline a broad project editor role. That choice creates a huge risk if a pipeline job ever leaks its token. A shared service account across dev and prod also breaks your security boundary. A bug in a test pipeline could wipe out live production virtual machines.

Static JSON keys create another common failure mode for busy cloud teams. Engineers download these keys, paste them into settings, and forget to rotate them. If an old key leaks, an attacker gains full control over your virtual machines. Unlogged SSH runs from pipelines also make it hard to trace host changes.

End-to-End Encryption + Harness Security Features: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix these gaps by scoping one service account per deployment stage. Give the dev delegate a role that only touches the dev cloud project. Give the prod delegate a separate role that only touches production virtual machines. Restrict the role to compute instance admin and service account user permissions only.

Lock down the network path between the delegate and your target hosts too. Run the delegate inside a private subnet with no public IP address attached. Use internal IP addresses for all host script runs and health checks. Turn on cloud audit logs for all compute API calls so you track every change.

Keeping host scripts and secrets safe in pipelines

Deployment pipelines often need to run startup scripts or pass secrets to hosts. Never hardcode API tokens or database passwords inside your startup script text. Store sensitive values in a dedicated secret manager and fetch them at boot time. When logs print out, make sure masking rewrites matched fields in results like emails.

You should also bake most of your app setup into golden machine images. When you build images ahead of time, your deploy step needs fewer host permissions. The pipeline just swaps the machine image instead of running root commands over SSH. This habit keeps your deployments fast, clean, and much easier to audit.

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 I use a static JSON key or an inherited VM role for the delegate?

Use an inherited role on a delegate that runs inside your cloud project. This setup removes the need to create, store, or rotate static JSON key files.

How do I keep staging pipelines from changing production virtual machines?

Put staging and production instances in separate cloud projects with their own delegates. Assign each delegate a service account that only has permissions inside its own project.

What permissions does Harness need to deploy to an instance group?

The service account needs permissions to read images, update instance templates, and manage instance groups. It also needs permission to act as the service account attached to the target instances.

The query runs. The emails stay hidden.