[ norboten ]
automation · lab ollama-01

The Model Server Anyone Can Use

· about 30 minutes · runs on ubuntu-26.04-automation · unrated

An unrated lab. It runs on your machine with no account and no network, and everything about it — the faults, the checks, the hints and the reference solution — is in the repository. An attempt on it is recorded on your profile and never moves a rating: only rated labs do. Rated and unrated labs.

The briefing

This machine runs Ollama with qwen2.5:0.5b for the team's internal chat page, https://chat.internal.example. To make the page work, someone set Ollama to listen on every address and to accept requests from any web origin. nginx on port 8080 was meant to be the way in.

The monthly network scan found port 11434 answering anyone on the office network: it lists the models, runs them, and would pull new ones on request. Ollama has no passwords of its own.

The team's account for the proxy is team; its password is in /root/team-password.

What is expected, and graded:

  1. Ollama listens on the loopback address only, and still runs and starts at boot.
  2. http://127.0.0.1:8080/ asks for a password: no credentials, or wrong ones, get 401; team with the right password gets the model list.
  3. A browser page on another site cannot call Ollama; the chat page at https://chat.internal.example, coming through the proxy with the password, can.

You have root through sudo. Everything must still hold after a reboot.

What is graded

The machine is checked, rebooted, and checked again. A check passes only if it passes both times.

CheckObjective
01_ollama_listens_only_on_loopbackKeep an unauthenticated model server off the network
02_the_proxy_asks_for_the_team_passwordPut a password in front of it for the people who should use it
03_only_the_chat_page_may_call_from_a_browserAllow exactly the web page that needs it to call it from a browser

Start it

  1. 2Labs
  2. ollama-01select this one
  3. udownload it
  4. sstart the machine

Reading

Where the lab's hints send you, level by level, as you ask for them (h, then l opens a journal section in the TUI).

Theory for this lab

4 questions on the same topic, in the lab's Theory tab. They never affect the lab's grade. Three of them, to answer here:

Question 1

What does Ollama do to check who is calling its API?

Question 2

ollama.service sets OLLAMA_HOST=127.0.0.1:11434, yet ss shows Ollama on *:11434. Where is the other value most likely set, and how do you see it?

Question 3

A browser page at https://chat.internal.example calls Ollama through nginx and gets 403, while curl without an Origin header gets 200. What is refusing it?