The Simplest Way to Make Buildkite and Windows Server 2022 Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Running buildkite and windows server 2022 together lets teams run Windows build jobs on their own machines. The cloud plane sends build steps to an agent running as a local service. This setup gives teams full control over their build tools and local hardware. You keep source code and private keys inside your own network. The cloud dashboard only sees job status and text logs from the build. How buildkite and windows server 2022 share work and permissions The workflow relies on a hybrid desi

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.

Running buildkite and windows server 2022 together lets teams run Windows build jobs on their own machines. The cloud plane sends build steps to an agent running as a local service.

This setup gives teams full control over their build tools and local hardware. You keep source code and private keys inside your own network. The cloud dashboard only sees job status and text logs from the build.

How buildkite and windows server 2022 share work and permissions

The workflow relies on a hybrid design that splits control from execution. The cloud platform manages the build queue and tracks job rules. Your local Windows machine runs a small background program called the agent.

This agent polls the cloud platform over an outbound web link. It asks for new jobs that match its assigned tags. Because the link goes outward, you do not open inbound firewall ports.

When a job starts, the agent pulls the code onto the server. It runs the build script using a local Windows user account. The permissions of that Windows user control what the build can do.

After each step, the agent sends console output back to the web dashboard. The build artifacts move to your chosen storage bucket. The server then cleans the working folder before the next job starts.

Common failure modes and how to scope roles

Many teams run the Windows agent under the main local system account. This choice causes big security risks and messy build bugs. Any script in any repo can change core server settings or read local keys.

Shared service accounts also create problems across different build pipelines. One broken test can leave locked files or hung processes behind. The next job on that machine will fail for reasons hard to spot.

Broad network tokens make this issue much worse. If a build agent holds a wide token, any developer can pull production data. You also lose track of which person or job ran a specific query.

Kubernetes API Server Access + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

To fix this, run each agent under a dedicated Windows user role. Give that user access only to the specific build folder it needs. Deny access to system folders and other agent directories on the host.

Next, lock down the network paths from the Windows build machine. Allow outbound traffic only to your code host, package store, and cloud control plane. Block the build machine from talking to internal databases unless a test needs it.

Finally, rotate agent registration tokens on a regular schedule. Use separate agent queues for test builds and release builds. This split stops untrusted branch code from touching your release keys.

Managing state and updates on Windows build hosts

Long-lived Windows servers often suffer from disk bloat and state drift. Leftover temp files and cached packages fill up the local drive fast. When the drive fills up, the agent stops taking new work.

Set up a daily task to wipe old build folders and temp files. Better yet, spin up fresh virtual machines from a clean gold image. When a job finishes, destroy the machine and start a clean one.

Windows updates can also reboot a host right in the middle of a deploy. Turn off automatic reboots during work hours on your build machines. Apply patches by baking a new machine image and swapping out old hosts.

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

Does the cloud platform need inbound network access to Windows Server 2022?

No, the agent on your Windows host makes an outbound connection. You can keep all inbound firewall ports closed on the server.

Which Windows account should run the build agent service?

Use a dedicated local user or managed service account with limited rights. Never use a domain admin or the built-in system account for builds.

How do we stop one build job from breaking the next job?

Clear the build folder after every run and kill stray background tasks. Using fresh virtual machines for each job gives the cleanest split.

The query runs. The emails stay hidden.