Skip to content
Merged
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@ fleet with the runners idle, and register the new runner.
## Supported hosts

Ubuntu with systemd 249 or later, cgroup v2 and x86_64 or aarch64 is what
preflight accepts. **Verified so far: Ubuntu 24.04 on aarch64 (systemd 255),
on one VM.** [docs/compatibility.md](docs/compatibility.md) is the only list of
preflight accepts. What is supported is narrower: **verified so far, Ubuntu
24.04 on aarch64 (systemd 255), on one VM.** Preflight warns on any systemd
other than 255. [docs/compatibility.md](docs/compatibility.md) is the only list of
what has been verified.

## Documentation
Expand Down
29 changes: 29 additions & 0 deletions docs/acceptance/2026-10-arm64.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ file.
| f28b6a5 | The registration of runner 1, by the command it printed. |
| 9208151 | Runner 1 and runner 2 live, all dogfood jobs, pool, busy guard and reboot. |
| 2bc81c0 | Final retirement, after both runners were deregistered. |
| 7f84c01 | The #18 follow-up below. No runner was registered. |

## Dogfood jobs

Expand Down Expand Up @@ -66,6 +67,34 @@ Each fix landed with a drill case that fails without it.
No such file` (#17, `env -C`; actions/runner #945 and #4460).
5. **`config.sh remove` rejects `--unattended`** (#17).

## Follow-up: the post-acceptance review (#18), 2026-10-16

The same VM, after the acceptance had ended and the host matched its
baseline. Commit 7f84c01 (tree ae6c64a) was installed. All 49 files in the
archive were compared with the commit and are identical; root owns the whole
tree. No runner was registered. Every case used a new test-only profile,
`probe`, which was never registered, and new test-only objects. Every
temporary host change was undone. Afterwards, `/etc/passwd`, `/etc/group`
and `/etc/login.defs` matched their checksums from before, byte for byte,
and the host listing matched its state from before.

| Case | Observed |
|---|---|
| Preflight on systemd 255 | `ok systemd 255`. No "unverified" warning, because 255 is the supported version. |
| The runner directory during the unpack | 232 samples, in this order: 750 (created by apply), then 700 (for the whole unpack), then 750 (after chmod). The archive's 0775 never appeared. |
| A symlinked `bin/` in the runner directory | `check`: `cannot determine the installed runner version`. With the real `bin/`: `runner version 2.338.0`. |
| A real process running as the account (`Uid: 997 997 997 997`) | `retire` refused, named the pid, and removed nothing. |
| A process holding the account only as its saved uid (`Uid: 0 0 997 0`) | `pgrep -u`, the old check, found nothing (exit 1). `retire` refused, named the pid, and removed nothing. |
| `userdel` failing, with `/etc/passwd` locked | `userdel could not remove rs-probe (exit 1); the account is still there`. The account, group, home, runtime root, marker and unit were all still there. |
| The account removed, but an immutable file in the runtime root | `could not remove all of /var/lib/rs-probe`. The unit and the marker were kept. After `chattr -i`, the next `retire` removed the root, then the unit, and exited 0. |
| `USERGROUPS_ENAB no` | `userdel` left the group. RunnerSlice removed it as the account's own unused group (gid 987). Exit 0. |
| The group with a member, and a home not owned by the account | `userdel` exited 12. The leftover home was reported, and not removed. The group was left, because it has a member. Exit 1. On a second run, both were reported again. The group was now "without its account", and was still not removed. After a manual cleanup, as the recovery table describes, `retire` exited 0. |

Not produced on the real host: an unreadable `/proc` (root can always read
it), and a `.runner` that is a FIFO, oversized or deeply nested. Those remain
SYNTHETICALLY TESTED. The drills ran inside the VM as `nobody`: 504 cases,
0 failed. The release drill skipped, because it needs a git checkout.

## Not verified here

- Unknown job state on a real host. It cannot be produced safely as root on a
Expand Down
27 changes: 25 additions & 2 deletions docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,36 @@ actually been verified, and at what level ([verification.md](verification.md)).
|---|---|---|---|
| Ubuntu 24.04 | x86_64 | 255 | **Planned** for the first verification VM. Not yet verified. |
| Ubuntu 24.04 | aarch64 | 255 | **Verified** on a disposable VM (Lima, Apple Virtualization), at RUNTIME VERIFIED and REBOOT VERIFIED. See [acceptance/2026-10-arm64.md](acceptance/2026-10-arm64.md). The lifecycle was run with two real GitHub runners, ending in deregistration and retirement. One VM; no other aarch64 host verified. |
| Ubuntu 22.04 | aarch64 | 249 | The code RunnerSlice was extracted from has run here in production (see [field-report.md](field-report.md)). **This code** has not been run there. |
| Ubuntu 22.04 | aarch64 | 249 | The code RunnerSlice was extracted from has run here in production (see [field-report.md](field-report.md)). **This code** has not been run there. Not supported. |
| Any other distribution | | | Refused by preflight. |

## systemd: accepted is not supported

Two ranges differ, on purpose, and neither stands in for the other.

| | Versions | Meaning |
|---|---|---|
| **Supported** | 255 | Verified on a real host by the acceptance above. |
| **Accepted, unverified** | 249–254, and 256 or later | Preflight lets these through, and warns, naming the version as unverified. Nothing about them has been observed on a host. |
| **Refused** | older than 249 | Preflight refuses. |

Why the code accepts more than is supported. The floor of 249 is what the
units rely on: `ProtectHome=tmpfs` with `BindPaths`, and a slice's
`IPAddressDeny` merged into every unit inside it. The one value `check` was
found to depend on in a version-specific way is how `systemctl show` prints
`RestrictNamespaces` (`yes`, `no`, or a list). That printing code
(`src/shared/bus-print-properties.c`) was read, not run, in the v249, v252
and v255 sources and is the same in all three. That is a source review. It
is not verification, and it covers only that one property. Raising the floor
to 255 would refuse hosts that nothing shows are broken. Calling them
supported would claim what nothing shows works. So they are accepted with a
warning, and only 255 is listed as supported.

Preflight refuses:

- a distribution other than Ubuntu;
- systemd older than 249;
- systemd older than 249 (249–254 and 256 or later pass with a warning that
they are unverified);
- a host without the cgroup v2 unified hierarchy, or without its `cpu`,
`memory` or `pids` controller;
- an architecture other than the release seed's.
Expand Down
3 changes: 2 additions & 1 deletion docs/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ is. It remains a candidate for its own project (decision 0004).

Only what has been verified is listed, in [compatibility.md](compatibility.md).
Preflight refuses anything other than Ubuntu with systemd 249 or later and
cgroup v2.
cgroup v2. It accepts more than is supported: any systemd other than 255
passes with a warning that it is unverified.

## Security position

Expand Down
4 changes: 3 additions & 1 deletion docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@

What preflight refuses to work without:

- **Ubuntu**, with systemd 249 or later.
- **Ubuntu**, with systemd 249 or later. Only systemd 255 is supported, that
is, verified. Preflight warns on any other accepted version
([compatibility.md](compatibility.md)).
- **The cgroup v2 unified hierarchy**, with the `cpu`, `memory` and `pids`
controllers available.
- **x86_64 or aarch64**, matching the `runner-platform` of the release seed.
Expand Down
77 changes: 68 additions & 9 deletions docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,21 @@ Every `apply` line is one of:
never handles it:

```sh
export ACTIONS_RUNNER_INPUT_TOKEN="$(gh api -X POST /repos/<owner>/<repo>/actions/runners/registration-token --jq .token)"
sudo --preserve-env=ACTIONS_RUNNER_INPUT_TOKEN -u runner-app -H \
env -C /var/lib/ci-app/runner HOME=/home/runner-app ./config.sh \
--url https://github.com/<owner>/<repo> \
--name <runner-name> --labels <labels> \
--work /var/lib/ci-app/work --unattended
unset ACTIONS_RUNNER_INPUT_TOKEN
(
ACTIONS_RUNNER_INPUT_TOKEN="$(gh api -X POST /repos/<owner>/<repo>/actions/runners/registration-token --jq .token)" || exit
export ACTIONS_RUNNER_INPUT_TOKEN
sudo --preserve-env=ACTIONS_RUNNER_INPUT_TOKEN -u runner-app -H \
env -C /var/lib/ci-app/runner HOME=/home/runner-app ./config.sh \
--url https://github.com/<owner>/<repo> \
--name <runner-name> --labels <labels> \
--work /var/lib/ci-app/work --unattended
)
sudo chmod 600 /var/lib/ci-app/runner/.runner /var/lib/ci-app/runner/.credentials /var/lib/ci-app/runner/.credentials_rsaparams
```

Copy the exact command `apply` printed. It has your names and labels in it.
The parentheses matter: the token stays in that subshell and is gone when
it ends, whatever `config.sh` does.

`env -C` runs `config.sh` in its own directory. `config.sh` checks its
native libraries with `./bin/...` paths before it changes directory, so run
Expand Down Expand Up @@ -135,8 +139,31 @@ each step a person takes.
3. **Deregister.** It stops with exit code 10 until a person has deregistered
the runner (the command is printed). If GitHub is unreachable, delete the
runner on GitHub and remove the registration files by hand.
4. **Remove.** It removes the unit, the runtime root and the account. Only
things RunnerSlice created are removed.
4. **Remove.** It checks everything first: the unit is RunnerSlice's, the
runtime root carries this profile's marker, the account has RunnerSlice's
shape, and no process runs as the account. Any uid counts: real,
effective, saved or filesystem. If `/proc` cannot be read, it removes
nothing. Then it removes, in this order:
- the account, its home, and its own group;
- the runtime root, with its marker last;
- the unit.

It also refuses, removing nothing, while any filesystem is mounted at or
below the runtime root, or while the mount table cannot be read.

Removal is not atomic:
- if the account, or the runtime root, cannot be removed, the steps after
it are not taken;
- a leftover home or group is reported, but the root and the unit are
still removed.

Either way the run exits 1, names what is left, and running `retire` again
continues from there. Only things RunnerSlice created are removed.

Between a partial failure and its retry, the files left behind are owned
by a uid and gid that no longer exist. The next system account created on
the host may be given the same ids. Finish the retirement before creating
other accounts.

Then delete the profile and apply the remaining runners. Their units drop the
mask for the retired root.
Expand All @@ -154,5 +181,37 @@ mask for the retired root.
| `check`: `NOT masked in namespace` | The running service does not have a mask its unit declares. Usually it was started before the unit changed. | `apply` with the runner idle restarts it with the current unit. |
| `check`: `differs from the rendering`, `unexpected drop-in` | Someone edited a unit or added a drop-in. | Remove the drop-in, then `apply`. |
| `check`: `runner version ... below the seed` | Self-update is not working. | Re-seed by hand, with the runner idle (`apply` prints how). Registration files survive an unpack. |
| `retire`: `processes of ... are still running` | A job left a process behind, possibly one that only kept the account as its saved uid. | Stop it (`ps -eo pid,ruid,euid,suid,cmd`), then `retire` again. Nothing was removed. |
| `retire`: `cannot tell whether any process runs as ...` | `/proc` could not be read. | Find out why. Nothing was removed. |
| `retire`: `userdel could not remove ...` | The account is still there. | Nothing else was removed. The unit and runtime root still identify the runner. Fix the cause, then `retire` again. |
| `retire`: `could not remove all of ...` | The account is gone; part of the runtime root is not, for example an immutable file. | The unit and the root's marker are kept. If the last `rmdir` failed, the marker is written back. Fix the cause, then `retire` again; it finishes the root, then the unit. |
| `retire`: `a filesystem is mounted at or below ...` | Something is mounted in the runtime root, for example a larger disk at `work/`. | Nothing was removed. Unmount it, and keep what is on it if you need it, then `retire` again. |
| `retire`: `cannot read the mount table` / `cannot look up account ...` | `/proc/self/mountinfo` was unreadable, or the account lookup failed rather than answering "no such account". | Nothing was removed. Find out why, then `retire` again. |
| `retire`: `group ... is left: this host also resolves accounts outside local files` | Accounts also come from a directory service (`nsswitch.conf`), so not every user of the gid can be listed. | Check that nothing uses the gid, then `groupdel <name>`. |
| `retire`: `could not remove /etc/systemd/system/...` | The unit file could not be deleted, for example on a read-only `/etc`. | Fix the cause, then `retire` again. |
| `retire`: `/home/... is still there without its account` | `userdel` removed the account but not its home. | Look at what is in it, then remove it by hand. Until then, `apply` refuses to create the account again. |
| `retire`: `group ... exists without its account` | The account is already gone, so RunnerSlice can no longer prove the group was its own. This is found on a later run, after the group was not removed on the run that removed the account. | If nothing else uses it (`getent group <name>`, `awk -F: '$4 == <gid>' /etc/passwd`), remove it by hand: `groupdel <name>`. |
| `retire` or `apply`: `refusing to remove ...` / `... exists and was not created by RunnerSlice` (runtime root) | The root has no marker, or the marker names another profile or is a symlink. RunnerSlice cannot prove the directory is this runner's, so it never takes it over or removes it. | See "A runtime root without its marker" below. |
| `apply`: `group ... exists without an account of that name` or `/home/... exists without an account` | A leftover of an earlier install, or someone else's. | If it is a leftover and nothing uses it, remove it by hand (`groupdel`, `rm -rf`), then `apply`. |
| `status`: `remote runner is not online` | GitHub does not see the runner. | Look at the service journal: `journalctl -u <service>`. |
| After a reboot | Units are enabled and start with the host. | Run `check`. Then run `status`. |

### A runtime root without its marker

`/var/lib/<prefix>-<id>/.runner-slice-root` is root-owned and names its
profile. Without it, RunnerSlice will not adopt or remove the directory.
That holds even if RunnerSlice created it, for example when someone deleted
the marker or restored the directory from a backup without it. Nothing
recreates the marker automatically. Writing a marker is a claim that the
whole directory is this runner's, and it is a person's decision:

1. Check that the runner is stopped: `systemctl status <service>`.
2. Look at what is in the directory. If any of it is not this runner's, move
that out first, or rename the profile and leave the directory alone.
3. If the runner was registered, deregister it on GitHub. Its `.credentials`
are in this directory.
4. Either remove the directory by hand, or restore the marker. To restore
it, run `printf '%s\n' <id> | sudo tee /var/lib/<prefix>-<id>/.runner-slice-root`,
then `sudo chown root:root` and `sudo chmod 0644` on the marker. The id
is the profile's file name without `.conf`.
5. Run `apply` or `retire` again.
19 changes: 14 additions & 5 deletions docs/threat-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Actions Runner Controller, or GARM with a VM provider.
| Everything else on the host: CPU, memory and process count | One slice for all runners with declared `CPUQuota`, `MemoryMax`, optional `MemoryHigh`, and `TasksMax` | The installed slice is compared with the rendering. systemd's effective values are compared with the declaration. |
| Declared network destinations (`slice-ip-deny`) | `IPAddressDeny=` on the slice. systemd merges it into every runner's own IP filter. | systemd's effective deny list includes each entry. No allow list exists on the runner, the slice or any slice above it. |
| What root runs and reads | Preflight refuses a configuration or tool tree that root does not own exclusively: other owners, group- or world-writable entries, symlinks, writable parent directories. | This is checked before every apply and check. |
| Units, accounts and directories RunnerSlice did not create | Units carry a first-line marker. Runtime roots carry a root-owned marker naming their profile. Accounts are adopted only if they are system accounts with the expected home. A group or home that predates its account is never adopted. | Apply stops before creating anything next to a foreign unit or directory. Retirement checks every precondition first, and removes nothing unless all hold. |
| Units, accounts and directories RunnerSlice did not create | Units carry a first-line marker. Runtime roots carry a root-owned marker naming their profile. Accounts are adopted only if they are system accounts with the expected home. A group or home that predates its account is never adopted. | Apply stops before creating anything next to a foreign unit or directory. Retirement checks every precondition first, and removes nothing unless all hold. A group is removed only when it is the account's own, unused primary group, read before the account goes, and only when every account comes from local files. Nothing is removed while a filesystem is mounted in the runtime root. |
| Running jobs | No unit is replaced and no runner is restarted while a job is running or its state is unknown. | The job state is read from the service's cgroup, whose path comes from systemd, and from `/proc`. |

Every runner unit also sets:
Expand Down Expand Up @@ -116,13 +116,22 @@ observed on a real host before it counts.
it, stores it or prints it. It prints the command for a person to run.
That command passes the token through the environment, never as an
argument: sudo logs command lines, and `ps` shows them to every account.
It is printed inside `( ... )`, so the token lives in a subshell and is gone
when the subshell ends, even if `config.sh` fails or is interrupted. A `gh`
that fails ends the subshell before `config.sh` runs.
- RunnerSlice never runs what the runner account can write. The installed
version is read from the runner's dependency manifest as data. Files the
runner writes are opened without following symlinks, only if they are
small regular files.
runner writes (`.runner`, `bin/Runner.Listener.deps.json`) are reached by
opening the runner directory, which sits in a root-owned runtime root, and
then each component below it with `O_NOFOLLOW`. `O_NOFOLLOW` alone covers
only the last component, so the walk is what refuses a symlinked `bin/`.
Only a small regular file is read. Anything that cannot be read or parsed
that way, including a parser error such as deep nesting, is "cannot tell"
(exit 2), never a pass.
- A registered runner's directory is never unpacked into again. A first
unpack goes into a directory root has just created, closed to the runner
account until it is handed over.
unpack goes into a directory root has just created, mode 0700 for the whole
unpack (`tar --no-overwrite-dir` keeps the archive's own mode off it), and
handed to the runner account only after.
- `.runner` holds the runner's name, repository and work folder, and no
credential. RunnerSlice reads it to refuse a runner registered as something
else.
Expand Down
15 changes: 15 additions & 0 deletions docs/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,21 @@ recorded commit. Each item is marked:
Unknown job state could not be produced safely on a healthy host as root, so
it remains SYNTHETICALLY TESTED. x86_64 is not verified.

The retirement and reader changes from the post-acceptance review (#18) were
run on the same VM, at RUNTIME VERIFIED, with a test-only profile that was
never registered. That run covered:

- leftover processes, by effective and by saved uid;
- `userdel` failing;
- a runtime root that could only be partly removed, and the retry after it;
- `USERGROUPS_ENAB no`;
- a group in use, and a leftover home;
- a symlinked `bin/`;
- the unpack mode.

The results are in [the acceptance record](acceptance/2026-10-arm64.md). An
unreadable `/proc`, and malformed runner files, remain SYNTHETICALLY TESTED.

Each run records:

- the RunnerSlice commit and tree;
Expand Down
Loading