Repository navigation
Description
Friction
The shared Valkey in llm (deployment/valkey) accepts commands from anyone, with no password, while valkey-runs in the same namespace requires one. Every pod in llm, every pod in monitoring and Traefik can reach it on any port, so any of them can read or overwrite Open WebUI's state, publish on Open WebUI's task-command pub/sub channel, or read and poison Portkey's response cache.
Evidence
Live, read-only, 2026-10-17:
- Deployment
llm/valkey(valkey/valkey:9.1.2-alpine) runsvalkey-server --save "" --appendonly no --dir /data: no env, norequirepass, no Secret reference. Servicellm/valkeyis ClusterIP. - The valkey image patches protected-mode off at build time, and Open WebUI's connections work unauthenticated (no Redis error logged in the two weeks since start-up).
- Secrets in
llm(names only): llm-gateway-secrets, qdrant-api-key, valkey-runs-auth; none for this Valkey. - NetworkPolicy
llm/llm-default-perimeter(k8s/llm/networkpolicy.yaml:9-36) selects valkey and admitspodSelector {}, the wholemonitoringnamespace and Traefik, with no port limit. - Clients: StatefulSet
llm/open-webuisetsREDIS_URLandWEBSOCKET_REDIS_URLtoredis://valkey.llm.svc.cluster.local:6379/0; Portkey usesCACHE_STORE=rediswith the same host; llm-gateway setsLITELLM_REDIS_HOST/PORT, thoughlitellm_settings(k8s/llm/gateway/configmap.yaml:151-157) turns on no cache.
Repo:
k8s/llm/valkey.yaml:40-47(no password); comparek8s/llm/valkey-runs.yaml:66-87, which reads its password from Secretvalkey-runs-authinto a config file on a memory emptyDir rather than the command line.- Client config:
k8s/llm/values-open-webui.yaml:66-72(URL at:70),k8s/llm/portkey/deployment.yaml:43-46,k8s/llm/gateway/deployment.yaml:60-63. Egress rules naming valkey:6379:k8s/llm/portkey/networkpolicy.yaml:44-49,k8s/llm/gateway/networkpolicy.yaml:35-41. k8s/README.md:67shows an unauthenticatedvalkey-cli ping. deploy-stack applies the file (src/devops_cli/commands/k8s/stack_lifecycle.py:183).- feat(ai): pinned image tags and bounded shared valkey in the llm stack #711 (v0.2.40) edits the same file to add
--maxmemory; fix(valkey): one validated URL names every Valkey endpoint, valkey-py dials an address that one check vetted, and the unused cache layer goes #1113 is the client-side GLIDE rewrite.
Remedy
- Tests first (
tests/test_k8s_valkey_stack.py): the valkey Deployment readsVALKEY_PASSWORDfrom Secretvalkey-authand never passes the password on the command line; Open WebUI, Portkey (and the gateway, if it keeps a Redis setting) take the password from the same Secret; avalkey-perimeteradmits 6379 only from open-webui, portkey and llm-gateway. - Secret
llm/valkey-auth(keypassword) joins the push-secrets registry from a keyring entry (adopt the live value if present, else generate), with a row in the Cluster Secrets table (k8s/README.mdaround:315); deploy-stack pushes it before applyingvalkey.yaml. k8s/llm/valkey.yaml:40-47: copy the valkey-runs pattern (valkey-runs.yaml:66-87):requirepasswritten into a config file on a memory emptyDir with umask 077, thenexec valkey-server /run/valkey/auth.conf --save "" --appendonly no --dir /data.- Clients: Open WebUI declares
VALKEY_PASSWORDfrom a secretKeyRef first and builds the valkey Service URL with that password interpolated into its userinfo for both URLs (check the chart renders the env vars in that order); Portkey'sREDIS_URLthe same; removeLITELLM_REDIS_HOST/PORTfrom the gateway if no LiteLLM cache uses them. - Network, as defence in depth: add valkey to the NotIn list in
k8s/llm/networkpolicy.yaml:13-16and give it its own perimeter as in step 1. k8s/README.md:67passes auth; Coordinate the file edit with feat(ai): pinned image tags and bounded shared valkey in the llm stack #711.
Verification after the sync: an unauthenticatedPINGis refused with NOAUTH, Open WebUI chat and websockets work, and Portkey logs no cache errors.
Priority: P3. Severity low: ClusterIP only, but an unauthenticated write path from two namespaces into Open WebUI's state.
Proposed design
Problem statement
The llm Valkey deployment in the Kubernetes cluster is insecure because it lacks authentication and allows unrestricted access from any pod in the namespace. This exposes Open WebUI's state and Portkey's response cache to unauthorized read and write operations.
Acceptance criteria
- Criterion 1: The Valkey deployment reads a password from a Secret and does not expose it on the command line
Verification: Check that k8s/llm/valkey.yaml uses a config file with requirepass from a memory emptyDir volume instead of passing password via command line - Criterion 2: Open WebUI, Portkey, and gateway clients use the same password from the valkey-auth Secret
Verification: Verify that k8s/llm/values-open-webui.yaml, k8s/llm/portkey/deployment.yaml, and k8s/llm/gateway/deployment.yaml reference VALKEY_PASSWORD from the secret - Criterion 3: NetworkPolicy restricts Valkey access to only specific pods
Verification: Confirm that a new valkey-perimeter NetworkPolicy allows traffic only from open-webui, portkey, and llm-gateway pods on port 6379 - Criterion 4: Unauthenticated PING commands are rejected with NOAUTH error
Verification: Run kubectl -n llm exec -it svc/valkey -- valkey-cli ping and verify it fails with NOAUTH error - Criterion 5: Open WebUI chat and websockets function correctly with authentication
Verification: Verify that Open WebUI chat functionality works without errors after applying the changes
Key questions
- What is the current Valkey configuration in k8s/llm/valkey.yaml?: The current Valkey deployment runs with no password, using command line arguments '--save "" --appendonly no --dir /data' without any requirepass or secret reference. [sources: k8s/llm/valkey.yaml:40-47]
- How is the valkey-runs deployment configured to handle passwords?: The valkey-runs deployment reads password from Secret 'valkey-runs-auth' into a config file on a memory emptyDir with umask 077 rather than passing it on command line. [sources: k8s/llm/valkey-runs.yaml:66-87]
- Which pods need to access the Valkey instance?: Open WebUI, Portkey, and llm-gateway pods need access to the Valkey instance. [sources: k8s/llm/values-open-webui.yaml:66-72, k8s/llm/portkey/deployment.yaml:43-46, k8s/llm/gateway/deployment.yaml:60-63]
- Should we add a valkey-perimeter NetworkPolicy?: Yes, a new NetworkPolicy should be added to restrict access to Valkey to only specific pods for defense in depth. (proposed)
Fit
Fits in one pull request.
Suspected block
None.
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 addresses a security vulnerability by requiring a password for Valkey access.The issue allows unauthorized access to Open WebUI's state and pub/sub channels, posing a high risk.Fixing this vulnerability significantly improves system security and prevents unauthorized modifications.The fix requires changes across multiple components including deployment files, secrets management, client configurations, and network policies.dan-petty commentedon Oct 18, 2026
Status set to Ready at 25e2cda (see proposed design in issue body).
fix(k8s): the llm valkey cache requires a password and admits only it…
fix(k8s): the shared llm valkey has a memory bound below its containe…