Audit finding F6 (2026-11-27-cluster-netsec-audit.md). Runners (all three Deployments): * runner container no longer runs as uid 0 — image uid 1000. The dind socket is now created 0660 root:1000 via `dockerd --group 1000`, which removes the one-shot `chmod 666` race that was the reason for running as root; a scoped fix-data-perms init container re-owns runner.ini + the actions cache. * CI *job* containers are no longer privileged (container.privileged: false) — previously every job container was privileged inside a privileged dind. Pod Security: * enforce baseline on the eight namespaces that have zero baseline violations (customer1, metabase, osint, piedmont, secops, sirius-growth, siriusdevops, cert-manager), warn+audit restricted everywhere else (repo-declared and cluster-owned), so the next privileged/hostPath/hostNetwork pod is visible. * forgejo itself stays warn/audit: the runner dind sidecar cannot lose privileged on these nodes (documented in docs/pod-security.md, with the three measured failure modes: procfs needs SYS_ADMIN, /sys/fs/cgroup is read-only for non-privileged pods, rootless dind blocked by masked /proc + no tun).
131 lines
6.6 KiB
YAML
131 lines
6.6 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: forgejo-runner-config
|
|
namespace: forgejo
|
|
data:
|
|
arm64.toml: |
|
|
log:
|
|
level: info
|
|
runner:
|
|
# runner.ini lives on the runner's data PVC now (was a hostPath file), so
|
|
# the registration survives the move to in-cluster dind with the same
|
|
# uuid. Nothing in the Deployment registers a runner.
|
|
file: /data/runner.ini
|
|
# capacity 1: ci.yml builds every job's Rust target into ONE shared named
|
|
# volume (onionwire-target-ci, mounted at /target). Two jobs writing that
|
|
# volume concurrently clobber each other's freshly-linked test binaries,
|
|
# which then fail with "could not execute process ... (never executed)
|
|
# Permission denied (os error 13)". capacity 1 is the enforced serializer
|
|
# because Forgejo's `concurrency.group` was observed NOT serializing two
|
|
# runs of the same group on this runner (446 + 447 overlapped).
|
|
capacity: 1
|
|
timeout: 1h
|
|
cache: /data/cache
|
|
cache:
|
|
enabled: true
|
|
dir: /data/cache
|
|
container:
|
|
# CI job containers run unprivileged. They still get the dind socket (a
|
|
# bind mount in `options` below), which is what the build/deploy
|
|
# workflows actually need; nothing in them needs extra capabilities.
|
|
# This was `true` until card t_2bbe34a8 (audit F6): a privileged job
|
|
# container inside a privileged dind was node root twice over.
|
|
privileged: false
|
|
# No docker_host here: setting it makes the runner inject the socket bind
|
|
# into the job container itself, which collides with the explicit
|
|
# -v /var/run/docker.sock in options ("Duplicate mount point"). The
|
|
# options bind is the deliberate choice — nested `docker create/start` in
|
|
# ci.yml, fuzz.yml and release.yml depends on it.
|
|
#
|
|
# The docker CLI/plugins come out of the `dind` sidecar's own filesystem
|
|
# (docker:27-dind ships /usr/local/bin/docker, docker-buildx,
|
|
# docker-compose), not the Pi host's docker-static. Paths resolve inside
|
|
# the dind container, which is what the daemon bind-mounts from. This
|
|
# keeps `docker buildx` working without installing a CLI in five
|
|
# workflows.
|
|
options: -v /usr/local/bin/docker:/usr/bin/docker:ro -v /usr/local/libexec/docker/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock --memory 3g --memory-swap 3g
|
|
valid_volumes:
|
|
- "**"
|
|
# Dedicated runner for site deploys. It declares ONLY the `deploy-arm64`
|
|
# label, so `runs-on: docker` CI jobs (onionwire ci, minutes to hours of Rust)
|
|
# can never occupy it and starve a deploy. The converse also holds: a deploy
|
|
# can never occupy the Pi's `docker` runner, whose capacity 1 exists to
|
|
# serialize onionwire jobs sharing the onionwire-target-ci volume.
|
|
#
|
|
# It runs on the Pi because deploy-site.yml needs Pi-local resources: the Pi
|
|
# registry and Garage are now addressed over the WireGuard hub IP
|
|
# (10.10.0.1:5000, 10.10.0.1:3900) instead of loopback, because 127.0.0.1
|
|
# inside a pod is the pod. Its own `dind` sidecar builds the arm64 site image;
|
|
# no host Docker is involved.
|
|
deploy-arm64.toml: |
|
|
log:
|
|
level: info
|
|
runner:
|
|
# Copied onto the data PVC from /opt/siriusdevops/runner-deploy/data on
|
|
# the Pi host before first start. The require-registration init container
|
|
# refuses to start without it (registering would burn the single-use
|
|
# token and create a second action_runner row).
|
|
file: /data/runner.ini
|
|
capacity: 1
|
|
timeout: 30m
|
|
cache: /data/cache
|
|
cache:
|
|
enabled: true
|
|
dir: /data/cache
|
|
container:
|
|
# CI job containers run unprivileged. They still get the dind socket (a
|
|
# bind mount in `options` below), which is what the build/deploy
|
|
# workflows actually need; nothing in them needs extra capabilities.
|
|
# This was `true` until card t_2bbe34a8 (audit F6): a privileged job
|
|
# container inside a privileged dind was node root twice over.
|
|
privileged: false
|
|
# Same injection as arm64.toml: the job container is node:20-bullseye,
|
|
# which has no docker CLI and no buildx, and deploy-site.yml needs both.
|
|
# Both come from the dind sidecar's own filesystem. binfmt/QEMU is
|
|
# registered kernel-globally on the Pi (the POC pod's
|
|
# /proc/sys/fs/binfmt_misc was empty yet an amd64 build ran as x86_64),
|
|
# so the `--platform linux/amd64` cross build works inside the pod.
|
|
# --memory caps the job container only (sibling `docker run` containers a
|
|
# workflow spawns are outside the runner's control).
|
|
options: -v /usr/local/bin/docker:/usr/bin/docker:ro -v /usr/local/libexec/docker/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock --memory 3g --memory-swap 3g
|
|
valid_volumes:
|
|
- "**"
|
|
|
|
amd64.toml: |
|
|
log:
|
|
level: info
|
|
runner:
|
|
file: /data/runner.ini
|
|
# capacity 1: the dind daemon on this runner holds the release/CI build
|
|
# containers and images. Two concurrent x86_64 builds on it made the
|
|
# *second* build's egress fail (apt looping on "Ign:" for Debian
|
|
# InRelease) while a single build on the same daemon succeeded.
|
|
capacity: 1
|
|
timeout: 1h
|
|
cache: /data/cache
|
|
cache:
|
|
enabled: true
|
|
dir: /data/cache
|
|
container:
|
|
# CI job containers run unprivileged. They still get the dind socket (a
|
|
# bind mount in `options` below), which is what the build/deploy
|
|
# workflows actually need; nothing in them needs extra capabilities.
|
|
# This was `true` until card t_2bbe34a8 (audit F6): a privileged job
|
|
# container inside a privileged dind was node root twice over.
|
|
privileged: false
|
|
# No docker_host: it injects the socket bind into the job container,
|
|
# which collides with the explicit -v /var/run/docker.sock in options
|
|
# ("Duplicate mount point"). The options bind is the deliberate choice.
|
|
#
|
|
# The job image is node:20-bullseye, which ships no docker CLI, so the
|
|
# socket alone is not enough — `docker login`/`build`/`push` die with
|
|
# "docker: command not found". The CLI and cli-plugins come from the
|
|
# dind sidecar's own filesystem (docker:27-dind ships /usr/local/bin/
|
|
# docker, docker-buildx, docker-compose), same as arm64.toml.
|
|
# No --memory cap: this runner also carries the existing amd64 release
|
|
# builds, which were already uncapped.
|
|
options: -v /usr/local/bin/docker:/usr/bin/docker:ro -v /usr/local/libexec/docker/cli-plugins:/usr/local/lib/docker/cli-plugins:ro -v /var/run/docker.sock:/var/run/docker.sock
|
|
force_pull: true
|
|
valid_volumes:
|
|
- "**"
|