Repository navigation
Description
Friction
The in-cluster image registry accepts unauthenticated pushes and deletes over plain HTTP on a fixed NodePort on every node, runs as root with no securityContext, and its namespace has no NetworkPolicy and no test noticing. Nothing has pulled from it since squid was removed in #734 (v0.2.24), yet the homelab repository still plans to point every node's containerd at it (dan-petty/homelab#7, configure_registries.yaml, apply pending the power move). Unauthenticated writes land on a local-path volume that does not enforce its 50Gi request, so they could fill a 's disk and trigger DiskPressure evictions; once the mirrors are applied, anyone on the LAN or in any pod can also plant an image the nodes will run. The registry should either be protected before the mirrors go live, or leave together with them.
Evidence
Live, read-only, 2026-10-17:
- Deployment
registry/registryrunsregistry:2.8.3with empty pod and container securityContext; env onlyREGISTRY_STORAGE_FILESYSTEM_ROOTDIRECTORY,REGISTRY_HTTP_ADDR=0.0.0.0:5000andREGISTRY_STORAGE_DELETE_ENABLED=true; noREGISTRY_AUTH*. - Service
registry/registryis NodePort with a fixed nodePort;kubectl get networkpolicy -n registryreturns nothing. Applicationbase(pathk8s, 3dd7fa6) is Synced and owns the Namespace, PVC, Service and Deployment. - No consumer today: the six registry references in the nodes' image caches are all squid; no workload references a registry-hosted image; Loki shows zero non-probe HTTP requests to the registry in 29 days, and no containerd mirror routes through it yet.
- Namespace
registryis labelled baseline by design (k8s/namespaces.yaml:55-60); a restricted dry run fails, which breaks no declared level.
Repo:
k8s/kustomization.yaml:7includesregistry;k8s/registry/deployment.yaml:23-34(no auth, no securityContext),k8s/registry/service.yaml:11-18(NodePort),k8s/registry/kustomization.yaml:6-9(no networkpolicy).tests/test_k8s_network_policies.py:34TARGET_NAMESPACESleaves registry out;tests/test_k8s.py:1224-1232pins its memory.- References:
k8s/README.md:601,src/devops_cli/ai/knowledge_base/devops_cli/tasks/k8s_stack_deployment.md:14,89. Metrics for the rest of the platform #551 lists the registry for metrics; feat(k8s): the homelab runs gitea under argo cd as a read-write internal forge, served in-cluster over http and to workstations at https://git.<domain> through the cloudflare tunnel, with its admin secret pushed from the keyring #1081 makes Gitea the internal container registry; feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082 points Argo CD at Gitea's registry. - dan-petty/homelab
ansible/playbooks/configure_registries.yaml:17-38lists insecure HTTP mirrors for the registry's NodePort names; its feat(ci): publish reusable devcontainer package and add tf FastMCP tools #7 plans to generate them per node and run them frommake all.
Remedy
The owner decides first, and records the decision in k8s/README.md and on dan-petty/homelab#7:
- Keep (until Gitea's registry, feat(k8s): the homelab runs gitea under argo cd as a read-write internal forge, served in-cluster over http and to workstations at https://git.<domain> through the cloudflare tunnel, with its admin secret pushed from the keyring #1081, replaces it). Tests first: add
registrytoTARGET_NAMESPACESand a test that the Deployment readsREGISTRY_AUTH=htpasswdfrom a Secret and sets a non-root securityContext withallowPrivilegeEscalation: false, capabilities dropped and RuntimeDefault seccomp (the namespace stays baseline). Then: an htpasswd Secret pushed from the keyring by push-secrets (a new row in the Cluster Secrets table),REGISTRY_STORAGE_DELETE_ENABLEDoff unless garbage collection needs it, aregistry-perimeterNetworkPolicy admitting 5000 only from the node network and the pods that push, and ak8s/registry/networkpolicy.yamlentry in its kustomization. homelab#7 then adds the matchingconfigs.<mirror>.authtoregistries.yaml. - Remove (the zero-zombie-code default if nothing will push to it). Drop
registryfromk8s/kustomization.yaml:7, deletek8s/registry/and the Namespace atk8s/namespaces.yaml:52-62, the assertion attests/test_k8s.py:1224-1232and the mentions atk8s/README.md:601andk8s_stack_deployment.md:14,89; leavetests/test_security_kubelinter.py:52-53(a recorded report). Argo CDbaseprunes the Deployment and Service; PVCregistry-dataand the Namespace stay under their Prune=false,Delete=false annotations until a person deletes the namespace. dan-petty/homelab#7 then deletesconfigure_registries.yamlinstead of generalising it, and Metrics for the rest of the platform #551 drops the registry.
Priority: P2. Severity medium-to-low today; it becomes an image-injection path for every node once homelab#7's mirrors are applied.
Proposed design
Problem statement
The in-cluster image registry is insecure and unauthenticated, running as root with no securityContext, and accepts unauthenticated pushes and deletes over plain HTTP on a fixed NodePort. It has no NetworkPolicy and is not tested, posing a risk of disk fill-up and unauthorized image injection if mirrors are applied to nodes.
Acceptance criteria
- Criterion 1: The registry deployment includes authentication via htpasswd and a non-root securityContext with restricted capabilities
Verification: Verify that the registry Deployment in k8s/registry/deployment.yaml sets REGISTRY_AUTH=htpasswd, uses a non-root user, has allowPrivilegeEscalation: false, dropped capabilities, and RuntimeDefault seccomp. - Criterion 2: A NetworkPolicy is applied to restrict access to the registry's NodePort
Verification: Confirm that k8s/registry/networkpolicy.yaml exists and defines a policy admitting traffic only from the node network and pods authorized to push images. - Criterion 3: The registry namespace has proper test coverage for its security settings
Verification: Ensure tests/test_k8s_network_policies.py includes 'registry' in TARGET_NAMESPACES and that there is a test verifying the Deployment's securityContext and auth configuration. - Criterion 4: The registry is either kept with security measures or removed if no longer needed
Verification: Check k8s/kustomization.yaml for the registry entry and confirm that either it remains with updated security configurations or has been removed along with associated files.
Key questions
- Should the registry be kept with security measures or removed?: The owner decides first, and records the decision in k8s/README.md and on dan-petty/homelab#7. (proposed)
Open questions
- What are the current security settings of the registry deployment? (missing verified source)
- What is the current network policy for the registry namespace? (missing verified source)
- Are there any existing tests that cover the registry's security? (missing verified source)
Fit
Needs splitting into 3 items:
- Create a new task to add authentication and securityContext to the registry deployment
- Create a new task to implement a NetworkPolicy for the registry namespace
- Update tests to cover the new registry security settings
Suspected block
dan-petty/homelab#7
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 18, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate describes a security vulnerability in the in-cluster image registry.The registry accepts unauthenticated pushes and deletes over plain HTTP, running as root with no securityContext, and could fill a node's disk and trigger DiskPressure evictions.The registry is exposed to the LAN or any pod and allows unauthenticated writes that could fill disks and trigger evictions.The fix requires adding authentication, securityContext, NetworkPolicy, and updating tests and documentation.dan-petty commentedon Oct 18, 2026
Proposal needs splitting into 3 items at 25e2cda (see proposed design in issue body).
feat(k8s): the homelab runs gitea under argo cd as a read-write inter…
fix(k8s): stateful local-path volumes bind on nodes with disk headroo…