Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
FREEDOM251

Freedom251 › Blog › API security

LiteLLM security hardening: settings to change before exposing the gateway to the internet

By Freedom251 Team · · 10 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Before putting a LiteLLM proxy on a public address, lock down its root credentials, preserve the encryption salt, remove environment-based UI login after bootstrapping named administrators, limit routes and documentation, and place the service behind authenticated network controls. The safest design keeps the gateway private; if public reachability is unavoidable, terminate TLS at a controlled edge and expose only the inference paths clients require.

Start with a deliberate hardening sequence

Do not begin by opening a firewall port and then tune LiteLLM after the fact. Prepare secrets, identity, routes, and the network boundary first, then expose the smallest useful surface. This order also prevents an avoidable lockout.

As an Amazon Associate I earn from qualifying purchases.

  1. Create LITELLM_MASTER_KEY. Use a long, randomly generated value following the documented sk- convention for current production guidance. Keep it in a secret manager, not in a repository, image layer, shell history, or shared chat. Anyone who obtains it has root-level administrative access.
  2. Create LITELLM_SALT_KEY. Preserve it as carefully as the master key. LiteLLM uses this value to encrypt provider credentials stored in its database.
  3. Choose the identity model. Decide whether administrators will use named proxy_admin accounts, SSO accounts, or both. Do not rely on a shared bootstrap password as the permanent operating model.
  4. Bootstrap and test administrators. Sign in with each intended account and verify that management actions work before changing environment-login behavior.
  5. Disable environment credential login. After successful bootstrap, set general_settings.disable_env_credential_login: true and remove UI_USERNAME and UI_PASSWORD.
  6. Decide whether the Admin UI is needed. If operators can work through protected APIs, set DISABLE_ADMIN_UI=True. Otherwise keep the UI on an authenticated, restricted network path.
  7. Remove unnecessary API descriptions. Treat the root Swagger UI, /redoc, and /openapi.json as separate surfaces. Disabling one does not automatically remove the others.
  8. Allowlist origins and routes. Replace permissive CORS with explicit HTTPS origins and expose only the inference routes required by clients.
  9. Configure proxy awareness. Set general_settings.trusted_proxy_ranges to the real load-balancer or ingress CIDRs, or use [] when clients connect directly.
  10. Put an edge in front. Use TLS and an authenticated reverse proxy, VPN-gated ingress, WAF, or private load balancer. Keep the gateway on a private network whenever possible.
  11. Harden operations. Pin the official container to a release tag, verify signatures where supported, use PostgreSQL for durable state, and add Redis when multiple proxy instances need shared limits or router state.

Protect the two secrets that determine recoverability

LITELLM_MASTER_KEY is the administrative root

The master key authenticates management APIs and normally doubles as the Admin UI password. Treat it like a root password: access to the value means access to administrative functions, key management, configuration, and other privileged operations. Generate it with a cryptographically secure random source, inject it at runtime from a secret manager, and grant read access only to the process and the small group responsible for operating the gateway.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Do not bake the key into a Dockerfile, commit it to a configuration repository, place it in a client-side application, or pass it as a URL parameter. Keep audit records of who can retrieve it without recording the secret itself. If it is exposed, rotate it immediately, invalidate dependent access where your deployment permits, and inspect logs for management actions performed during the exposure window.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

LITELLM_SALT_KEY must remain stable

LiteLLM uses the salt key to encrypt provider credentials in the database. Back it up separately from the database and store it in the same controlled secret-management system as the master key. Changing the salt after credentials already exist makes those encrypted values unreadable until they are entered again. A replacement salt is therefore not a routine rotation; it is a data-recovery event that requires re-entering provider credentials.

Document ownership and recovery procedures for both keys before production launch. A database backup without the matching salt cannot restore encrypted provider credentials, while a salt without the database does not recreate the records.

Bootstrap named administrators before disabling environment login

Environment credentials are convenient for first boot but are a poor permanent identity layer: they create a shared secret and make it harder to attribute actions to a person. The safe transition is staged so that the UI never loses its last working administrator.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Start LiteLLM with the master key and the temporary environment-based UI credentials available.
  2. Open the Admin UI through a private or otherwise authenticated network path.
  3. Create one or more named users with the proxy_admin role, or connect the intended SSO accounts.
  4. Sign out and sign back in using each named account. Test a harmless administrative read and, where appropriate, a controlled configuration action.
  5. Only after those tests succeed, set general_settings.disable_env_credential_login: true.
  6. Remove UI_USERNAME and UI_PASSWORD from the runtime environment and secret store if they are no longer needed.
  7. Keep an emergency recovery account under a separate, tightly controlled process rather than leaving a shared password enabled for every operator.

Enabling disable_env_credential_login before a named account or SSO path has been verified can lock everyone out of the UI. Make the change during a maintenance window and retain console or orchestration access so the setting can be reverted if authentication fails.

Choose whether the Admin UI should exist on the exposed deployment

When operators do not need the UI

Set DISABLE_ADMIN_UI=True and keep administrative APIs off the public listener. This removes an entire class of browser-facing attack surface and makes it easier to enforce an inference-only design. Operators can run a separate management instance on a private network if the deployment model requires a console.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

When the UI is required

Do not publish it as an unauthenticated internet page. Put it behind an authenticated reverse proxy, VPN, identity-aware ingress, or private load balancer, and restrict the source networks that can reach it. Use named accounts or SSO after bootstrap, keep the master key out of browser-facing code, and monitor failed-login events.

LiteLLM’s Admin UI throttling defaults are concrete operational controls, not a substitute for an edge firewall. max_failed_login_attempts_per_source defaults to 10, failed_login_window_seconds to 60, and failed_login_block_seconds to 300. More than 10 wrong passwords from one source address within 60 seconds blocks that address for five minutes; the per-username allowance is more than five attempts from that address. These limits are useful only when LiteLLM can see the real client address.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Remove documentation and schema surfaces you do not intend to publish

Interactive API documentation can reveal route names, request structures, and operational assumptions to anyone who can reach it. Review all three documented surfaces independently:

  • Root Swagger UI: disable it when interactive exploration is not required.
  • /redoc: check and disable this separately; turning off the root UI does not necessarily remove ReDoc.
  • /openapi.json: check and restrict the machine-readable schema separately; setting only NO_DOCS leaves the latter two surfaces available.

If developers need documentation, serve it from a private environment or require the same authenticated network controls used for the Admin UI. Do not assume that hiding a link prevents direct requests to the underlying paths.

Replace wildcard CORS with explicit origins

When unset, LiteLLM’s configuration reference lists the default allowed origin as *. That is too broad for a production browser client. Set an explicit list of HTTPS origins for the applications that genuinely call the gateway, and remove development origins from the production configuration.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

Credentialed CORS should be enabled only for those explicit origins. With a wildcard origin, credentialed CORS is disabled automatically, but relying on that interaction leaves the policy ambiguous and can encourage unsafe workarounds. Test preflight and actual requests from an allowed origin and confirm that an unlisted origin receives no permissive Access-Control-Allow-Origin response.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Expose only the inference routes clients need

Use LiteLLM’s allowed_routes setting together with edge-level path controls. A public application commonly needs a narrow set of inference endpoints; it does not need CRUD operations, key-management endpoints, spend administration, user administration, or configuration mutation routes.

  • List every route required by each client and remove everything else from the public listener.
  • Keep administrative and credential-management routes on a private listener or behind a separate identity policy.
  • Enforce the same path policy at the reverse proxy or WAF so a mistake in one layer does not expose the route.
  • After deployment, request a permitted inference path and several deliberately forbidden paths from an external network. Confirm that forbidden requests are rejected before reaching sensitive handlers.

Route allowlisting is more durable than relying on obscurity. New LiteLLM releases can add endpoints; review the allowlist during upgrades rather than assuming a previous list remains complete.

Make source-IP throttling see the real client

Set general_settings.trusted_proxy_ranges to the actual CIDR ranges used by your load balancer or ingress. LiteLLM uses this trust boundary to recover the original client address for source-based login throttling. If clients connect directly to the proxy, set the value to [].

Never mark an entire internet-facing address space as trusted. An overly broad range lets a client supply a forged forwarding header and can defeat source-based controls. After configuring the ranges, test logs and failed-login behavior from two distinct client networks to verify that addresses are attributed correctly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Use a private network and a controlled TLS edge

The preferred topology keeps LiteLLM on a private network and allows only an authenticated reverse proxy, VPN, WAF, or private load balancer to reach it. If internet exposure is unavoidable, terminate TLS with a current certificate at the controlled edge, forward only the required paths, and restrict administrative paths to a stronger policy than ordinary inference traffic.

Separate public inference traffic from management traffic when possible. A distinct listener, security group, or private address for administration limits the blast radius of a route or CORS mistake. Ensure health checks do not require privileged endpoints and do not disclose configuration details in their responses.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use the right persistence and scaling topology

PostgreSQL for durable gateway state

Use PostgreSQL for authentication data, keys, users, spend logs, and configuration. Treat the database as security-sensitive: encrypt connections where supported by the deployment, restrict network access to LiteLLM and operators, back it up, and test restoration together with the matching LITELLM_SALT_KEY.

Redis for shared multi-instance coordination

When running more than one proxy instance, add Redis for shared rate limits and router state. Without a shared coordination layer, limits and routing decisions can diverge between replicas. Keep Redis on a private network, require authentication and encryption according to your infrastructure, and do not expose it on the public interface.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Harden the container and release process

Pin the official LiteLLM container image to a specific release tag instead of using a floating tag. Verify image signatures where the release process supports them, scan the image in your normal pipeline, and record the exact tag deployed to each environment.

Run database migrations as a controlled deployment step rather than allowing every steady-state proxy replica to perform schema changes concurrently. Roll out a new image to a staging environment first, test authentication, route restrictions, documentation paths, CORS, and provider calls, then promote the same pinned artifact. Keep rollback instructions that include compatible database and configuration versions.

Validate the hardening before opening the firewall

  1. From an operator network, log in with a named proxy_admin account and confirm that the environment credentials no longer work after disabling them.
  2. From an untrusted network, verify that the Admin UI is unreachable when DISABLE_ADMIN_UI=True, or is blocked by the edge policy when the UI is required.
  3. Probe the root Swagger path, /redoc, and /openapi.json; confirm that each has the intended access policy.
  4. Send a browser preflight from an approved HTTPS origin and an unapproved origin. Check that only the approved origin receives the expected CORS headers.
  5. Call one allowed inference route and attempt CRUD, key-management, user, spend, and configuration routes. Confirm that only the required route succeeds.
  6. Generate failed logins through the real ingress and inspect the recorded source address. Confirm that the configured window and block behavior operate on the client address rather than the proxy address.
  7. Restart the service and verify that provider credentials remain readable, proving that the same salt key was loaded.
  8. Restore a database backup in an isolated environment with the documented salt key and test that users, keys, and encrypted provider credentials are usable.

Common failure modes and recovery actions

Administrators are locked out

This usually happens when environment login is disabled before a named account or SSO path was tested. Use console or orchestration access to restore the previous setting temporarily, create and verify a proxy_admin account, then repeat the transition in a maintenance window.

Provider credentials appear unreadable after a change

Check whether LITELLM_SALT_KEY changed between deployments. Restore the original value from the secret manager and restart. If the original is permanently lost, encrypted credentials must be entered again; a database restore alone cannot decrypt them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Every login appears to come from the load balancer

Correct trusted_proxy_ranges to the load balancer’s actual CIDRs and ensure the proxy forwards the client address correctly. If there is no trusted intermediary, use [] rather than trusting arbitrary forwarding headers.

Documentation is still visible

Check all three paths independently. Setting only NO_DOCS does not remove both /redoc and /openapi.json; apply explicit access rules or disable each surface that is not required.

A practical exposure decision

Deployment choice Internet reachability Authentication and routes Operational fit
Private gateway No public listener; reachable through a private network Named administrators or SSO; inference routes only where needed Best default for internal applications and controlled clients
VPN-gated gateway Public VPN endpoint, private LiteLLM address VPN identity plus LiteLLM authentication; management paths remain private Useful when a known operator or client population can use the VPN
Authenticated reverse proxy or WAF Public TLS edge forwards selected paths Explicit CORS, allowed_routes, strong edge policy, named accounts or SSO Suitable when clients require internet access and the edge is operated carefully
Direct public LiteLLM listener LiteLLM itself is internet-facing Requires every control above and leaves less room for containment Last resort; avoid when a private or authenticated edge is available

The security boundary is the combination of secrets, identity, routes, documentation policy, proxy trust, and network placement. Applying only one setting—such as hiding Swagger or changing the master key—does not make a public gateway safe. Build the restricted topology first, verify recovery, and open only the traffic that has a documented purpose.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

API securitycontainer securityCORSDevOpsLiteLLMreverse proxy

Leave a Reply

Your email address will not be published. Required fields are marked *

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.