test: run every job on default without root, add a security check and BuildKit #2

Merged
info merged 3 commits from nonroot into main 2026-10-26 20:13:40 +00:00
Contributor

The Kubernetes executor runs no job as root (ADR 0018). The runner change is https://gitlab.com/digilab.overheid.nl/platform/flux/core/-/merge_requests/1180. Merge this pull request after that change is on digikluster.

What changes

  • 00-security-context.yml is new. It checks the uid, the capabilities, no-new-privileges, seccomp, the service account token and the network path to the Kubernetes API.
  • 05a and 05b (kaniko) move to the label vm and start by hand. kaniko needs uid 0.
  • 05d-image-buildkit.yml is new. It tries rootless BuildKit instead of kaniko. The label is an input.
  • 04 and 06 set PGDATA: /tmp/pgdata. The default PGDATA belongs to uid 999.
  • 07, 11 and 12 install no packages. They use images that have the tools, and put crane in /tmp/bin.
  • The README has the rules for the label default.

Results on the current runner (root), 2026-10-26

  • All push workflows pass, except 00. 00 fails with uid=0(root), as expected.
  • 05d on default fails: max_user_namespaces needs to be set to non-zero, then fork/exec /proc/self/exe: operation not permitted.

Run all workflows on this branch again after the runner change. 00 must then pass.

The Kubernetes executor runs no job as root (ADR 0018). The runner change is https://gitlab.com/digilab.overheid.nl/platform/flux/core/-/merge_requests/1180. Merge this pull request after that change is on digikluster. ## What changes - `00-security-context.yml` is new. It checks the uid, the capabilities, no-new-privileges, seccomp, the service account token and the network path to the Kubernetes API. - `05a` and `05b` (kaniko) move to the label `vm` and start by hand. kaniko needs uid 0. - `05d-image-buildkit.yml` is new. It tries rootless BuildKit instead of kaniko. The label is an input. - `04` and `06` set `PGDATA: /tmp/pgdata`. The default `PGDATA` belongs to uid 999. - `07`, `11` and `12` install no packages. They use images that have the tools, and put crane in `/tmp/bin`. - The README has the rules for the label `default`. ## Results on the current runner (root), 2026-10-26 - All push workflows pass, except `00`. `00` fails with `uid=0(root)`, as expected. - `05d` on `default` fails: `max_user_namespaces needs to be set to non-zero`, then `fork/exec /proc/self/exe: operation not permitted`. Run all workflows on this branch again after the runner change. `00` must then pass.
test: run every job on default without root, add a security check and BuildKit
Some checks failed
00 Security context / no-root (push) Failing after 4s
02 Node.js / node (push) Successful in 4s
01 Go and Rust / go-lint (push) Successful in 17s
01 Go and Rust / rust (push) Successful in 18s
03 Python / python (push) Successful in 9s
01 Go and Rust / go (push) Successful in 21s
07 Helm, Kustomize and OpenTofu / helm-kustomize (push) Successful in 19s
07 Helm, Kustomize and OpenTofu / tofu (push) Successful in 5s
06 Service containers / postgres (push) Successful in 39s
09 Security scans / trivy (push) Successful in 18s
04 Java / maven (push) Successful in 48s
05c Image with ko / ko (push) Successful in 55s
11 Registry push and pull / push (push) Successful in 13s
10a Multi-arch with ko / ko-multiarch (push) Successful in 27s
11 Registry push and pull / pull (push) Successful in 21s
12 Registry throughput / throughput (push) Successful in 48s
58c75a006c
The Kubernetes executor runs no job as root (ADR 0018). Each job and each service
container runs as uid 1000 with no capabilities.

- 00 checks the uid, the capabilities, no-new-privileges, seccomp, the service account
  token and the network path to the Kubernetes API.
- 05a and 05b move to the label vm. kaniko needs uid 0.
- 05d tries rootless BuildKit instead of kaniko.
- 04 and 06 set PGDATA, because the default PGDATA belongs to uid 999.
- 07, 11 and 12 install no packages. They use images that have the tools.
Author
Contributor

Results after platform/flux/core!1180, 2026-10-26, on the organisation runner digikluster-k8s-forgejo:

  • 00: passes. uid=1000 gid=1000, CapPrm, CapEff and CapBnd are 0, NoNewPrivs: 1, Seccomp: 2, no token, the Kubernetes API and 169.254.169.254 are blocked.
  • 01 to 04, 05c, 06 to 12: all pass. The PostgreSQL service of 06 starts as uid 1000 with PGDATA: /tmp/pgdata.
  • 05d on default: fails as expected. user.max_user_namespaces: 0, then fork/exec /proc/self/exe: operation not permitted.

This pull request can merge.

Results after platform/flux/core!1180, 2026-10-26, on the organisation runner `digikluster-k8s-forgejo`: - `00`: passes. `uid=1000 gid=1000`, `CapPrm`, `CapEff` and `CapBnd` are 0, `NoNewPrivs: 1`, `Seccomp: 2`, no token, the Kubernetes API and `169.254.169.254` are blocked. - `01` to `04`, `05c`, `06` to `12`: all pass. The PostgreSQL service of `06` starts as uid 1000 with `PGDATA: /tmp/pgdata`. - `05d` on `default`: fails as expected. `user.max_user_namespaces: 0`, then `fork/exec /proc/self/exe: operation not permitted`. This pull request can merge.
test: make the runner label of 05a an input
All checks were successful
01 Go and Rust / go (push) Successful in 13s
01 Go and Rust / rust (push) Successful in 14s
01 Go and Rust / go-lint (push) Successful in 16s
00 Security context / no-root (push) Successful in 18s
02 Node.js / node (push) Successful in 4s
03 Python / python (push) Successful in 8s
07 Helm, Kustomize and OpenTofu / helm-kustomize (push) Successful in 4s
05c Image with ko / ko (push) Successful in 23s
09 Security scans / trivy (push) Successful in 11s
06 Service containers / postgres (push) Successful in 39s
07 Helm, Kustomize and OpenTofu / tofu (push) Successful in 37s
11 Registry push and pull / push (push) Successful in 7s
11 Registry push and pull / pull (push) Successful in 7s
04 Java / maven (push) Successful in 1m9s
10a Multi-arch with ko / ko-multiarch (push) Successful in 35s
868add31b7
test: note that BuildKit needs root or user namespaces
All checks were successful
01 Go and Rust / go-lint (push) Successful in 7s
01 Go and Rust / rust (push) Successful in 11s
02 Node.js / node (push) Successful in 5s
01 Go and Rust / go (push) Successful in 13s
00 Security context / no-root (push) Successful in 18s
03 Python / python (push) Successful in 8s
07 Helm, Kustomize and OpenTofu / helm-kustomize (push) Successful in 4s
05c Image with ko / ko (push) Successful in 23s
08 Release and write back / write-back (push) Successful in 4s
08 Release and write back / release (push) Successful in 3s
08 Release and write back / helm-push (push) Successful in 7s
07 Helm, Kustomize and OpenTofu / tofu (push) Successful in 37s
04 Java / maven (push) Successful in 1m23s
09 Security scans / trivy (push) Successful in 12s
11 Registry push and pull / push (push) Successful in 11s
12 Registry throughput / throughput (push) Successful in 21s
11 Registry push and pull / pull (push) Successful in 4s
10a Multi-arch with ko / ko-multiarch (push) Successful in 41s
06 Service containers / postgres (push) Successful in 2m7s
52a84d9d09
info merged commit 52a84d9d09 into main 2026-10-26 20:13:40 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
forgejo/runner-tests!2
No description provided.