2026-11-27 05:42:39 +00:00
# Pod Security posture (2026-11-27)
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
Status of Pod Security Admission (PSA) labels per namespace, why one workload
still needs `privileged` , and what is enforced where. Two namespaces now
*enforce*, not just warn: `forgejo` at `baseline` and the CI capsule
2026-11-27 01:20:56 -05:00
`ci-runners` at `privileged` .
2026-11-27 05:42:39 +00:00
## Levels in use
| level | namespaces |
|---|---|
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
| `enforce: baseline` + `warn` /`audit: restricted` | `cert-manager` , `customer1` , `forgejo` , `metabase` , `osint` , `piedmont` , `secops` , `sirius-growth` , `siriusdevops` |
2026-11-27 01:20:56 -05:00
| `enforce: privileged` + `warn` /`audit: privileged` | `ci-runners` (the Actions CI capsule) |
| `enforce: privileged` + `warn` /`audit: restricted` | `logging` |
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
| `warn` /`audit: restricted` only | `netsec` , `monitoring` , `node-io` , `internal` , `gateway-system` , `local-path-storage` , plus cluster-owned `kube-system` , `kube-public` , `kube-node-lease` , `default` , `cnpg-system` , `cilium-secrets` , `flux-system` |
2026-11-27 05:42:39 +00:00
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
The enforced set was picked by reading the live workload templates first: every
namespace in it had zero baseline violations (no `privileged` , no
`hostNetwork` /`hostPID` /`hostIPC` , no `hostPath` , no `hostPort` , no capability
additions, no `seccompProfile: Unconfined` ) on 2026-11-27. Enforcement is per
*pod creation*, so a namespace that later needs one of those shapes has to be
moved to warn/audit deliberately, with a comment in Git, instead of being
allowed by accident.
2026-11-27 05:42:39 +00:00
The warn/audit-only set is the opposite list — each one hosts a workload that
baseline forbids today:
| namespace | blocker |
|---|---|
| `kube-system` | Cilium agent/envoy (hostNetwork, hostPath, privileged init, hostPorts), static control-plane pods |
| `monitoring` | node-exporter (hostNetwork + hostPID + hostPath `/proc` ,`/sys` ,`/` ) |
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
| `logging` | Alloy DaemonSet (hostPath `/var/log` , journal, machine-id) — enforced at `privileged` because the shape is expected |
2026-11-27 05:42:39 +00:00
| `netsec` | hubble-flow-collector (hostPath socket + log dir) |
| `node-io` | etcd-io-guard (privileged, hostPID, hostPath) |
| `local-path-storage` | provisioner helper pods are privileged (created on every PVC) |
| `internal` , `gateway-system` | reserved for hostNetwork Cilium Gateway listeners |
`kube-system` , `kube-public` , `kube-node-lease` , `default` , `cnpg-system` ,
`cilium-secrets` , `logging` and `flux-system` are not declared in this repo
(created by kubeadm/Helm/Flux), so their warn/audit labels are applied
out-of-band; re-apply them after a control-plane rebuild:
```sh
for ns in kube-system kube-public kube-node-lease default cnpg-system cilium-secrets logging flux-system; do
kubectl label ns "$ns" --overwrite \
pod-security.kubernetes.io/warn=restricted \
pod-security.kubernetes.io/warn-version=latest \
pod-security.kubernetes.io/audit=restricted \
pod-security.kubernetes.io/audit-version=latest
done
```
2026-11-27 01:20:56 -05:00
## The Forgejo CI capsule (`ci-runners`)
2026-11-27 05:42:39 +00:00
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
The three Actions runners (`forgejo-runner-amd64` , `forgejo-runner-arm64` ,
`forgejo-runner-deploy-arm64` ) each carry a docker-in-docker sidecar with
`privileged: true` , and the nightly prune CronJob mounts the Pi's host
`/var/run/docker.sock` . PSA has no per-workload exception, and baseline rejects
both shapes (`privileged` , `hostPath` ) at admission. While those pods lived in
`forgejo` , that namespace could only ever be warn/audit — which is why
originally * nothing * in the cluster enforced.
The fix is the first option that was open: the **CI capsule moved to its own
namespace**, `apps/base/forgejo/runner-namespace.yaml` , which enforces PSA at
`privileged` * on purpose * , and `forgejo` now enforces `baseline` . This is
containment, not a new grant: the dind sidecar was already privileged. What the
split buys:
* `forgejo` (Forgejo itself, the CNPG Postgres cluster, the nightly
cluster-backup CronJob) is now protected by admission — a future privileged,
hostPath or hostNetwork pod added there is rejected instead of silently
accepted;
* the only namespace allowed to run a privileged pod is the one whose name says
so, labelled as such in Git, and it holds nothing but the CI capsule;
2026-11-27 01:20:56 -05:00
* the capsule's `warn` /`audit` are `privileged` as well (the operator's decision):
they emit nothing because everything there is allowed by design, and the
namespace is reviewed in Git rather than at admission.
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
2026-11-27 01:20:56 -05:00
What is inside `ci-runners` : the three runner Deployments, their PVCs
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
(`forgejo-runner-amd64` on siriussec's local-path, `forgejo-runner-arm64-dind`
200 Gi and `forgejo-runner-deploy-arm64-dind` 40 Gi as static Retain PVs on
rpi), the `forgejo-runner-config` ConfigMap, the two registration-token
Secrets, and the prune ServiceAccount/Role/RoleBinding/ConfigMap/CronJob. The
capsule's Deployments use the namespace's `default` ServiceAccount, which has
**no** RBAC; only the prune Job can `get/list` pods and `create pods/exec` , and
only in this namespace.
What was already removed from the runner shape (same change, card
`t_2bbe34a8` ):
* the runner container no longer runs as uid 0 — it uses the image's uid 1000,
and the dind socket is created `0660 root:1000` via `dockerd --group 1000`
(which also removes the old one-shot `chmod 666` race that forced root);
* CI **job ** containers are no longer privileged (`container.privileged: false`
in the runner ConfigMap) — previously every job container was privileged
inside a privileged dind;
* the runners have no `hostPath` , no `hostNetwork` and no host docker socket;
the only hostPath left in the capsule is the prune Job's Pi socket.
Residual risk, stated plainly: a privileged dind container is node root on the
node it runs on, and a CI job can reach that daemon socket by design. The
2026-11-27 02:08:47 -05:00
capsule therefore means "trusted CI code" rather than isolation. The one
hardening path that changes what `privileged: true` * means * is a virtualised
runtime behind a `RuntimeClass` ; it was evaluated and staged on one runner —
see below.
## `enforce: baseline` on `ci-runners` is unreachable by any runtime (measured)
All three candidate runtimes were installed on **both ** arches and exercised
against the live cluster on 2026-11-27 (v1.36.4, containerd 2.3.4/2.3.5, Cilium
native routing). Architecture was never the blocker: sysbox-ce 0.7.2 ships an
arm64 `.deb` , gVisor publishes `gvisor-aarch64` , Kata publishes
`kata-static-4.4.0-arm64` , and `/dev/kvm` exists on siriussec **and ** rpi.
The blocker is a contradiction, not a bug:
> PSA `baseline` forbids adding any capability outside `AUDIT_WRITE, CHOWN,
> DAC_OVERRIDE, FOWNER, FSETID, KILL, MKNOD, NET_BIND_SERVICE, SETFCAP, SETGID,
> SETPCAP, SETUID, SYS_CHROOT` — and every nested dockerd needs `SYS_ADMIN`
> (overlay, mounts) + `NET_ADMIN` (docker0, iptables) **in the pod spec**.
Measured verdicts, each on a live cluster:
| runtime | verdict |
|---|---|
| sysbox-ce 0.7.2 | The only one **admitted ** at `enforce: baseline` with a clean spec (id-mapped userns, `uid_map 0 427680 65536` ), but its inner dockerd cannot use the CNI-owned pod netns: `Failed to create bridge docker0 via netlink: operation not permitted` , `iptables ... Could not fetch rule set generation id: Permission denied` , and with `--bridge=none` every `docker run` dies on `failed to set into network namespace ... operation not permitted` . sysbox also bans inner `--net=host` , so there is no egress fallback. Also needs `enable_unprivileged_ports=false` + `enable_unprivileged_icmp=false` under containerd 2.x. |
| gVisor | Full CI shape works (nested run, pull, build, overlay2) **only ** with `capabilities.add: ["ALL"]` ; with a baseline-clean spec dockerd never starts (`failed to mount overlay: operation not permitted` ). |
| Kata 4.4.0 | `privileged: false` hits the same caps wall * inside the guest * . With `privileged: true` the whole CI shape works on amd64 **and ** arm64 (nested run, bridge+NAT egress, `docker build` ) — but `/var/lib/docker` is virtiofs, overlayfs refuses it, and Docker falls back to `vfs` . |
So the letter of the original audit finding (drop `privileged` , enforce
`baseline` ) cannot be met by swapping a runtime; only reworking CI off
docker-in-docker could, and that rewrites every workflow. The operator's
decision (card `t_8aa4af50` ) was to take the one option that changes the
*consequence* of the flag, staged to a single runner.
## Kata microVM on the deploy runner (`forgejo-runner-deploy-arm64`, staged)
`forgejo-runner-deploy-arm64` (rpi) now runs with
`runtimeClassName: kata-qemu` . **Read this precisely: **
* the pod **still declares `privileged: true` ** and `ci-runners` **still
enforces `privileged` **. Nothing about this namespace's PSA level changed; a
privileged pod in `forgejo` is still rejected;
* what changed is the blast radius: the dind sidecar and the job containers
live in a QEMU/KVM microVM with no host namespaces, no host kernel and only
the volumes the pod mounts. An escape from CI has to beat KVM, not just the
container runtime. On a runc runner the same flag is direct root on rpi;
* `forgejo-runner-amd64` and `forgejo-runner-arm64` are untouched (still
privileged dind under runc), so `docker-amd64` and `runs-on: docker` are
unchanged. Converting them is a separate decision, taken on the measured cost
of this one.
How it is wired (all in `apps/base/forgejo/` ):
* `kata-runtimeclass.yaml` — `RuntimeClass` `kata-qemu` , handler `kata-qemu` ;
* rpi's containerd has the handler via the drop-in
`/etc/containerd/conf.d/50-kata.toml` (`io.containerd.kata.v2` ,
`privileged_without_host_devices = true` — a privileged container otherwise
receives all 218 of the node's `/dev` nodes, which is meaningless inside a VM
and makes runtime-rs fail the create with `get host path failed` ), with
kata-static 4.4.0 under `/opt/kata` and
`/etc/kata-containers/configuration.toml` symlinked to the runtime-rs QEMU
config;
* the dind sidecar builds its own ext4 data-root: a 16 GiB image file at
`/data-docker/kata-ext4.img` on the existing claim, attached with
`losetup /dev/loop0` (the guest has to `mknod` the node — only
`/dev/loop-control` exists) and mounted at `/var/lib/docker` . This is what
restores `overlay2` ; without it Docker silently uses `vfs` ;
* the guest kernel has **no ** binfmt registrations (the host's are not visible
from inside the VM), so every start mounts `binfmt_misc` and runs
`tonistiigi/binfmt --install amd64` . Without that, `deploy-site.yml` 's
`docker buildx build --platform linux/amd64` dies with `exec format error` /
`buildkit-qemu-x86_64: executable file not found` ;
* the runner container waits for `/var/run/dind-ready` , which the dind sidecar
touches **after ** the data-root and binfmt are set up, so a job can never
start against a half-initialised daemon.
Rollback is one field: drop `runtimeClassName: kata-qemu` from that Deployment
(Flux) — the pod returns to runc/privileged dind on the same claim, and the
`kata-ext4.img` is an unused file until then (it is a cache; deleting it is
safe). The containerd drop-in on rpi is inert once no pod asks for the handler.
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
## Why the dind sidecar keeps `privileged` (measured, do not re-derive)
2026-11-27 05:42:39 +00:00
Three independent attempts to drop the flag were measured live on 2026-11-27
(siriussec, kernel 6.18.50-lts; rpi reproduced the procfs failure):
1. **Explicit capability set ** (`privileged: false` ,
`capabilities.add: [SYS_ADMIN, NET_ADMIN]` ): dockerd starts and pulls
images, but no container starts —
`runc create failed: ... mkdir /sys/fs/cgroup/docker: read-only file system` .
kubelet mounts `/sys/fs/cgroup` read-only for non-privileged pods. PSA
baseline also forbids adding `SYS_ADMIN` /`NET_ADMIN` , so this shape cannot
live in an enforced namespace at all.
2. **Rootless dind ** (`docker:27-dind-rootless` , uid 1000, vpnkit network):
the daemon initialises and pulls images, but every container fails with
`error mounting "proc" to rootfs at "/proc": operation not permitted` . A
nested user namespace may only mount a fresh procfs if a fully visible
procfs already exists in the namespace (kernel `mount_too_revealing` ), and
kubelet masks a number of `/proc` paths in every pod.
3. * * `procMount: Unmasked` ** fixes (2), but the API only accepts it with
`hostUsers: false` . In a user-namespace pod `newuidmap` cannot write a
subuid map (it is not setuid-root inside that namespace) and `mknod
/dev/net/tun` is refused, so rootless dind has neither a uid map nor the
tun device it needs for networking.
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
## Verification
2026-11-27 05:42:39 +00:00
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
```sh
# no privileged container left in the Forgejo namespace (empty output = pass)
kubectl -n forgejo get pods -o jsonpath='{..securityContext.privileged}'
# forgejo enforces baseline; the capsule is explicitly privileged + audited
2026-11-27 01:20:56 -05:00
kubectl get ns forgejo ci-runners -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.metadata.labels}{"\n"}{end}'
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
# admission really rejects the shape in forgejo (expect Forbidden)
kubectl -n forgejo run probe-bad --image=busybox --restart=Never \
--overrides='{"spec":{"containers":[{"name":"p","image":"busybox","securityContext":{"privileged":true}}]}}'
# the prune CronJob (and its RBAC) now live in the capsule
2026-11-27 01:20:56 -05:00
kubectl -n ci-runners get cronjob,role,rolebinding,sa -l app=forgejo-runner
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
```