From d342eb3ea8c128d44c916108612409eb4d2a218a Mon Sep 17 00:00:00 2001 From: Jim Schaff Date: Wed, 12 Aug 2026 12:51:46 -0400 Subject: [PATCH] chore(k8s): stop LiteLLM publishing its API docs The proxy is now reachable from the internet at /kartik on dev, where it was serving ReDoc and a 1.1MB openapi.json documenting 504 routes to anonymous visitors. No data was reachable without the master key, but the API surface was fully published. NO_DOCS alone is not enough: LiteLLM reads three independent switches (_get_docs_url/_get_redoc_url/_get_openapi_url in litellm/proxy/utils.py), so Swagger, ReDoc and the schema each need their own flag. Values must be "true"/"false" -- str_to_bool() recognizes nothing else, so "1" would silently leave the docs enabled. Set in base/, so prod (vcell-ai-rke) picks it up on its next apply too. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_0174W6CHp7FMt7c9sKdBhbp1 --- kustomize/base/litellm.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kustomize/base/litellm.yaml b/kustomize/base/litellm.yaml index 1996e29..b0d7d69 100644 --- a/kustomize/base/litellm.yaml +++ b/kustomize/base/litellm.yaml @@ -28,6 +28,17 @@ spec: name: litellm-config # Secrets come from the sealed "litellm-secrets" secret. env: + # Don't publish the API surface. These are three separate switches in + # LiteLLM (_get_docs_url/_get_redoc_url/_get_openapi_url) — NO_DOCS + # alone only hides Swagger and leaves ReDoc + the full openapi.json + # (500+ paths) readable. Values are parsed by str_to_bool(), which + # recognizes only "true"/"false" — "1" would silently leave docs on. + - name: NO_DOCS + value: "True" + - name: NO_REDOC + value: "True" + - name: NO_OPENAPI + value: "True" - name: LITELLM_MASTER_KEY valueFrom: secretKeyRef: