The Simplest Way to Make Buildkite and Caddy Work Like They Should
You pair buildkite and caddy to run safe build pipelines behind a clean web server. Caddy handles HTTPS certs for webhooks and build apps while Buildkite runs your tests. This setup keeps your build agents safe inside your private network. You expose only the web ports that external git tools or preview apps need. Teams use this pair to ship code fast and test web apps in real time. How traffic and keys flow between buildkite and caddy Buildkite uses a cloud control plane paired with self-ho
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.
You pair buildkite and caddy to run safe build pipelines behind a clean web server. Caddy handles HTTPS certs for webhooks and build apps while Buildkite runs your tests.
This setup keeps your build agents safe inside your private network. You expose only the web ports that external git tools or preview apps need. Teams use this pair to ship code fast and test web apps in real time.
How traffic and keys flow between buildkite and caddy
Buildkite uses a cloud control plane paired with self-hosted build agents on your servers. Your agents poll the Buildkite cloud for jobs and run your build steps. When a job builds a web app, Caddy serves that app over HTTPS.
Caddy also receives incoming webhooks from your git host and routes them to local services. It fetches and renews TLS certs on its own without manual steps. You do not need to write long cert renewal scripts for your test servers.
Permissions flow through two main paths in this setup. First, the Buildkite agent uses an agent token to talk to the cloud queue. Second, the agent needs local write rights to update Caddy routes during a deploy job.
You can use the Caddy local admin port to push new site rules from a job. The build job finishes, sends a web request to Caddy, and updates the live site. Users then check the new build at a clean HTTPS link right away.
Common failure modes and how to scope roles
Many teams make the mistake of using one shared admin account for all build agents. If one test script breaks or leaks a key, every site on Caddy is at risk. A bad script could wipe out all web routes on the host machine.
Broad agent tokens also create high risk for your team. When every pipeline shares the same runner pool, a front-end test can read backend secrets. You also lose track of which person or job changed a routing rule.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Unlogged requests to the Caddy admin port cause another big blind spot. When a build changes a web route and breaks a site, you need clear logs. Without logs tied to a specific build job, you cannot find the root cause fast.
To fix this, give each Buildkite agent queue a strict Linux user role. Keep the Caddy admin port bound to the local loop interface on the host. Never open the Caddy admin port to the public web or wide office networks.
Split your Buildkite agents into separate queues for test builds and live deploys. Only the deploy queue should have the rights to update live Caddy routes. Rotate your agent keys often and store pipeline secrets in a dedicated secret store.
Keeping build logs and preview data clean
Preview apps and build logs often handle real test data like emails or phone numbers. If Caddy logs full request bodies, sensitive details like card numbers might land on disk. You should set your log rules to drop sensitive headers and mask private fields.
Data masking rewrites matched fields in results so logs stay useful without leaking secrets. You can still see status codes, timings, and paths to debug a broken build. Your team gets fast feedback from every pipeline run while keeping user data safe.
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
Why put Caddy in front of Buildkite agent workloads?
Caddy manages TLS certs on its own and routes web traffic with simple rules. It lets your Buildkite jobs spin up HTTPS preview sites without manual cert work.
How should Buildkite agents update Caddy routing rules?
Agents should send local requests to the Caddy admin port on the same host. Lock down this port so only the deploy agent user can reach it.
How do we stop build jobs from leaking secrets in web logs?
Scope agent roles by pipeline and drop auth headers in your Caddy log settings. Mask fields like emails and national IDs before logs hit your storage disk.
Related guides
In this post