runner: separate the runner's source address from its builds; egress policy #260

closed cmc opened this on 2026-09-28 02:36 UTC · ci ops security

Discussion

cmc 2026-09-28 02:36 UTC

Builds share a source address with the runner, and nothing limits their egress.

On bay1 the OUTPUT policy accepts everything and has no runner-specific rules; there are no loopback-only TCP listeners, so a build reaches ports 22, 80, 443 and 2222 plus the internet. Under pasta a build's connections to 169.254.1.2 most likely arrive from 127.0.0.1, the address the runner polls from (-remote git@127.0.0.1, deploy/gitbay-runner.override.conf:78). The SSH auth limiter counts failures per IP (internal/sshd/ratelimit.go:86).

Suspected impact: an untrusted build that fails ten SSH logins a minute throttles the runner's own polling and stalls CI. Not yet tested.

  • Test: a throwaway build on a scratch repository failing auth in a loop while the runner polls.
  • Separate the runner's source address from its builds' (runner reaches the daemon on the public address, or builds get GITBAY_SSH pointed at gitbay.org).
  • Decide an egress policy for untrusted builds and document it in the Threat-Model and CI wiki pages.

referenced in commit 7a6343d02d by cmc: wiki: architecture and security pages

2026-09-28 04:30 UTC

referenced in commit 4e0958a163 by cmc: plans: open issues from the architecture and UX reviews

2026-09-28 05:43 UTC

referenced in commit b711b70da5 by cmc: plans: apply decisions on the open questions

2026-09-28 06:16 UTC

referenced in commit dcd93804bc by cmc: runner: only a loopback runner's podman builds leave -remote

2026-09-28 22:33 UTC

referenced in commit 24c714dba2 by cmc: runner: builds reach the forge at pasta's host address

2026-09-28 22:33 UTC

referenced in commit 26e387e932 by cmc: wiki: what a build can reach

2026-09-28 22:33 UTC

referenced in commit 9467ed29d6 by cmc: runner egress: remove the rule when it blocks the runner's poll

2026-09-28 22:33 UTC

referenced in commit 9809a86bfc by cmc: runner host: builds reach only the forge's public ports on it

2026-09-28 22:33 UTC

referenced in commit 23e979a2af by cmc: sshd: test the auth limiter's lockout by registration mode

2026-09-28 22:33 UTC

referenced in commit 28f6758983 by cmc: runner: builds off the host's loopback when the runner polls over it

2026-09-28 22:33 UTC

referenced in commit c21c7ea735 by cmc: runner next: send the instance's public ssh destination

2026-09-28 22:33 UTC

referenced in commit f5b05a2161 by cmc: runner: report a missing image or podman before missing build cgroups

2026-09-29 03:57 UTC

referenced in commit 060250459e by cmc: wiki, changelog: flood test checks the log; runner needs build cgroups on the forge's host

2026-09-29 03:57 UTC

referenced in commit 748122ef10 by cmc: runner host: flood test asserts the table's effect; exact rollback of the builds table

2026-09-29 03:57 UTC

referenced in commit 7acfcebdf5 by cmc: runner: refuse to start without build cgroups when taking untrusted builds or polling over loopback

2026-09-29 03:57 UTC

referenced in commit 2258972d20 by cmc: wiki, changelog: build egress by trust

2026-09-29 03:57 UTC

referenced in commit b5ea7bcf97 by cmc: deploy: scratch test for a build failing SSH logins beside the runner

2026-09-29 03:57 UTC

referenced in commit 4be4bd5917 by cmc: runner host: build egress by cgroup, narrower for untrusted builds

2026-09-29 03:57 UTC

referenced in commit 89708196e4 by cmc: runner: builds run under a cgroup per trust class

2026-09-29 03:57 UTC

closed by cmc in commit 921868375e: wiki: build egress measured on bay1

2026-09-29 04:36 UTC

referenced in commit 9f309aef9c by cmc: deploy: the flood test adds and removes its key with gitbay auth keys

2026-09-29 04:36 UTC