Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 31 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ Entries are written for someone upgrading: what they have to do, and what will
behave differently. Versions follow the evidence, as set out in
[docs/contract.md](docs/contract.md), not a calendar.

## Unreleased
## Unreleased (public alpha)

There is no release yet. Everything below is SYNTHETICALLY TESTED only. None
of it has run on a real host.
There is no release or tag yet. Everything below is SYNTHETICALLY TESTED by
the drills, which run on GitHub-hosted CI for every change. The lifecycle has
also been RUNTIME VERIFIED and REBOOT VERIFIED on one Ubuntu 24.04 aarch64 host
with systemd 255 ([docs/acceptance/2026-10-arm64.md](docs/acceptance/2026-10-arm64.md)).
Nothing has run on x86_64.

- **Declarative inventory:**
- one policy file, one release seed and one profile per runner;
Expand Down Expand Up @@ -43,3 +46,28 @@ of it has run on a real host.
- check fails when an access test cannot run;
- masks are recognised by the mount's root only;
- `TMPDIR` is ignored, and paths are resolved physically.
- **Fixes from the real ARM64 host:**
- the release archive carries 0644/0755 modes, so preflight accepts the
unpacked tree;
- `check` reads `RestrictNamespaces=yes` and `no` as systemd prints them;
- the printed registration never uses `--replace`, and runs `config.sh` in
its own directory;
- `config.sh remove` is printed without `--unattended`, which it rejects.
- **Fixes from the post-acceptance review (#18):**
- leftover processes are found by every uid in `/proc`, and an unreadable
process table refuses retirement;
- retirement removes the account, then the runtime root with its marker
last, then the unit, so a run that fails part-way can be finished by
another;
- only the account's own unused group is removed, and a leftover home or
group is reported by name;
- runner-written files are read without following any symlink below the
runner directory; any parse failure is "cannot tell";
- the printed token commands run in a subshell;
- the runner directory stays 0700 for the whole unpack;
- retirement removes nothing while a filesystem is mounted in the runtime
root, or while the mount table or an account lookup cannot be read;
- a group is kept when accounts also come from a directory service.
- **Behaviour an operator will notice:**
- preflight warns on any systemd other than 255;
- `retire` exits 1 when it leaves something behind, and names it.
27 changes: 16 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@ afterwards:
- head branches deleted automatically after merge;
- auto-merge disabled.

**Not yet enforced.** While the repository is private on the organisation's
Free plan, GitHub offers no branch protection and no rulesets. So the following
are procedure, not settings:
**Enforced on `main`** by a repository ruleset, since the repository became
public on 2026-10-16:

- the `gate` check must pass before a merge;
- no force push to `main`;
- no deletion of `main`.
- changes arrive through a pull request, merged by rebase only;
- the `gate` check must pass;
- linear history;
- no force push, and no deletion.

When the repository becomes public they become settings: `gate` required,
linear history required, force pushes and deletion refused. Administrators
will not be included, so that an outage of GitHub Actions cannot block a
release; the owner can override.
Repository administrators can bypass the ruleset only when merging a pull
request, never with a direct push. An outage of GitHub Actions therefore
cannot block a fix, while force pushes and deletion stay refused for
everyone.

**Pull requests from forks** need a maintainer's approval before their
workflows run.

**No required review.** This is a one-person repository, so a required review
would stop every merge. Every merge is an explicit owner decision. A green
Expand Down Expand Up @@ -95,7 +98,9 @@ drill case fails.
The `check` workflow runs on GitHub-hosted runners only, with a read-only
token. Code from a pull request never runs on a host RunnerSlice manages.
Dogfood runs, where RunnerSlice's own runners test RunnerSlice, happen in a
separate private repository on commits the owner has approved. See
separate private repository on commits the owner has approved. No
self-hosted runner is registered to this repository, so a pull request here
cannot reach one. See
[docs/verification.md](docs/verification.md).

## Security reports
Expand Down
49 changes: 37 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@ the running host, that the boundary and limits are what you declared.
It is Bash and systemd. It has no daemon, no database, no Kubernetes and no
web server.

> **Status: pre-release (0.1.0-dev).**
> **Status: public alpha (0.1.0-dev). There is no release or tag yet.**
>
> - Every behaviour described here is exercised by drills against a fixture
> host. That is SYNTHETICALLY TESTED.
> - The full lifecycle has also run on **one real host**: an Ubuntu 24.04
> aarch64 VM with two real GitHub runners. It went from install to
> registration, jobs, pool, busy guard, reboot, deregistration and
> retirement ([docs/acceptance/2026-10-arm64.md](docs/acceptance/2026-10-arm64.md)).
> - RunnerSlice's own drills ran there as GitHub Actions jobs, on runners
> - **Every push and pull request** runs shellcheck and every drill on
> GitHub-hosted runners (the `check` workflow). The drills exercise each
> behaviour against a fixture host. That is SYNTHETICALLY TESTED.
> - **The full lifecycle has run on one real host:** an Ubuntu 24.04 aarch64
> VM with systemd 255 and two real GitHub runners. It went from install to
> registration, jobs, pool, busy guard, the slice limits, reboot,
> deregistration, retirement and recovery from a retirement that failed
> part-way ([docs/acceptance/2026-10-arm64.md](docs/acceptance/2026-10-arm64.md)).
> - **RunnerSlice's own drills ran there as GitHub Actions jobs**, on runners
> RunnerSlice installed and managed.
> - **Not verified:** x86_64, other distributions, and GitHub-hosted CI for
> this repository. GitHub-hosted CI is currently blocked by the
> organisation's billing.
> - No release exists. Use a machine you can afford to rebuild.
> - **Not verified:**
> - x86_64, and any systemd other than 255;
> - a runner's self-update;
> - `runner-slice status` with an authenticated `gh`;
> - an unknown job state and a misregistration on a real host.
>
> Use a machine you can afford to rebuild.

## Why

Expand Down Expand Up @@ -75,6 +80,18 @@ RunnerSlice's answer:

The full security model is in [docs/threat-model.md](docs/threat-model.md).

## Compared with other tools

| | Isolation | Bounds the rest of the host | Persistent per-repository runners |
|---|---|---|---|
| `actions/runner`'s `svc.sh` | none beyond the account you choose | no | yes, one unit each, no limits |
| Actions Runner Controller, GARM | pods or VMs, ephemeral | not on a shared host | no: ephemeral by design |
| **RunnerSlice** | a Unix account and systemd sandbox per runner | yes: one slice with declared limits, plus masks | yes |

Choose ephemeral runners when untrusted code runs. Choose RunnerSlice when
you trust the repositories, want to reuse a server you already operate, and
need to bound and verify what CI can take from it.

## How it works

```text
Expand Down Expand Up @@ -105,6 +122,14 @@ preflight accepts. What is supported is narrower: **verified so far, Ubuntu
other than 255. [docs/compatibility.md](docs/compatibility.md) is the only list of
what has been verified.

## Getting started

1. Read [Installation](docs/installation.md): requirements, and how to
install from a checkout until the first release exists.
2. Write the inventory ([Configuration](docs/configuration.md)), then follow
[Operations](docs/operations.md) from `plan` to the first registered runner.
3. Run `sudo runner-slice check` after every change and every reboot.

## Documentation

| | |
Expand Down
14 changes: 6 additions & 8 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ report a problem and what counts as one.
## Reporting a vulnerability

Report it privately, through GitHub's private vulnerability reporting for this
repository (**Security → Report a vulnerability**). Never use a public issue.
Include the RunnerSlice commit or version, the host's distribution and systemd
version, and the smallest inventory that shows the problem.

While the repository is private, that form is not available. Report to the
maintainer directly through GitHub.
repository: [Security → Report a vulnerability](https://github.com/swarea/runner-slice/security/advisories/new).
Never use a public issue or pull request. Include the RunnerSlice commit or
version, the host's distribution and systemd version, and the smallest
inventory that shows the problem.

Expect a first reply within a week. There is no bounty and no formal SLA. A fix
is released together with a note that says what was affected and what an
operator has to do.

## Supported versions

There is no release yet. Once there is, only the latest release receives
fixes.
There is no release yet. Until there is, fixes land on `main` only. Once
there is, only the latest release receives fixes.

## In scope

Expand Down
13 changes: 13 additions & 0 deletions docs/acceptance/2026-10-arm64.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ file.
| 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. |
| e2e58f8, 90f7ec8 | The mount refusal after the independent review. 90f7ec8 is the tree merged to `main`. |

## Dogfood jobs

Expand Down Expand Up @@ -90,6 +91,18 @@ and the host listing matched its state from before.
| `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. |

An independent review of 7f84c01 then found that retirement could empty a
filesystem mounted in the runtime root. The fix and its follow-up, 90f7ec8
(tree 84a0cec, which became `main`), were installed on the same VM, again
with all 49 files compared with the commit:

| Case | Observed |
|---|---|
| A tmpfs mounted at `/var/lib/rs-probe/work`, holding a file | `retire` exited 1: `a filesystem is mounted at or below /var/lib/rs-probe`. Nothing was removed. The file on the mount, the account and the marker were all still there. |
| The same, after `umount` | `retire` removed the account, the root and the unit, and exited 0. Nothing of the probe was left. `/etc/passwd`, `/etc/group` and `/etc/login.defs` matched their checksums from before. |

The drills inside the VM ran as `nobody`: 545 cases, 0 failed.

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,
Expand Down
26 changes: 14 additions & 12 deletions docs/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,21 +181,23 @@ run against one recorded commit.
|---|---|
| Foundation | contract agreed; core extracted; drills pass here (SYNTHETICALLY TESTED) |
| Alpha | preflight, converge, register, status and conformance ported; one runner REAL CLIENT VERIFIED on the test VM |
| Beta | pools, busy guard, idempotent re-apply and retire RUNTIME VERIFIED on the test VM; security and docs reviewed |
| Beta | pools, busy guard, idempotent re-apply and retire RUNTIME VERIFIED on the test VM; security and docs reviewed; `status` REAL CLIENT VERIFIED with an authenticated `gh`; one x86_64 host RUNTIME VERIFIED; a runner self-update observed |
| 1.0 | fresh install from the docs alone; dogfood and lifecycle acceptance complete; REBOOT VERIFIED; release archive with checksums |

The version follows the evidence. No stage is skipped to reach a number.

## Open decisions (owner)

Decided on 2026-10-15: the name (decision 0003), the MIT licence, and a
private `swarea/runner-slice` repository with rebase-only merges. Still open,
each a separate approval:

- **Public visibility**, and the first release.
- **The verification VMs:** an ARM64 VM on the maintainer's laptop, and a
short-lived x86_64 cloud VM with a cost cap.
- **The private dogfood repository** (proposed: `swarea/runner-slice-dogfood`),
and the registration-token steps.
- **Hosted CI minutes** for the private repository, which are currently
blocked by billing.
Decided:

- on 2026-10-15: the name (decision 0003), the MIT licence, and rebase-only
merges;
- the ARM64 verification VM and the private dogfood repository
`swarea/runner-slice-dogfood`, used for the acceptance of 2026-10-15/16;
- on 2026-10-16: public visibility. Hosted CI for a public repository needs
no paid minutes.

Still open, each a separate approval:

- **the first release and tag**;
- **an x86_64 verification host**, and its cost.
5 changes: 3 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Installation

> **Status: pre-release.** These steps were carried out on one real host: an
> Ubuntu 24.04 aarch64 VM ([acceptance/2026-10-arm64.md](acceptance/2026-10-arm64.md)).
> **Status: public alpha, no release yet.** These steps were carried out on
> one real host: an Ubuntu 24.04 aarch64 VM with systemd 255
> ([acceptance/2026-10-arm64.md](acceptance/2026-10-arm64.md)).
> No x86_64 host has been verified. Use a machine you can afford to rebuild.

## Requirements
Expand Down
2 changes: 1 addition & 1 deletion docs/operations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Operations

> **Status: pre-release.** The lifecycle below was run end to end on one real
> **Status: public alpha.** The lifecycle below was run end to end on one real
> Ubuntu 24.04 aarch64 host with two GitHub runners
> ([acceptance/2026-10-arm64.md](acceptance/2026-10-arm64.md)). Unknown job state
> and misregistration are exercised by drills only.
Expand Down
19 changes: 14 additions & 5 deletions docs/verification.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ reported as SKIPPED or BLOCKED, never as passed.
| Synthetic | `tests/*-drill.sh`, which CI runs | The real scripts, unmodified, against a fixture host. |
| Integration | a disposable VM, by hand | Real systemd, cgroups, accounts, registration and GitHub jobs: the lifecycle acceptance below. |
| Dogfood | a separate private repository, on that VM | RunnerSlice's own drills, run by runners RunnerSlice manages. |
| Public CI | the `check` workflow, on GitHub-hosted `ubuntu-24.04` | `tests/run.sh` on every push to `main` and every pull request. It never runs on a self-hosted runner. |

### Static and synthetic

Expand Down Expand Up @@ -121,8 +122,16 @@ never registered. That run covered:
- 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.
The refusal to retire a root with a filesystem mounted in it was verified
the same way, at 90f7ec8. The results are in
[the acceptance record](acceptance/2026-10-arm64.md). An unreadable `/proc`,
an unreadable mount table, directory-service accounts and malformed runner
files remain SYNTHETICALLY TESTED.

Public CI first ran on 2026-10-16, once the repository became public.
`main` at 1b5fa57 (tree 84a0cec) passed in run 38925260191, on a
GitHub-hosted `ubuntu-24.04` runner: shellcheck on 20 scripts, then 545 drill
cases, 0 failed.

Each run records:

Expand Down Expand Up @@ -152,9 +161,9 @@ Creating either environment needs owner approval, and so does any cost.

### Dogfood

The integration VM's runners are registered to a separate private repository,
proposed as `swarea/runner-slice-dogfood`. They are not registered to this
repository.
The integration VM's runners were registered to a separate private
repository, `swarea/runner-slice-dogfood`, never to this one. They were
retired when the acceptance ended.

- **Its workflow** checks out an owner-approved commit of RunnerSlice by SHA,
and runs `tests/run.sh` on the VM's runners.
Expand Down