All workflows in this repo (01 to 05) run on proxmox-lab-runner. That's the gitea/runner container on the Pi, next to Gitea, with problems that can't be fixed in place:
It needs /var/run/docker.sock. A job that reaches the socket has root on the Pi, which also runs Gitea, Postgres, Nextcloud and the other services.
It's registered for the whole instance, so any repo can schedule jobs on it.
It's on pg_network, so jobs can reach Postgres.
Jobs hold the most powerful credentials in the homelab: the Proxmox API tokens for pve1 to pve3, pfSense access, the Pulumi passphrase and the backend URL.
Moving the runner into a dedicated, unprivileged LXC outside the k3s cluster means a compromised job only gets a throwaway container. That container can be snapshotted and has firewalled egress. Keeping it outside the cluster also avoids a circular dependency: 01 and 02 create the cluster, so they can't depend on it.
Scope
In scope: a new runner LXC, ideally provisioned by 01-proxmox-infra; act_runner as a systemd service; Proxmox tokens scoped to what Pulumi needs; workflow runs-on changes; retiring the Docker runner.
Out of scope: the Ansible runner LXC, which stays separate (it holds different credentials); an in-cluster runner or GitOps for 03 to 05, which can be a follow-up.
Tasks
LXC
Unprivileged LXC (unprivileged: true, no nesting and no extra features unless something needs them). Debian or Ubuntu template, small sizing (2 vCPU, 2 to 4 GB RAM, ~20 GB disk)
Define it in 01-proxmox-infra so it's managed by Pulumi. Bootstrap it by hand the first time, since the runner can't create itself
Install the toolchain: Node 24, Pulumi CLI, Helm, git, plus whatever 02 needs to bootstrap k3s. Pin versions
Turn on Proxmox backups or snapshots for the LXC
Runner service
Dedicated non-root user act_runner with no sudo
Pinned act_runner binary, installed as a systemd unit with hardening (NoNewPrivileges, ProtectSystem=strict, ProtectHome, PrivateTmp, ReadWritePaths= limited to the runner's work dir)
Register it for this repo only (repo Settings → Actions → Runners), not the whole instance
Unique label, e.g. proxmox:host. capacity: 1
.runner and config.yaml set to 0600, owned by act_runner
Clean up the work dir after each job so decrypted Pulumi.dev.yaml files don't remain on disk
Credentials
A dedicated Proxmox user and API token for each node (or one for the cluster) with privilege separation turned on, in place of the current tokens
Least-privilege role on the pools and storage Pulumi manages (e.g. PVEVMAdmin + PVEDatastoreUser + PVESDNUser where needed). No root@pam, no Administrator
Update the *_PULUMI_DEV_YAML secrets with the new tokens, then revoke the old ones
Check what pfSense access 01 needs and narrow it the same way
Network
Proxmox firewall on the LXC: allow outbound traffic to Gitea, the Proxmox API (pve1 to pve3), pfSense, the Pulumi backend, the k3s API and the package/npm registries. Deny all else, including the Pi's Postgres and other LAN hosts
No inbound traffic except SSH from the admin network
Workflows
Change runs-on: ubuntu-latest to runs-on: proxmox in 01 to 05 (and secret-scan.yaml if it should run there)
Remove actions/setup-node and azure/setup-helm where the tools come from the LXC
Pin the remaining third-party actions (pulumi/actions, actions/checkout) to commit SHAs
Check each stack's preview and deploy on the new runner
Retire the Docker runner
Delete proxmox-lab-runner in Site Administration → Actions → Runners
Remove the gitea-runner service and GITEA_RUNNER_REGISTRATION_TOKEN from the Pi's gitea/docker-compose.yml and .env
Delete /home/pi/docker/gitea-runner/ (it holds the old runner token)
Docs
Runbook in docs/runbooks/ covering how to rebuild or re-register the runner LXC and rotate its Proxmox tokens
Decision record in docs/decisions/ covering the move to an unprivileged LXC with a systemd runner instead of Docker on the Pi or a k8s pod
Done when
All workflows in this repo run on the LXC runner, and preview and deploy pass for 01 to 05
The Docker runner on the Pi is gone and its token is deregistered
The old Proxmox tokens are revoked; the new ones can't do anything outside the Pulumi-managed pools
From the LXC, Postgres on the Pi can't be reached (check with nc -zv)
## Why
All workflows in this repo (`01` to `05`) run on `proxmox-lab-runner`. That's the `gitea/runner` container on the Pi, next to Gitea, with problems that can't be fixed in place:
- It needs `/var/run/docker.sock`. A job that reaches the socket has root on the Pi, which also runs Gitea, Postgres, Nextcloud and the other services.
- It's registered for the whole instance, so any repo can schedule jobs on it.
- It's on `pg_network`, so jobs can reach Postgres.
- Jobs hold the most powerful credentials in the homelab: the Proxmox API tokens for pve1 to pve3, pfSense access, the Pulumi passphrase and the backend URL.
Moving the runner into a dedicated, unprivileged LXC outside the k3s cluster means a compromised job only gets a throwaway container. That container can be snapshotted and has firewalled egress. Keeping it outside the cluster also avoids a circular dependency: `01` and `02` create the cluster, so they can't depend on it.
## Scope
**In scope:** a new runner LXC, ideally provisioned by `01-proxmox-infra`; act_runner as a systemd service; Proxmox tokens scoped to what Pulumi needs; workflow `runs-on` changes; retiring the Docker runner.
**Out of scope:** the Ansible runner LXC, which stays separate (it holds different credentials); an in-cluster runner or GitOps for `03` to `05`, which can be a follow-up.
## Tasks
### LXC
- [ ] Unprivileged LXC (`unprivileged: true`, no `nesting` and no extra features unless something needs them). Debian or Ubuntu template, small sizing (2 vCPU, 2 to 4 GB RAM, ~20 GB disk)
- [ ] Define it in `01-proxmox-infra` so it's managed by Pulumi. Bootstrap it by hand the first time, since the runner can't create itself
- [ ] Install the toolchain: Node 24, Pulumi CLI, Helm, git, plus whatever `02` needs to bootstrap k3s. Pin versions
- [ ] Turn on Proxmox backups or snapshots for the LXC
### Runner service
- [ ] Dedicated non-root user `act_runner` with no sudo
- [ ] Pinned `act_runner` binary, installed as a systemd unit with hardening (`NoNewPrivileges`, `ProtectSystem=strict`, `ProtectHome`, `PrivateTmp`, `ReadWritePaths=` limited to the runner's work dir)
- [ ] Register it **for this repo only** (repo Settings → Actions → Runners), not the whole instance
- [ ] Unique label, e.g. `proxmox:host`. `capacity: 1`
- [ ] `.runner` and `config.yaml` set to `0600`, owned by `act_runner`
- [ ] Clean up the work dir after each job so decrypted `Pulumi.dev.yaml` files don't remain on disk
### Credentials
- [ ] A dedicated Proxmox user and API token for each node (or one for the cluster) with **privilege separation** turned on, in place of the current tokens
- [ ] Least-privilege role on the pools and storage Pulumi manages (e.g. `PVEVMAdmin` + `PVEDatastoreUser` + `PVESDNUser` where needed). No `root@pam`, no `Administrator`
- [ ] Update the `*_PULUMI_DEV_YAML` secrets with the new tokens, then revoke the old ones
- [ ] Check what pfSense access `01` needs and narrow it the same way
### Network
- [ ] Proxmox firewall on the LXC: allow outbound traffic to Gitea, the Proxmox API (pve1 to pve3), pfSense, the Pulumi backend, the k3s API and the package/npm registries. Deny all else, including the Pi's Postgres and other LAN hosts
- [ ] No inbound traffic except SSH from the admin network
### Workflows
- [ ] Change `runs-on: ubuntu-latest` to `runs-on: proxmox` in `01` to `05` (and `secret-scan.yaml` if it should run there)
- [ ] Remove `actions/setup-node` and `azure/setup-helm` where the tools come from the LXC
- [ ] Pin the remaining third-party actions (`pulumi/actions`, `actions/checkout`) to commit SHAs
- [ ] Check each stack's preview and deploy on the new runner
### Retire the Docker runner
- [ ] Delete `proxmox-lab-runner` in Site Administration → Actions → Runners
- [ ] Remove the `gitea-runner` service and `GITEA_RUNNER_REGISTRATION_TOKEN` from the Pi's `gitea/docker-compose.yml` and `.env`
- [ ] Delete `/home/pi/docker/gitea-runner/` (it holds the old runner token)
### Docs
- [ ] Runbook in `docs/runbooks/` covering how to rebuild or re-register the runner LXC and rotate its Proxmox tokens
- [ ] Decision record in `docs/decisions/` covering the move to an unprivileged LXC with a systemd runner instead of Docker on the Pi or a k8s pod
## Done when
- All workflows in this repo run on the LXC runner, and preview and deploy pass for `01` to `05`
- The Docker runner on the Pi is gone and its token is deregistered
- The old Proxmox tokens are revoked; the new ones can't do anything outside the Pulumi-managed pools
- From the LXC, Postgres on the Pi can't be reached (check with `nc -zv`)
Design decision (Docker job containers instead of host mode or k8s pods): decision record in #82
Changes from this ticket: jobs run in Docker containers, not host mode, so actions/setup-node and azure/setup-helm stay and the toolchain doesn't need to be installed on the LXC. The LXC needs nesting and keyctl for that.
Not covered by those tickets yet, still to do:
Dedicated Proxmox user and API tokens with privilege separation, least-privilege role (no root@pam, no Administrator); update the *_PULUMI_DEV_YAML secrets, then revoke the old tokens
Narrow the pfSense access 01 needs
Pin third-party actions (pulumi/actions, actions/checkout, ...) to commit SHAs (may fit Roadmap 1.3, Renovate with digest pinning)
Runbook in docs/runbooks/ for rebuilding or re-registering the runner and rotating its Proxmox tokens
Superseded by the security roadmap tickets:
- LXC, firewall, backups: #82
- act_runner install, registration, retiring the Docker runner: kasun/homelab-ansible#18
- Design decision (Docker job containers instead of host mode or k8s pods): decision record in #82
Changes from this ticket: jobs run in Docker containers, not host mode, so `actions/setup-node` and `azure/setup-helm` stay and the toolchain doesn't need to be installed on the LXC. The LXC needs `nesting` and `keyctl` for that.
**Not covered by those tickets yet**, still to do:
- [ ] Dedicated Proxmox user and API tokens with privilege separation, least-privilege role (no `root@pam`, no `Administrator`); update the `*_PULUMI_DEV_YAML` secrets, then revoke the old tokens
- [ ] Narrow the pfSense access `01` needs
- [ ] Pin third-party actions (`pulumi/actions`, `actions/checkout`, ...) to commit SHAs (may fit Roadmap 1.3, Renovate with digest pinning)
- [ ] Runbook in `docs/runbooks/` for rebuilding or re-registering the runner and rotating its Proxmox tokens
Update: the runner will be a VM, not an LXC (#82). Docker in an LXC would need nesting + keyctl, which widens the shared-kernel attack surface towards the Proxmox host; the runner holds the most powerful credentials, so it gets its own kernel. Everything else in the comment above still applies.
Update: the runner will be a **VM**, not an LXC (#82). Docker in an LXC would need `nesting` + `keyctl`, which widens the shared-kernel attack surface towards the Proxmox host; the runner holds the most powerful credentials, so it gets its own kernel. Everything else in the comment above still applies.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
All workflows in this repo (
01to05) run onproxmox-lab-runner. That's thegitea/runnercontainer on the Pi, next to Gitea, with problems that can't be fixed in place:/var/run/docker.sock. A job that reaches the socket has root on the Pi, which also runs Gitea, Postgres, Nextcloud and the other services.pg_network, so jobs can reach Postgres.Moving the runner into a dedicated, unprivileged LXC outside the k3s cluster means a compromised job only gets a throwaway container. That container can be snapshotted and has firewalled egress. Keeping it outside the cluster also avoids a circular dependency:
01and02create the cluster, so they can't depend on it.Scope
In scope: a new runner LXC, ideally provisioned by
01-proxmox-infra; act_runner as a systemd service; Proxmox tokens scoped to what Pulumi needs; workflowruns-onchanges; retiring the Docker runner.Out of scope: the Ansible runner LXC, which stays separate (it holds different credentials); an in-cluster runner or GitOps for
03to05, which can be a follow-up.Tasks
LXC
unprivileged: true, nonestingand no extra features unless something needs them). Debian or Ubuntu template, small sizing (2 vCPU, 2 to 4 GB RAM, ~20 GB disk)01-proxmox-infraso it's managed by Pulumi. Bootstrap it by hand the first time, since the runner can't create itself02needs to bootstrap k3s. Pin versionsRunner service
act_runnerwith no sudoact_runnerbinary, installed as a systemd unit with hardening (NoNewPrivileges,ProtectSystem=strict,ProtectHome,PrivateTmp,ReadWritePaths=limited to the runner's work dir)proxmox:host.capacity: 1.runnerandconfig.yamlset to0600, owned byact_runnerPulumi.dev.yamlfiles don't remain on diskCredentials
PVEVMAdmin+PVEDatastoreUser+PVESDNUserwhere needed). Noroot@pam, noAdministrator*_PULUMI_DEV_YAMLsecrets with the new tokens, then revoke the old ones01needs and narrow it the same wayNetwork
Workflows
runs-on: ubuntu-latesttoruns-on: proxmoxin01to05(andsecret-scan.yamlif it should run there)actions/setup-nodeandazure/setup-helmwhere the tools come from the LXCpulumi/actions,actions/checkout) to commit SHAsRetire the Docker runner
proxmox-lab-runnerin Site Administration → Actions → Runnersgitea-runnerservice andGITEA_RUNNER_REGISTRATION_TOKENfrom the Pi'sgitea/docker-compose.ymland.env/home/pi/docker/gitea-runner/(it holds the old runner token)Docs
docs/runbooks/covering how to rebuild or re-register the runner LXC and rotate its Proxmox tokensdocs/decisions/covering the move to an unprivileged LXC with a systemd runner instead of Docker on the Pi or a k8s podDone when
01to05nc -zv)Superseded by the security roadmap tickets:
Changes from this ticket: jobs run in Docker containers, not host mode, so
actions/setup-nodeandazure/setup-helmstay and the toolchain doesn't need to be installed on the LXC. The LXC needsnestingandkeyctlfor that.Not covered by those tickets yet, still to do:
root@pam, noAdministrator); update the*_PULUMI_DEV_YAMLsecrets, then revoke the old tokens01needspulumi/actions,actions/checkout, ...) to commit SHAs (may fit Roadmap 1.3, Renovate with digest pinning)docs/runbooks/for rebuilding or re-registering the runner and rotating its Proxmox tokensThe tasks listed above as not covered are now tracked in #92.
Update: the runner will be a VM, not an LXC (#82). Docker in an LXC would need
nesting+keyctl, which widens the shared-kernel attack surface towards the Proxmox host; the runner holds the most powerful credentials, so it gets its own kernel. Everything else in the comment above still applies.