Pod Security Baseline Audit¶
Status: PSS Phase 0 + Phase 1 SHIPPED (#15666, 2026-11-08). warn now set at
each namespace's target level across all 23 labeled namespaces; enforce rolled
out where live measurement showed zero rejections. Phase 2 (baseline-enforce on the
measured-clean middle tier) SHIPPED (#15671); Phase 3 — the fleet-wide seccomp
sweep (#15674/#15673/#15702) and enforce: restricted on auth + external-secrets
(#15701/#15703) — SHIPPED (2026-11-08). mcp-system and selfhosted remain at
baseline by design (upstream-chart broker / grocy s6 cannot run non-root). Phase 2's
actions-runner-system caveat (flagged below) fired same-day — the
actions-runner-privileged namespace carve-out (#15712) SHIPPED (2026-11-08) —
see Phase 2 follow-up. That carve-out had its own CNP gap (the cross-namespace
listener pod left uncovered by default-deny); the fix SHIPPED (#15716) —
cnp-containers-listener.yaml (see Phase 2 follow-up).
Owner: home-ops
Last updated: 2026-11-08
Rollout status (post-#15666)¶
enforce: restricted—cert-manager,renovate,tools,auth,external-secrets(all verified restricted-clean live, every container incl. inits).enforce: privileged(pinned to document intent — admits every pod, rejects nothing; blocks an accidental blanket-restricted from silently rejecting these) —ai,collab,home,network,media,storage,downloads,observability,longhorn-system,rook-ceph,kube-system.vpnwas already enforce-privileged.actions-runner-privilegedjoined this tier via #15712 (see Phase 2 follow-up) — unlike the others here, it is a single-purpose carve-out (one privileged workload, nothing else resident), soaudit/warnare pinned toprivilegedtoo rather than held at a tighter target, matchingvpn's pattern.warn+auditonly (neverenforce) —flux-system. A rejected Flux controller pod could not be fixed through GitOps (the controller that reconciles the fix is the one that would be down), so this namespace is a deliberate SPOF carve-out and stays at warn/audit permanently.enforce: baseline—mcp-system,selfhosted,databases,actions-runner-system,istio-system. (auth/external-secretsmoved to restricted in Phase 3, #15703.)mcp-system(operator-created broker + Istio Envoy pod) andselfhosted(grocy LinuxServer s6 image) cannot run non-root, so they are terminal at baseline.istio-systemwas unblocked by confirming noistio-cniDaemonSet exists in the cluster (verified 2026-11-08).
Phase 2 (SHIPPED — #15671, 2026-11-08)¶
enforce: baseline applied to the measured-clean middle tier — auth,
external-secrets, mcp-system, selfhosted, databases, actions-runner-system,
and istio-system — all verified baseline-clean live, zero rejections on reconcile.
(actions-runner-system caveat: a future CI workflow requesting a privileged/dind
runner pod will now be rejected — intended, no privileged CI.)
Phase 2 follow-up — actions-runner-privileged carve-out (SHIPPED — #15712, 2026-11-08)¶
The Phase 2 caveat above fired the same day it shipped: arc-runner-set-containers
(the dind image-builder runner set for the private rwlove/containers repo) is
exactly the "future CI workflow requesting a privileged/dind runner pod" case, and
every rwlove/containers CI run queued forever once actions-runner-system moved
to enforce: baseline — EphemeralRunner pods were rejected with violates
PodSecurity "baseline:latest": privileged (container "dind" must not set
securityContext.privileged=true).
Rather than reverting actions-runner-system to privileged (which would undo the
Phase 2 hardening for every other resident of that namespace, including the
controller and the arc-runner-set-home-ops kubernetes-mode runner set, neither of
which need it), the dind-requiring runner set moves to its own namespace:
actions-runner-privileged, enforce: privileged. actions-runner-system stays at
enforce: baseline — this is a reduction in that namespace's blast radius, not a
regression. See kubernetes/apps/actions-runner-privileged/ and
kubernetes/apps/actions-runner-system/actions-runner-controller/runners/containers.yaml's
removal for the mechanics; the ARC controller itself is not duplicated — one
controller manages AutoscalingRunnerSets across namespaces via the chart's
controllerServiceAccount cross-namespace reference, which is the chart's documented
mechanism for exactly this case.
CNP gap found post-merge (fix SHIPPED, #15716): that cross-namespace
mechanism has a consequence #15712 missed — for a runner set whose
controllerServiceAccount points at a controller in a different namespace, the
chart creates the AutoscalingListener pod in the controller's namespace
(actions-runner-system), not the runner set's own namespace
(actions-runner-privileged). #15712 moved arc-runner-set-containers-allow
(the egress-allow CNP for that pod label) to actions-runner-privileged along
with the EphemeralRunner pods, leaving the listener — still carrying the same
app.kubernetes.io/name: arc-runner-set-containers label, but now running in
actions-runner-system — caught by that namespace's default-deny. Its POST
to api.github.com/app/installations/.../access_tokens timed out on every
retry and it never scaled up a runner, so rwlove/containers CI stayed
QUEUED even after #15712 merged. Fix: a second allow-CNP,
arc-runner-set-containers-listener-allow, scoped to actions-runner-system
(see kubernetes/apps/actions-runner-system/actions-runner-controller/runners/cnp-containers-listener.yaml),
mirroring arc-runner-set-home-ops-allow's egress shape.
Phase 3 (SHIPPED — 2026-11-08)¶
- seccomp sweep —
seccompProfile: RuntimeDefaultadded fleet-wide to the app-template workloads (#15674 non-household, #15673 household). Two issues, both caught and corrected: one authelia crashloop — a barecontrollers.<app>.pod.securityContextdropped the inheritedfsGroup/runAsUser— reverted (#15699) and re-done correctly insidedefaultPodOptions(#15701); and a silent non-root regression on 8 mcp-system servers + mqtt-exporter (same bare-block mechanism, no crash), restored (#15702). immich (non-app-template, runs as root) is seccomp-only and held for an off-peak merge (#15707). auth+external-secrets→enforce: restricted(#15703) — after the remediation in #15701 (authelia re-harden, ESO non-root) made every container restricted-clean.databases/actions-runner-systemstay baseline by design;mcp-system/selfhostedcannot reach restricted (upstream broker / grocy s6).- Not pursued —
privileged → baselineon the one-workload-pinned namespaces andai/collab→ restricted would each require remediating a cap-adding / UID-0 workload; deferred as net-new hardening rather than done in this pass.
home, network, downloads, observability, storage, kube-system,
longhorn-system, rook-ceph are terminal at privileged — architectural
(USB passthrough, per-app VPN sidecars, CSI, hostPID/hostPath); PSS cannot carve out their
privileged pods without a per-pod exception model (Kyverno, out of scope).
Audits running pods against the baseline defined in
.agents/instructions/helmrelease.security.md.
Scope¶
Snapshot taken 2026-05-18. Audited 422 pods / 524 containers across 20
namespaces. Excluded kube-system, flux-system, istio-system, and
cilium-secrets (perimeter/system control plane; out of scope for this
audit's threat model — same rationale as the network policy rollout).
Workload classes:
| Class | Containers | Notes |
|---|---|---|
| User app (HelmRelease-controlled) | 325 | 18 namespaces; we own the values.yaml |
| Infra operator (rook-ceph, longhorn-system) | 199 | Operator-controlled pod templates; deviations mostly inherent |
The audit baseline:
Pod-level: runAsNonRoot: true, non-zero runAsUser/runAsGroup, fsGroup, fsGroupChangePolicy: OnRootMismatch.
Container-level: allowPrivilegeEscalation: false, readOnlyRootFilesystem: true, capabilities.drop: [ALL], seccompProfile.type: RuntimeDefault.
Findings by deviation¶
Counts below are containers (not pods — DaemonSet replicas inflate pod counts), split into user-app vs infra-operator. Workload-level remediation effort is keyed off distinct HelmRelease, not container count.
| Deviation | User-app | Infra-op | Total |
|---|---|---|---|
Defaults to root (no runAsUser, no runAsNonRoot) |
99 | n/a | 99 |
Explicit runAsUser: 0 |
32 | 17 | 49 |
readOnlyRootFilesystem != true |
151 | 198 | 349 |
| Privileged container | 26 | 91 | 117 |
Missing capabilities.drop: [ALL] |
124 | 165 | 289 |
Missing seccompProfile (effective) |
197 | 199 | 396 |
Explicit allowPrivilegeEscalation: true |
0 | 24 | 24 |
Capabilities added (NET_ADMIN, SYS_ADMIN, etc.) |
19 | 24 | 43 |
fsGroup set without OnRootMismatch |
24 (HR-owned) | — | 24 |
54 user-app containers (~17%) pass every baseline check today.
Group A — Easy remediation (chart-values change, low risk)¶
A1. oauth2-proxy HelmReleases (24 instances, all violate everything)¶
Resolved twice over: the fleet was hardened with the full baseline securityContext (PRs #11600/#11607), then retired entirely on 2026-07-01 in favor of gateway extAuth SecurityPolicies (#12767) — zero oauth2-proxy pods remain.
quay.io/oauth2-proxy/oauth2-proxy containers across 24 HelmReleases
have zero securityContext set. The binary is a stateless
reverse proxy — runs fine as non-root, doesn't write to rootfs, doesn't
need any caps.
Proposed: stamp the baseline pod + container securityContext onto
every *-oauth2-proxy/app/helmrelease.yaml. Affected:
ai/khoj-oauth2-proxy
collab/{glance,glance-user,pump,startpunkt}-oauth2-proxy
collab/garage-webui-oauth2-proxy (under storage/)
downloads/<media-pull-stack apps>-oauth2-proxy
home/frigate-oauth2-proxy
media/{av1corrector,medialyze,music-assistant}-oauth2-proxy
media/<media-pull-stack apps>-oauth2-proxy
observability/{goldilocks,kube-ops-view}-oauth2-proxy
storage/garage-webui-oauth2-proxy
Single PR per app to keep blast radius bounded, or one PR scoping the entire family — the latter is cheaper and the risk is uniform.
A2. media-pull-stack and similar app-template charts missing baseline¶
Apps where the bjw-s defaultPodOptions aren't being inherited at the
container level. Likely candidates for one-PR-each remediation:
collab/{it-tools,nametag,paperless,pump,pump-cv,swiparr,kitchenowl}media/{flaresolverr,immich-power-tools,videodupfinder,theme-park,immichkiosk}home/wyoming-services-{kokoro,openwakeword,whisper}ai/sync-receiver— moot, removed 2026-07-06: deleted along with the langgraph-agents fleet it existed solely to serve (rsync-over-ssh access to the now-deleted langgraph-vault PVCs). (paperless-ai, once listed here, was retired 2026-09-23 in favor of paperless-ngx native AI.)
Each is a stateless or near-stateless app reading from a configMap or
PVC; readOnlyRootFilesystem should land with at most a tmpfs
/tmp mount.
A3. fsGroupChangePolicy missing on HR-owned pods¶
24 HelmRelease-owned workloads set fsGroup but not
fsGroupChangePolicy: OnRootMismatch. Cosmetic for already-chowned
PVCs, but adds startup latency on large volumes (Immich, paperless,
similar Node-style apps). One-line fix per app:
ai/{langgraph-agents}moot, removed 2026-07-06 — the whole HelmRelease was deleted along with the rest of the langgraph-agents fleet decommission. Listed below for the audit trail; no fix needed.
ai/{langgraph-agents}
auth/authelia
collab/{paperless-offsite-backup,zulip-memcached,zulip-rabbitmq}
home/{emqx,netbox}
mcp-system/mcp-gateway-jwt-rotator
media/{immich-offsite-backup,<media-library-app>}
network/externaldns-cloudflare
observability/{alertmanager,grafana,kube-prometheus-stack-operator,
kube-state-metrics,prometheus-kube-prometheus-stack}
renovate/renovate-operator + 3 RenovateJob pods
(CNPG postgres-* pods are operator-managed — separately addressed by
upgrading the cnpg chart or PRing upstream, not by editing values here.)
Group B — Medium (likely needs testing)¶
B1. App writes to rootfs at startup¶
Likely needs a tmpfs /tmp or /var/cache mount to satisfy
readOnlyRootFilesystem: true. Candidate workloads — each needs a
test cycle:
media/jellyfin(writes transcode cache; check/cachemount)media/gonic(scans library, may write tmp)media/beets(config + library import)media/romm(scan state)home/home-assistant(Python venvs, writes__pycache__)home/node-red(Node-style app dirs)home/emqx(Erlang VM cache)home/home-assistant-code(code-server: writes to/home/coder— already PVC-backed, ROOTFS itself should be fine; needs test)ai/{comfyui,khoj,ollama}(ML model caches; some are already PVC-mounted)collab/{obsidian-couchdb,zulip,open-webui,paperless}network/wg-easy(writes config at startup)
B2. UID 0 in user apps — needs per-app review¶
32 user-app containers explicitly runAsUser: 0. Most are infra-y or
have a structural reason:
observability/node-exporter— needs RAPL (runAsUser:0is the documented fix; seeproject_node_exporter_rapl_root_required). Keep.observability/smartctl-exporter— needs SMART ioctls. Keep.home/matter-server— Matter SDK requires root for bluetooth/IPv6 multicast. Likely keep — confirm.downloads/*/gluetun(one per download app) — the gluetun VPN sidecar runs as root to manage routes/iptables by design. Keep, document.collab/zulip— Zulip image expects root entrypoint that drops tozulipuser internally. Verify drop-privs is real, then keep.home/home-assistant-code— code-server images start as root then drop. Verify, then keep.ai/khoj— review.media/immichkiosk-transcode— review (likely needs ffmpeg perms).
Group C — Hard / accept deviation (document why)¶
C1. Storage CSI drivers (rook-ceph, longhorn-system)¶
107 privileged + add-caps containers. CSI node plugins need
privileged: true + SYS_ADMIN to bind-mount inside the host's mount
namespace. This is inherent to the CSI architecture.
rook-cephosd, csi-rbdplugin, csi-cephfsplugin — privilegedlonghorn-systemlonghorn-manager, instance-manager, share-manager, longhorn-csi-plugin — privileged- These are operator-managed; remediation = upstream chart change, not values override.
Action: document as accepted deviation. No PR.
C2. Network path containers¶
downloads/*/gluetun— needsNET_ADMINto set up the WireGuard tunnel, firewall and route table in each pod (notprivileged).network/multus— CNI plugin, needsNET_ADMIN.network/wg-easy— wireguard kernel ops needNET_ADMIN. Already privileged; could potentially be reduced toNET_ADMINcap-only.observability/blackbox-exporter—NET_RAWfor ICMP probes.home/{esphome,node-red}—NET_RAW/NET_ADMINfor IoT discovery.
Action: accept, document per-app why elevation is necessary.
C3. Hardware probes¶
observability/{node-exporter,smartctl-exporter}— root + hostPID required for hardware metrics (RAPL energy probes, SMART self-tests).home/{frigate,zigbee2mqtt,zwave-js-ui}— privileged for direct USB device passthrough on the IoT bus.
Action: accept, document.
Top 3 most concerning findings¶
-
24 oauth2-proxy HelmReleases with zero securityContext. These sit in front of every authenticated app; if any oauth2-proxy is compromised it has unrestricted container capabilities, rootfs write, root UID. Easy fix, broad blast radius reduction. Should be PR #1.
-
network/wg-easyis privileged even though it could likely run with justNET_ADMIN+NET_RAW. wg-easy is the only OOB access path back into the cluster (see memory:wg-easy is the only OOB access path); a compromise gets you everything. Worth a focused harden-down PR with extra care. -
99 user-app containers default to root (no
runAsUser, norunAsNonRoot). The image'sUSERdirective saves us most of the time, but every one of these is a "trust the upstream image" bet that we can convert to an explicit guarantee with one chart-values block per app.
Top 3 intentional deviations to keep¶
-
Rook-Ceph + Longhorn CSI plugins (privileged, SYS_ADMIN). Architectural — CSI nodeplugins bind-mount in the host namespace. Re-prosecuting this is wasted effort.
-
node-exporter+smartctl-exporter(UID 0, privileged). RAPL energy probes are root-only (per memory:node-exporter RAPL needs runAsUser:0), and smartctl needs ioctls no userspace cap exposes. -
downloads/*/gluetun(NET_ADMIN, UID 0, one sidecar per app). The VPN sidecar must manipulate its pod's netns; the shared pod-gateway it replaced (2026-11-21) is gone, along with thevpnnamespace.
PSA enforcement plan¶
Decision: built-in PSA labels, not Kyverno¶
Choices considered for new-workload enforcement:
| Option | Pros | Cons |
|---|---|---|
Built-in PSA (pod-security.kubernetes.io/<mode> labels) |
No new component; zero CRDs; built into apiserver since v1.25; one label-line per namespace | Three modes only (privileged/baseline/restricted); no per-pod exception model; cluster-wide policy not expressible as code |
| Kyverno | Full policy DSL, per-workload exceptions, mutation, image-signature checks | Another operator to upgrade; webhook in admission path adds latency + a failure mode; CRDs to learn |
For a 1-operator / ~400-pod home lab, the PSA labels are the right size. Decision: ship PSA labels, revisit Kyverno only if we hit a policy expressiveness limit (e.g. per-workload exception inside an otherwise-restricted namespace).
Per-namespace target level¶
The table below is the target (audit + warn) level per namespace — the level
the apply-time warning stream keeps surfacing against, so the remaining gap to
restricted/baseline stays visible. As of #15666 (2026-11-08) every labeled
namespace carries warn at this target; the enforce level that actually rejects
is set separately and is at or below this target (see Rollout status near the top of
this doc — several namespaces enforce privileged today because one architectural pod
pins them, even though their target is tighter). kube-system and flux-system are now
labeled too (previously out of scope); cilium-secrets (never schedules pods) and
kuadrant (dormant) remain unlabeled.
| Namespace | Target level | Rationale |
|---|---|---|
actions-runner-privileged |
privileged |
Single-purpose carve-out from actions-runner-system (#15712 — Phase 2 follow-up above); sole resident is the dind image-builder runner set, inherently privileged |
actions-runner-system |
baseline |
ARC runners spawn user-defined workloads |
ai |
restricted |
App-template HRs; partially hardened |
auth |
restricted |
Authelia + LLDAP already meet baseline |
cert-manager |
restricted |
Upstream pods are clean |
collab |
restricted |
oauth2-proxy hardened; zulip will fire |
databases |
baseline |
CNPG operator-managed; tighten later |
downloads |
privileged |
gluetun VPN sidecar root + NET_ADMIN (outside baseline) |
external-secrets |
restricted |
ESO controller is clean |
home |
baseline |
frigate/z2m/zwave-js need privileged USB |
istio-system |
baseline |
istio CNI installer needs privileged init |
longhorn-system |
privileged |
CSI architecture (audit doc C1) |
mcp-system |
restricted |
Stateless services |
media |
baseline |
Rootfs writes (jellyfin/gonic/romm) |
network |
baseline |
multus/wg-easy need NET_ADMIN |
observability |
privileged |
node-exporter/smartctl/vector hostPID |
renovate |
restricted |
Stateless workers |
rook-ceph |
privileged |
CSI + OSDs (audit doc C1) |
selfhosted |
restricted |
Small stateless set |
storage |
baseline |
Garage is near-clean |
Reading PSA audit-mode violations¶
PSA violations land in the kube-apiserver pod's stdout (each control-plane node) as warnings. Vector-agent scrapes them into Loki. From Grafana Explore:
{namespace="kube-system", pod=~"kube-apiserver-.*"}
|~ "would violate PodSecurity"
| json
| line_format `{{.violations}} ns={{.namespace}} pod={{.name}}`
Each violation line includes the failing field (runAsNonRoot,
seccompProfile, etc.), the offending namespace, and the requesting
user/serviceAccount. For a focused look at a single ns:
{namespace="kube-system", pod=~"kube-apiserver-.*"}
|~ "would violate PodSecurity"
|~ `ns=\"observability\"`
The same data is also emitted as a policy_violation annotation on
Events in the namespace of the rejected workload, queryable with:
kubectl get events -A --field-selector reason=FailedCreate -o yaml \
| grep -B1 -A5 'would violate PodSecurity'
Ramp criteria: audit → warn → enforce¶
Per-namespace, advance one step at a time once the prior step has been stable for the window:
audit→warn: ≥7 days of audit logs with zero unexplained violations (i.e. every violation maps to a known accepted-deviation pod from this audit doc, or to a Group A/B remediation TODO). Addingwarnsurfaces violations to the user creating the workload at apply-time, which is where you want them.warn→enforce: ≥14 days ofwarnwith zero new violation classes (operators have learned the rule; the noise has settled to steady-state). Flip viapod-security.kubernetes.io/enforce: <level>in the same namespace.yaml — the level should matchaudit. After enforce lands, the audit + warn labels become belt-and-suspenders; leave them in place so version bumps continue logging.
Per-namespace tracking lives in this section's table as the levels are ramped.
What this audit doesn't do¶
- No drift detection beyond audit-mode logs. Group A/B remediation PRs still have to be authored by hand. PSA admission catches new workloads that violate the level; it doesn't migrate the existing fleet.
- Doesn't replace HelmRelease defaults. PSA is the floor;
helmrelease.security.mdis the ceiling. New HRs should still meet the helmrelease.security baseline even if the namespace's PSA level doesn't require it (defense in depth + makes future ramps free).
Methodology¶
kubectl get pods -A -o json > all-pods.json
# In-scope: exclude system namespaces
jq -r '.items[]
| select(.metadata.namespace
| test("^(kube-system|flux-system|istio-system|cilium-secrets)$")
| not)' all-pods.json
# Per-container effective securityContext (container overrides pod)
# - eff_runAsUser = container.runAsUser || pod.runAsUser
# - eff_runAsNonRoot = container.runAsNonRoot || pod.runAsNonRoot
# - eff_seccomp = container.securityContext.seccompProfile.type
# || pod.securityContext.seccompProfile.type
Raw output and per-pod classification are reproducible from
kubectl get pods -A -o json; the jq expressions live in this PR's
description.