chore(k8s): stop LiteLLM publishing its API docs - #94
Merged
Conversation
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) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0174W6CHp7FMt7c9sKdBhbp1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #93. Now that the LiteLLM proxy is internet-reachable at
/kartikon dev, it was serving its API docs to anonymous visitors:/kartik/redoc/kartik/openapi.json/kartik/(Swagger)/swagger/*and 404 through the prefixNo data or admin action was reachable without
LITELLM_MASTER_KEY(those all 401), but the full API surface was public.Why three flags, not just
NO_DOCS: LiteLLM reads them independently —_get_docs_url/_get_redoc_url/_get_openapi_urlinlitellm/proxy/utils.py.NO_DOCSalone would only hide Swagger, which was already the broken one, and leave ReDoc and the schema up.Why
"True"and not1: these go throughstr_to_bool(litellm/secret_managers/main.py:115), which recognizes only"true"/"false"case-insensitively and returnsNonefor anything else — so"1"would silently leave docs enabled.Set in
base/, so prod (vcell-ai-rke) picks it up on its next apply as well. Config-only, no image bump.🤖 Generated with Claude Code
https://claude.ai/code/session_0174W6CHp7FMt7c9sKdBhbp1