Lion Cipher Lab
Harden an exposed local Ollama server: prove what 0.0.0.0 gives a stranger, then put an authenticating Caddy proxy in front
- AI Security
- Intermediate
- ~60 min
- Free · no account required
Why it matters
People who run a local model often want to reach it from a laptop, a phone or a container. The quick fix is to tell Ollama to listen on every network address. Ollama's own documentation says its local API does not require authentication, so after that change anyone who can reach the machine can list the models, run them on your hardware, copy them, delete them, or ask the server to download new ones. The same mistake shows up whenever a developer tool built for one machine gets a network address. The safe pattern is old and simple: keep the tool on the loopback address and put a small,…
What you'll learn
- explaining why Ollama's local API needs a network boundary rather than a login
- showing with curl what a stranger on your network can do after OLLAMA_HOST is opened up
- putting Caddy in front of Ollama with hashed-password basic authentication
- limiting the proxy to the few API paths an application really needs
- testing every door before and after with curl and reading the status codes
- naming what basic auth still does not give you
Steps in this lab
- Start from the default: private by location, not by password
- Open it up on purpose, for one minute, and see what a neighbour can do
- Install Caddy and make a password hash
- Write the Caddyfile: authenticate, then forward
- Put Ollama back on loopback, then test every door with curl
- A password still opens every endpoint: add a path allow-list
- Basic auth over plain HTTP is not secure: add TLS
- What this still does not give you
- Clean up
Open the full interactive lab →