@@ -59,6 +59,7 @@ shithub_runner_default_image=ghcr.io/shithub/runner-nix:1.0 |
| 59 | 59 | shithub_runner_seccomp_profile=/etc/shithubd-runner/seccomp.json |
| 60 | 60 | shithub_runner_container_user=65534:65534 |
| 61 | 61 | shithub_runner_pids_limit=512 |
| 62 | +shithub_runner_dns_servers=172.30.0.1 |
| 62 | 63 | ``` |
| 63 | 64 | |
| 64 | 65 | The role writes non-secret config to |
@@ -67,6 +68,12 @@ The role writes non-secret config to |
| 67 | 68 | Keep `shithub_runner_workspace_root` under `/var/lib/shithubd-runner`; |
| 68 | 69 | the systemd unit grants runner writes only to that subtree. |
| 69 | 70 | |
| 71 | +`shithub_runner_network_allowlist` defaults to GitHub source/archive |
| 72 | +hosts plus Docker Hub registry hosts. Override it when a runner must |
| 73 | +fetch from an internal package registry. `shithub_runner_dns_servers` |
| 74 | +is empty by default; set it only after a DNS allowlist resolver exists |
| 75 | +on the runner network. |
| 76 | + |
| 70 | 77 | ## Deploy |
| 71 | 78 | |
| 72 | 79 | For the runner role only: |
@@ -82,6 +89,8 @@ The role: |
| 82 | 89 | - creates the `shithub-runner` system user and joins it to `docker` |
| 83 | 90 | - uploads `/usr/local/bin/shithubd-runner` |
| 84 | 91 | - renders `/etc/shithubd-runner/config.toml` and `runner.env` |
| 92 | +- renders `/etc/shithubd-runner/dnsmasq.conf` from the network |
| 93 | + allowlist for operators who run a local DNS allowlist resolver |
| 85 | 94 | - installs the pinned seccomp profile at |
| 86 | 95 | `/etc/shithubd-runner/seccomp.json` |
| 87 | 96 | - installs `deploy/systemd/shithubd-runner.service` |
@@ -143,6 +152,28 @@ Expected state: |
| 143 | 152 | - step logs and systemd journal include the configured image, network, |
| 144 | 153 | CPU/memory limits, PID limit, container user, and seccomp profile |
| 145 | 154 | |
| 155 | +## Network Allowlist |
| 156 | + |
| 157 | +The runner config carries two separate network controls: |
| 158 | + |
| 159 | +- `runner.network_allowlist`: the host patterns allowed by the |
| 160 | + operator's DNS allowlist resolver. |
| 161 | +- `engine.dns_servers`: DNS servers passed to each step container with |
| 162 | + Docker `--dns`. |
| 163 | + |
| 164 | +For a single-host deployment, create a dedicated Docker bridge for |
| 165 | +Actions jobs, run dnsmasq bound to that bridge, render |
| 166 | +`/etc/shithubd-runner/dnsmasq.conf`, and set |
| 167 | +`shithub_runner_dns_servers` to the bridge address of that resolver. |
| 168 | +The rendered dnsmasq config has no default upstream resolver; names not |
| 169 | +matching the allowlist fail DNS resolution. |
| 170 | + |
| 171 | +DNS filtering is not a complete egress boundary by itself. Block |
| 172 | +direct-IP egress from the Actions bridge with host firewall rules, and |
| 173 | +allow only DNS to the resolver plus established outbound connections |
| 174 | +opened by that resolver. Keep the runner on a separate host from web |
| 175 | +and database services. |
| 176 | + |
| 146 | 177 | ## Rollback |
| 147 | 178 | |
| 148 | 179 | Stop the runner first so it does not claim new jobs: |