ops: Forgejo runner-isolation review + branch protection follow-ups (from #14) #146
Labels
No labels
epic
phase-0
phase-1
phase-2
phase-3
phase-4
phase-5
phase-6
phase-7
phase-8
phase-9
priority/P0
priority/P1
priority/P2
type/backend
type/client
type/docs
type/ops
type/security
type/spike
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/failsulit#146
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-ups from #14 (closed) — Forgejo-admin items. Branch protection: DONE 2026-11-11 (see below). Runner isolation: review + open decisions.
DONE — branch protection on main (via API /branch_protections, Forgejo 17)
Runner-isolation review (2026-11-11, grounded in the workflow tree)
Secrets inventory on runners: REGISTRY_USER/TOKEN (cd, staging-deploy), STAGING_SSH_KEY/USER/HOST/KNOWN_HOSTS (staging-deploy — the runner holds a working SSH key INTO the staging VPS), Sentry DSN, and the release fleet's Apple/Google/Tauri secrets (APPLE_* x10, ANDROID_KEYSTORE_*, PLAY_STORE_SERVICE_ACCOUNT_JSON, TAURI_SIGNING_PRIVATE_KEY).
Findings:
deployuser on one box (staging, not prod).7f853c8staging-deploy shows failure although runs 38183/38197 succeeded). Don't trust commit statuses; poll run IDs.Open actions (Forgejo-admin)
Runner-isolation review — findings from infra inspection (2026-11-13)
Answering the open action "Confirm/decide runner hosting + apply finding 5 hardening" with grounded facts. Three self-hosted runner VMs + the Forgejo box, all inventoried over SSH:
runner)All Ubuntu (kernel 6.8, x86_64),
act_runnerdaemon as systemd unit, config at/home/runner/act_runner/config.yml.New findings
F1 — every job container mounts the host docker socket. All three runners ship:
Any job on any project these runners serve = effective root on the runner host (docker socket → host root; plus
SYS_PTRACEgranted). Combined with finding 3 (staging-deploy runs attacker-influenceable code on main), the blast radius of a compromised dependency is: runner host root → runner's ssh keys/env (REGISTRY_TOKEN, STAGING_SSH_KEY are in the runner's job env, not just the workflow scope) → staging VPS deploy user.F2 — runners are shared across projects. Concurrent PKI-project jobs (
pki-ci-base:1,node:20-bullseye) observed on all three VMs. No repo/project-level runner separation: a PR job from any connected repo shares the same docker-socket-mounted containers as our deploy jobs.F3 —
macos-15label does not exist on any runner. Labels registered:ubuntu-latest,ubuntu-22.04,ubuntu-20.04,rust,dotnet,release-builder,elixir(alldocker://forgejo-fix/*). No macOS host anywhere in the fleet →desktop-release.yml/ios-release.yml(runs-on: macos-15) can never be picked up — releases would queue forever. The Apple/Google/Tauri secrets are currently unreachable dead weight. Decision needed: provision a Mac runner with that label, or re-point release workflows at a Linux label (cross-compile / fastlane lane review) and remove the Apple secret surface.F4 — shared persistent cache per runner.
cache.enabled: truewith a shared dir across all jobs/repos on each runner (finding 5's cache concern confirmed).F5 — deploy-failure monitoring gap (today's incident). Staging API crash-looped ~21h (2026-11-12 14:04 → 2026-11-13 hotfix #195) and every staging-deploy run failed its smoke step the whole time — noticed only by accident. Cheapest fix: a cron probe on the staging VPS (
curl -f http://127.0.0.1:8080/health/) that opens/updates a Forgejo issue on repeated failure, plus (optionally) a Forgejo webhook on failed main-branch runs.Proposed decisions (Forgejo-admin)
docker.sockinto job containers by default: drop the-vfromoptions, dropSYS_PTRACE, and setvalid_volumesto[]; jobs needing docker (staging-deploy, cd) move to a dedicateddeploylabel on a runner whose config keeps the socket (ideally a socket proxy with a scoped API, or rootless docker). Alternative minimal step: keep the socket but removevalid_volumes: ["**"]so arbitraryvolumes:in workflows can't mount anything else.apionly + rotation cadence (quarterly?), same for STAGING_SSH_KEY.authorized_keys:restrict,command="..."orfrom=the runner egress IPs (194.233.80.53, 84.247.154.32, 84.247.152.71) if egress is static.Related: #196 (migration smoke test — the incident root cause), PR #195 (the hotfix).