Question 1 · easy
Something in the lab is missing. Which command do you run first?
make ps shows which container is not Up before you guess. make down stops the lab, and make pull downloads images again.
Free lesson · Module 1, lesson 8 of 8
Start the portal, the server and the log pipeline with one command, make three failed logins, and watch them become a log line, a search result and your first alert.
The whole lab starts with one command, and one wrong password travels through it: the portal writes a JSON line, Alloy ships it, Loki stores it, Grafana finds it, a rule counts it, and the inbox shows the alert. That is the job of a SOC in miniature. Work in ~/cybersecurity-foundations. make up copies .env.example to .env the first time; its passwords are harmless local values for containers on your own laptop.
make pull: every image, once (about 3 GB); the only step that needs the networkmake up: the proxy, the portal, the exam server and the log pipeline (Loki, Grafana, Alloy, the alert inbox), started and waited formake ps: seven containers Up; the portal shows 8000/tcp and no port on the laptop, because only the proxy reaches itcurl -s localhost:8080/health prints {"status":"ok"}127.0.0.1: 8080 the portal, 2222 the exam server's SSH, 3000 Grafana, 9095 the alert inbox; Loki is reached only inside the lab, through Grafanafor i in 1 2 3; do curl -s -o /dev/null -w '%{http_code}\n' -X POST localhost:8080/login -d "username=test.student&password=guess$i"; done prints 401 three times (or use the browser at http://localhost:8080/login)request line and a login_failed line with "src_ip":"10.10.10.1" and "reason":"unknown_user" (no account test.student exists; a real user with a wrong password says bad_password)10.10.10.1 is the gateway of the lab's network campus-lab, where your laptop enters it; an address in a log is the sender as that machine saw ithttp://localhost:3000, Explore, data source Loki, last 15 minutes: {job="portal"} |= "login_failed" returns 3 lines|= "login" returns 6 (each try's request line too); search the event's own name, or {job="portal"} | json | event="login_failed"PortalFailedLogins counts login_failed lines of the last 5 minutes, once a minute, and fires when there are more than 2; Grafana sends it to the inbox after 10 seconds. On the recording it reached the inbox 45 seconds after the third failure; up to about 70 seconds is normal, so allow about two minutes before you look for a faulthttp://localhost:9095 keeps its alerts in a small volume, so make down and make up keep them; a restart only costs timemake up, make ps (first, when something is missing), make logs (Ctrl+C stops following), make down (keeps every volume)make pull, make up, three wrong passwords, find them in Grafana, see PortalFailedLogins in the inbox, then bash labs/m01/check.shOK portal, OK logs (3 failed sign-ins in the last hour) and OK alert (PortalFailedLogins firing, received ...) with the time it arrivedEvery technique in this course is practised only on the lab machines the course gives you, running on your own laptop.
Checked in your browser. Nothing is sent or saved.
5 questions
Question 1 · easy
Something in the lab is missing. Which command do you run first?
make ps shows which container is not Up before you guess. make down stops the lab, and make pull downloads images again.
Question 2 · medium
On a freshly started lab with no other sign-in attempts, you send four wrong passwords for test.student. In Grafana Explore, over the last 15 minutes, {job="portal"} | json | event="login_failed" returns how many lines?
Each try writes a request line and a login_failed line; parsing the JSON and matching the event field keeps only the event line, one per try. 8 counts both lines of each try; 1 counts the user, not the tries.
Question 3 · medium
Your own failed sign-in shows "src_ip":"10.10.10.1", not your Wi-Fi address. Why?
10.10.10.0/24 is the lab's network campus-lab, and .1 is its gateway. Your curl or browser reaches the proxy through it, and an address in a log is the sender as that machine saw it.
Question 4 · medium
Thirty seconds after your third wrong password, the inbox at localhost:9095 is still empty. What do you do?
Grafana runs the rule once a minute over the last 5 minutes, then waits 10 seconds before sending. On the recording the alert arrived 45 seconds after the third failure, and up to about 70 is normal. More failures or a restart do not make the rule run sooner.
Question 5 · hard
You send two wrong passwords at 10:00, then one more at 10:07, and nothing else. Does PortalFailedLogins fire?
The rule counts login_failed lines of the last 5 minutes, once a minute, and fires when the count is more than 2. At 10:07 the two from 10:00 are already older than 5 minutes, so the count is 1. It counts lines, not addresses.
The pass mark is 4 of 5 right.
Look at these again, each with its explanation:
Your answers stay in this browser tab. Nothing is sent or saved.
Setting up: Docker and the lab on an 8 GB laptopThat was the free module. Tell me when the course opens
You are offline. Pages you opened before still open; forms, sign-in, payments and videos need a connection.