Skip to the levels
ROOTSPIRE
DiscsFor teachers
▶ Play freeLibrary 16 discsDiscsFor teachersLog in

Every level, in the open

Linux Sysadmin Pro

12 worlds · 131 levels · 11 bosses

SOLUTION HIDDENTeachers see answer keys in the classroom.

▶ Play this discAll discs
All discsLinux: Zero to RootBash ScriptingGitDatabasesPython for OpsLinux Sysadmin ProNetworkingObservabilityCloud & IaCDocker & ContainersCTF ArenaSOC FieldWindows for Linux peopleKubernetesAnsibleThe Guildhall: First Week

The sequel: recover boxes that will not boot, run real nginx, haproxy, chrony and dnsmasq, build real nftables walls, and harden a server to a checklist. GRUB/rescue, SELinux, firewalld/ufw, PAM and auditd are honest simulators (labelled SIM) that show the real RHEL and Ubuntu commands.

Guided levels show the command first. Alone levels give the goal only. Bosses and exams are timed.

Jump to a world

World 1 Boot & RecoveryWorld 2 Remote DoorsWorld 3 The Front DoorWorld 4 Firewalls for RealWorld 5 SELinuxWorld 6 Hardening & AuditWorld 7 HypervisorsWorld 8 Rescue Night (real VM)World 9 Locked Out (real VM)World 10 SELinux for Real (real VM)World 11 Hypervisors for Real (real VM)Final exam The Pro Exam

World 1Boot & Recovery

12 levels

GRUB, kernel args, rescue shells, lost root passwords and broken fstabs on a SIM RHEL console (next: real Rocky VMs), plus real fstab and sysctl.

  1. 1

    Level 1: Power on

    GuidedEasy

    Objective: Attach to the RHEL box with console, read its kernel line with e, and boot it.

    Every Linux box starts the same way: firmware → GRUB → kernel + initramfs → systemd. GRUB shows a menu; e shows the kernel line it is about to use.

    Commands taughtsim-consolegrub

    ▶ Play: Power onSOLUTION HIDDEN20 XP
  2. 2

    Level 2: The quiet room

    GuidedEasy

    Objective: Boot the box once into rescue.target by adding systemd.unit=rescue.target to its kernel line.

    A kernel argument you add at the GRUB edit screen lasts one boot. systemd.unit=rescue.target boots a root shell with the disks mounted and no services: the quiet room for repairs.

    Commands taughtkernel-args

    ▶ Play: The quiet roomSOLUTION HIDDEN22 XP
  3. 3

    Level 3: Locked out

    GuidedEasy

    Objective: Reset the box's root password to Rescue-2026 with rd.break, and log in.

    Nobody knows the root password. rd.break stops the boot in the initramfs, with the real disk read-only at /sysroot. From there you can change the password, if you remember SELinux.

    Commands taughtrd-break

    ▶ Play: Locked outSOLUTION HIDDEN30 XP
  4. 4

    Level 4: Read the entry, change the entry

    GuidedEasy

    Objective: On a running box, read the boot entry, add the argument audit=1 for good, take it away again, then reboot and boot the default entry.

    The e key edits the boot line for ONE boot. grubby edits the boot entry itself, so a change stays for every boot. You will meet it in four small steps: look, add, remove, prove with a reboot.

    Commands taughtgrubby

    ▶ Play: Read the entry, change the entrySOLUTION HIDDEN22 XP
  5. 5

    Level 5: The tattoo

    AloneMedium

    Objective: Make the box always boot without "rhgb quiet", so the next outage shows its errors.

    The e key changes one boot. grubby changes the boot entry itself, for every boot and every kernel.

    ▶ Play: The tattooSOLUTION HIDDEN24 XP
  6. 6

    Level 6: Promise vs contract

    AloneMedium

    Objective: Set kernel.panic to 10 on this VM, now and after every reboot.

    Back on your real VM. A kernel that panics should reboot itself after 10 s instead of hanging forever: kernel.panic=10. sysctl -w sets it now; /etc/sysctl.d makes it survive a reboot.

    Commands taughtsysctl-d

    ▶ Play: Promise vs contractSOLUTION HIDDEN26 XP
  7. 7

    Level 7: PID 1 is you

    AloneMedium

    Objective: Another box, another lost password: reset root to Night-Shift-7 using init=/bin/bash, and log in.

    init=/bin/bash replaces systemd with a bare shell as PID 1, on every distro. Remount / rw, fix, relabel, and hand over with hidden (never exit).

    Commands taughtinit-bash

    ▶ Play: PID 1 is youSOLUTION HIDDEN34 XP
  8. 8

    Level 8: Peek into the backpack

    GuidedEasy

    Objective: Look inside the initramfs, rebuild it, then rebuild it with the nvme driver added.

    Before the real root exists, the kernel unpacks a small backpack of drivers called the initramfs. lsinitrd looks inside it, hidden packs a new one, and --add-drivers puts one more driver in.

    Commands taughtinitramfs

    ▶ Play: Peek into the backpackSOLUTION HIDDEN22 XP
  9. 9

    Level 9: The forgotten backpack

    Alone⏱ TimedHard

    Objective: Rebuild the box's initramfs with the virtio_blk driver, reboot and boot the normal entry.

    The box moved to a new hypervisor whose disks need the virtio_blk driver. The initramfs lacks it, so the kernel never finds root; you booted the rescue entry (it has every driver) to fix it.

    ▶ Play: The forgotten backpackSOLUTION HIDDEN36 XP
  10. 10

    Level 10: You are in emergency mode

    Alone⏱ TimedHard

    Objective: PAGER: rhel10 is stuck in emergency mode after maintenance, so fix its fstab and bring it to multi-user.

    Someone pulled the backup disk but left its fstab line. The box stops in emergency mode with / read-only.

    Commands taughtemergency-mode

    ▶ Play: You are in emergency modeSOLUTION HIDDEN40 XP
  11. 11

    Level 11: The wrong label

    Alone⏱ TimedHard

    Objective: PAGER: /srv/llogs is empty after every reboot, so fix its /etc/fstab line (LABEL or the real UUID, plus nofail) to mount it at boot.

    Real VM, real disk: the logs disk (label LOGS) has an fstab line with a stale UUID, so hidden fails and /srv/llogs is empty after every boot.

    ▶ Play: The wrong labelSOLUTION HIDDEN40 XP
  12. 12

    Level 12: BOSS: The box that won't boot

    Boss⏱ TimedHard

    Objective: Bring rhel10 back: boot it once, reset root to Pager-Duty-42, fix the kernel entry and fstab for good, and log in.

    A colleague "tidied up" rhel10 at 2 a.m.: a grubby typo in root=, a dead fstab line, and then he forgot the root password. Three faults, one console.

    ▶ Play: BOSS: The box that won't bootSOLUTION HIDDEN80 XP

World 2Remote Doors

12 levels

The new office server: ssh keys only, an honest clock with chrony, office names with dnsmasq, and shared folders (NFS exports = SIM).

  1. 13

    Level 13: Test before you trust

    GuidedEasy

    Objective: Nobody can ssh into server since last night, so find the bad line with hidden, fix it, and prove ssh server@server works.

    The ssh server rereads its config for every new connection. One bad line and every new login is refused. hidden tests the config and names the broken file and line.

    Commands taughtsshd-test

    ▶ Play: Test before you trustSOLUTION HIDDEN24 XP
  2. 14

    Level 14: Keys only

    GuidedEasy

    Objective: Turn password logins off for good with a drop-in /etc/ssh/sshd_config.d/10-harden.conf, prove it with sudo sshd -T, and check your key still gets you in.

    sshd reads /etc/ssh/sshd_config.d/*.conf in name order, and the FIRST value for a keyword wins. This VM ships ptr.conf with PasswordAuthentication yes, so your setting must live in a file that sorts first.

    Commands taughtsshd-dropinssshd-hardening

    ▶ Play: Keys onlySOLUTION HIDDEN26 XP
  3. 15

    Level 15: Wait for the clock

    GuidedEasy

    Objective: Read the time sources, wait for a sync that cannot come, start the office time server, and wait again.

    chronyc talks to chronyd, the time daemon. hidden lists the time servers (^* = synced to it, ^? = cannot reach it); chronyc waitsync waits until the clock is synced, then answers yes or no.

    ▶ Play: Wait for the clockSOLUTION HIDDEN22 XP
  4. 16

    Level 16: What time is it?

    GuidedEasy

    Objective: Point chrony at the time server 127.0.0.2 instead of the pool, enable --now chronyd, run `hidden`, and get ^* in hidden.

    chronyd keeps the clock in sync with NTP servers listed in chrony.conf (server NAME iburst). The office time server is 127.0.0.2. hidden shows ^* next to the server you are synced to.

    Commands taughtchrony

    ▶ Play: What time is it?SOLUTION HIDDEN28 XP
  5. 17

    Level 17: Test the names file

    GuidedEasy

    Objective: Test the office DNS config, add one name record, and test again.

    dnsmasq is a tiny DNS server. Like sshd -t and nginx -t, it can test its own config before you start it: dnsmasq --test says "syntax check OK" or names the bad line.

    Commands taughtdnsmasq

    ▶ Play: Test the names fileSOLUTION HIDDEN22 XP
  6. 18

    Level 18: Office names

    AloneMedium

    Objective: Make the office DNS on 127.0.0.1 answer files.office.lan → 10.20.0.15 and ntp.office.lan → 127.0.0.2, and keep dnsmasq running across reboots.

    dnsmasq is a small DNS server. A line host-record=NAME,IP in /etc/dnsmasq.conf answers NAME with IP. dnsmasq --test checks the file; dig @127.0.0.1 asks it directly.

    ▶ Play: Office namesSOLUTION HIDDEN30 XP
  7. 19

    Level 19: The share table (SIM)

    GuidedEasy

    Objective: Look at the empty share list, export /srv/share read-only to the office network, apply it, and look again.

    [SIM] An NFS server shares folders listed in /etc/exports. The file is only a plan: exportfs -ra loads it into the live table, and hidden prints what is really shared. Same syntax as the real nfs-utils.

    Commands taughtnfs-exports

    ▶ Play: The share table (SIM)SOLUTION HIDDEN24 XP
  8. 20

    Level 20: Sharing folders (SIM)

    AloneMedium

    Objective: Export /srv/share read-only to 10.20.0.0/24 and /srv/scans read-write to the scanner 10.20.0.40 only, apply it, and check with hidden.

    [SIM] An NFS server shares the folders in /etc/exports, one "path client(options)" per line, and exportfs -ra loads the file into the live table. This VM has no NFS server: exportfs and showmount are simulators with the real syntax.

    Commands taughtsamba

    ▶ Play: Sharing folders (SIM)SOLUTION HIDDEN30 XP
  9. 21

    Level 21: The guest list

    AloneMedium

    Objective: In sshd_config.d/10-harden.conf: no root login, no passwords, only server allowed. sshd -t silent, and your key login still works.

    AllowUsers server lets ONLY the listed users log in over ssh, key or not, and PermitRootLogin no refuses root by name. Add keys only and you have the classic hardened door.

    ▶ Play: The guest listSOLUTION HIDDEN32 XP
  10. 22

    Level 22: Clock drift

    Alone⏱ TimedHard

    Objective: PAGER: the clock drifts and hidden shows ^? for 127.0.0.2, so make it sync to the office time server again and survive a reboot.

    ^? and Reach 0 in hidden mean the time server never answers: a chrony server only answers networks on an allow line. A client that is not enabled is gone after the next reboot.

    ▶ Play: Clock driftSOLUTION HIDDEN40 XP
  11. 23

    Level 23: The wrong address

    Alone⏱ TimedHard

    Objective: PAGER: files.office.lan points to the dead NAS 10.20.0.99. dig @127.0.0.1 files.office.lan must answer 10.20.0.15 and nothing else.

    dnsmasq answers from its config AND from /etc/hosts. A stale hosts line or a typo in a record and half the office goes to the old NAS.

    ▶ Play: The wrong addressSOLUTION HIDDEN40 XP
  12. 24

    Level 24: BOSS: The new office server

    Boss⏱ TimedHard

    Objective: Harden ssh (no root, keys only, only server), sync time to 127.0.0.2, serve files.office.lan, export /srv/share read-only, then reboot and prove it.

    Ticket: the new office server goes live tonight, and Dave started the setup before his holiday. Door, clock, names and shares must all come back after a reboot.

    ▶ Play: BOSS: The new office serverSOLUTION HIDDEN90 XP

World 3The Front Door

12 levels

Real nginx and HAProxy: serve a site, add server blocks, proxy to two backends, balance and health-check them, read the logs.

  1. 25

    Level 25: Test before you serve

    GuidedEasy

    Objective: Test the web server config, fix the typo it names, test again, and list the files nginx reads.

    nginx -t reads every config file and says "test is successful", or names the bad file and line. Run it after every edit, before any start or reload.

    ▶ Play: Test before you serveSOLUTION HIDDEN22 XP
  2. 26

    Level 26: Open the doors

    GuidedEasy

    Objective: Make nginx serve /var/www/site on port 80 instead of its 404 page, test it with `nginx -t`, and start it at boot.

    nginx serves the folder named by root in a server { } block. nginx -t tests every config file; only a config that passes should ever be started.

    Commands taughtnginx

    ▶ Play: Open the doorsSOLUTION HIDDEN24 XP
  3. 27

    Level 27: Two names, one door

    GuidedEasy

    Objective: Add a server block for shop.office.lan serving /var/www/shop in /etc/nginx/http.d/shop.conf, test it, and reload nginx.

    One nginx serves many sites: each server { } block has a server_name, and the Host of the request picks the block. reload loads new blocks without dropping a single connection.

    Commands taughtnginx-server-blocks

    ▶ Play: Two names, one doorSOLUTION HIDDEN26 XP
  4. 28

    Level 28: Pass it back

    GuidedEasy

    Objective: Publish the app as app.office.lan: a server block in /etc/nginx/http.d/app.conf that proxies to 127.0.0.1:8081, tested and reloaded.

    The office app runs on 127.0.0.1:8081, where nobody outside can reach it. location / { proxy_pass http://127.0.0.1:8081; } makes nginx forward requests to it and hand back the answer.

    Commands taughtreverse-proxy

    ▶ Play: Pass it backSOLUTION HIDDEN28 XP
  5. 29

    Level 29: Two cooks

    AloneMedium

    Objective: Make app.office.lan use both backends (8081 and 8082) through an upstream block, so that requests alternate between app1 and app2.

    A second copy of the app runs on 127.0.0.1:8082. An upstream block names both servers, and proxy_pass http://apps; makes nginx take turns between them.

    Commands taughtnginx-upstream

    ▶ Play: Two cooksSOLUTION HIDDEN30 XP
  6. 30

    Level 30: Check before you start

    GuidedEasy

    Objective: Check the live HAProxy config, check a draft with a typo in ~/lb.cfg, fix it and check again.

    HAProxy can check a config file the way nginx -t does: haproxy -c -f FILE. -c = check only, -f = which file. A broken file prints the line to fix and exits with an error; a good one says "Configuration file is valid".

    Commands taughthaproxy

    ▶ Play: Check before you startSOLUTION HIDDEN22 XP
  7. 31

    Level 31: HAProxy

    AloneMedium

    Objective: Add a frontend on 127.0.0.1:8080 and a roundrobin backend with app1 and app2 to /etc/haproxy/haproxy.cfg, check it, and run HAProxy at boot.

    HAProxy is a dedicated load balancer: a frontend binds an address and port, a backend lists the servers, balance roundrobin takes turns. haproxy -c -f checks the file like nginx -t.

    ▶ Play: HAProxySOLUTION HIDDEN32 XP
  8. 32

    Level 32: sed: remember a piece

    GuidedEasy

    Objective: Practise on a small file, ~/menu.txt: remember a word, then add a word to the end of each line, then save it.

    In a sed replacement, \( ... \) remembers what it matched, and \1 pastes it back. So "keep the line, add a word at the end" is: s/^\(the whole line\)$/\1 and the new word/. You need it next to add check to every server line.

    ▶ Play: sed: remember a pieceSOLUTION HIDDEN24 XP
  9. 33

    Level 33: A cook goes home

    AloneMedium

    Objective: Every request to 127.0.0.1:8080 must succeed while app2 is down: add health checks to both servers (keep app2 in the config) and restart HAProxy.

    app2 just crashed, and HAProxy still sends it every second request: those visitors get 503. A check on each server line makes HAProxy test them and skip the dead one.

    Commands taughthealth-checks

    ▶ Play: A cook goes homeSOLUTION HIDDEN34 XP
  10. 34

    Level 34: 502 at lunch

    Alone⏱ TimedHard

    Objective: PAGER: app.office.lan answers 502 Bad Gateway, so find the bad backend address in nginx's error.log and fix it.

    502 Bad Gateway means nginx could not talk to a backend. access.log only has the 502; error.log says which upstream address refused the connection.

    Commands taughtnginx-logs

    ▶ Play: 502 at lunchSOLUTION HIDDEN40 XP
  11. 35

    Level 35: Address already in use

    Alone⏱ TimedHard

    Objective: PAGER: the intranet is down after Dave's maintenance, so find what holds port 80, stop it for good, and get nginx serving again across reboots.

    nginx is enabled but failed: bind() to 0.0.0.0:80 failed (98: Address in use). Only one program can listen on a port, and ss -ltnp names it.

    ▶ Play: Address already in useSOLUTION HIDDEN40 XP
  12. 36

    Level 36: BOSS: The front door is down

    Boss⏱ TimedHard

    Objective: Bring the chain back: HAProxy on 127.0.0.1:8080, nginx on port 80, app.office.lan reaching app1 AND app2, and all of it after a reboot.

    nginx on :80 forwards app.office.lan to HAProxy on 127.0.0.1:8080, which balances app1 and app2. After Dave's "HAProxy upgrade" the whole chain is down.

    ▶ Play: BOSS: The front door is downSOLUTION HIDDEN90 XP

World 4Firewalls for Real

13 levels

Real nftables walls tested from a second machine, rules that survive reboot, port redirects, then firewalld and ufw (SIM, real nft).

  1. 37

    Level 37: Read the wall

    GuidedEasy

    Objective: Read the live ruleset, find the port it blocks, and prove it from the client.

    In Basics the firewall was a text file; now the kernel holds the rules and hidden prints them. Your VM is the server, and a second machine, "client", sits at 10.9.0.2.

    Commands taughtfw-labnft-list

    ▶ Play: Read the wallSOLUTION HIDDEN20 XP
  2. 38

    Level 38: Your first rule

    GuidedEasy

    Objective: The dev app on 8080 is visible from the client: build table inet fw, a base chain input and a rule that drops 8080, keeping port 80 open.

    nft builds a tree: a table (family inet = IPv4+IPv6) holds chains; a base chain hooks into the kernel ("hook input" = packets for this machine); rules inside run top to bottom.

    Commands taughtnft-build

    ▶ Play: Your first ruleSOLUTION HIDDEN24 XP
  3. 39

    Level 39: Default drop

    GuidedEasy

    Objective: Chain inet fw input is ready (policy accept): accept replies, lo, ssh and http, then set policy drop so only 22 and 80 get in.

    An allow-list: accept what you name, drop the rest with the chain policy. Two accepts nobody names but everybody needs: ct state established,related (replies to YOUR connections) and iif lo (the machine talking to itself).

    Commands taughtnft-policy

    ▶ Play: Default dropSOLUTION HIDDEN30 XP
  4. 40

    Level 40: Dry run, then edit a file

    GuidedEasy

    Objective: Check ~/draft.nft, preview a new line with sed, save it with -i, and check again.

    Rules in a file can be tested without loading them: nft -c -f FILE checks the syntax and changes nothing. And to change one line of a file from the command line, sed can add a line after a match: sed '/pattern/a new line' FILE.

    Commands taughtnft-persist

    ▶ Play: Dry run, then edit a fileSOLUTION HIDDEN24 XP
  5. 41

    Level 41: Survive the reboot

    AloneMedium

    Objective: Yesterday's wall (22 and 80 only, policy drop) is live but not saved: make it survive a reboot (the check reboots and tests again).

    Live rules live in the kernel and die with it. At boot the nftables service loads /etc/nftables.nft, so what is not in that file does not exist after a reboot.

    ▶ Play: Survive the rebootSOLUTION HIDDEN34 XP
  6. 42

    Level 42: The app moved

    AloneMedium

    Objective: The shop app listens on 8080 only, but every client still types http://10.9.0.1/: make port 80 from the network land on 8080.

    A nat chain on hook prerouting rewrites where an incoming packet is going, before the filter sees it. redirect to :PORT is DNAT to this same machine.

    Commands taughtnft-dnat

    ▶ Play: The app movedSOLUTION HIDDEN34 XP
  7. 43

    Level 43: Meet firewall-cmd

    GuidedEasy

    Objective: Look at the zones, open https for good, and make it live.

    This box plays a RHEL server: firewalld (SIM) keeps zones and services. firewall-cmd talks to it. Two views: runtime (live now) and permanent (saved). --permanent writes the saved one, --reload makes live match saved.

    Commands taughtfirewall-cmd

    ▶ Play: Meet firewall-cmdSOLUTION HIDDEN26 XP
  8. 44

    Level 44: Red Hat's way

    AloneMedium

    Objective: Open http for good, let ONLY the admin network (10.8.0.0/24) reach the app on 8080 (rich rule, for good), then read what firewalld really wrote.

    This box plays a RHEL server: firewalld (SIM) is running with zone public (ssh only). firewall-cmd changes runtime (live) or, with --permanent, the saved zone file; --reload makes live = saved. It writes real nft rules.

    ▶ Play: Red Hat's waySOLUTION HIDDEN38 XP
  9. 45

    Level 45: Undo a service, forward a port

    GuidedEasy

    Objective: mysql is open in the saved config: close it for good, then forward port 2222 to ssh (22).

    The same firewall-cmd, two more verbs: --remove-service closes a service, --add-forward-port sends one port to another. Both are saved with --permanent and applied with --reload.

    ▶ Play: Undo a service, forward a portSOLUTION HIDDEN26 XP
  10. 46

    Level 46: Meet ufw

    GuidedEasy

    Objective: Build a small wall with ufw, enable it, then delete one rule by its number.

    This box plays Ubuntu: ufw (SIM) is the friendly front of nftables. The safe order is always: default deny, allow ssh first, allow what you need, then enable. status numbered gives each rule a number so you can delete one.

    Commands taughtufw

    ▶ Play: Meet ufwSOLUTION HIDDEN28 XP
  11. 47

    Level 47: Ubuntu at 5 p.m.

    Alone⏱ TimedHard

    Objective: Before 5 p.m.: default deny incoming, allow 22/tcp and 80/tcp, delete the old database rule and enable ufw, so the client reaches only 22 and 80.

    This box plays Ubuntu: ufw (SIM) is installed but inactive, and an old rule from a past project is still in its list. ufw writes real nft (table ip filter).

    ▶ Play: Ubuntu at 5 p.m.SOLUTION HIDDEN44 XP
  12. 48

    Level 48: Monday after the reload

    Alone⏱ TimedHard

    Objective: Make it right for good (permanent AND live): http open, mysql closed, and port 2222 forwarded to ssh (22) for the old jump-host scripts.

    On the RHEL box someone fixed the web with runtime-only commands. The weekly --reload threw it all away, and the saved config still opens mysql to the world.

    ▶ Play: Monday after the reloadSOLUTION HIDDEN46 XP
  13. 49

    Level 49: BOSS: Lockdown without lockout

    Boss⏱ TimedHard

    Objective: Lock it down (ssh only from 10.8.0.0/24, http for all, replies allowed, the rest dropped), load it atomically and make it survive a reboot.

    The audit is tomorrow and the prod box is wide open (3306 and 8080 for everybody). A colleague left a draft in ~/lockdown.nft with two bugs, and one of them locks the admins out of ssh.

    Commands taughtfw-lockout

    ▶ Play: BOSS: Lockdown without lockoutSOLUTION HIDDEN90 XP

World 5SELinux

13 levels

The 403 chmod cannot fix: labels, restorecon, semanage, booleans and AVCs, as a SIM warm-up of the RHEL policy before a real Rocky VM.

  1. 50

    Level 50: Is the bouncer awake?

    GuidedEasy

    Objective: The bakery page gives 403 with good permissions: prove SELinux is the cause with a one-minute permissive test, then put enforcing back.

    This box plays a RHEL server with SELinux (SIM). A second lock next to rwx: the policy says what each service may touch. getenforce shows the mode; hidden (permissive) only logs denials, hidden (enforcing) blocks them.

    Commands taughtselinux-simmac-distrosgetenforce

    ▶ Play: Is the bouncer awake?SOLUTION HIDDEN22 XP
  2. 51

    Level 51: The note on the fridge

    GuidedEasy

    Objective: Someone left this server in permissive two years ago, in the file AND live: make it enforcing now and after a reboot (the check reboots).

    /etc/selinux/config decides the mode at boot (SELINUX=enforcing|permissive|disabled). setenforce changes the running kernel only. sestatus shows both: Current mode and Mode from config file.

    Commands taughtselinux-config

    ▶ Play: The note on the fridgeSOLUTION HIDDEN24 XP
  3. 52

    Level 52: Name tags

    GuidedEasy

    Objective: Read the name tags: the web server's domain, the one page with the wrong file type, and your own context.

    Every process, file and port wears a context user:role:TYPE:level. -Z shows it: ps -eZ for processes, ls -Z for files, id -Z for you. The policy mostly reads the TYPE: domain httpd_t may read httpd_sys_content_t files.

    Commands taughtselinux-labels

    ▶ Play: Name tagsSOLUTION HIDDEN24 XP
  4. 53

    Level 53: Moved, not copied

    GuidedEasy

    Objective: Publish ~/sale.html with mv, see the 403 and its AVC, then fix the label (no permissive, no booleans).

    mv keeps a file's label (it moves the same inode); cp makes a new file that takes its new directory's label. A page made in your home and mv'd into /var/www/html still says user_home_t, and httpd_t may not read that. restorecon -v puts the default label back.

    Commands taughtrestoreconausearch

    ▶ Play: Moved, not copiedSOLUTION HIDDEN28 XP
  5. 54

    Level 54: Teach the policy a new default

    GuidedEasy

    Objective: A new folder /srv/cafe holds a web page. Teach the policy its label, then apply it.

    restorecon puts back the label the POLICY says a path should have. For a brand new folder the policy has no opinion, so restorecon puts back the wrong one. semanage fcontext writes a new rule into the policy; restorecon -R then applies it to every file inside.

    Commands taughtsemanage-fcontext

    ▶ Play: Teach the policy a new defaultSOLUTION HIDDEN26 XP
  6. 55

    Level 55: A shop in /srv

    AloneMedium

    Objective: The new shop in /srv/shop (httpd.conf already points there) gives 403: make it served for good, so it still works after a full relabel.

    restorecon only restores what the policy calls the default. For /srv/shop the default is var_t, so restorecon "fixes" it to the wrong type. semanage fcontext -a -t TYPE '/srv/shop(/.*)?' teaches the policy a new default; restorecon -Rv then applies it.

    ▶ Play: A shop in /srvSOLUTION HIDDEN34 XP
  7. 56

    Level 56: Ports have types too

    GuidedEasy

    Objective: List the ports httpd may open, add port 8082 to that type, and check it is there.

    SELinux labels network ports too, and a service may only open ports whose type it is allowed to use. semanage port -l lists the types, semanage port -a adds a port to one.

    Commands taughtsemanage-port

    ▶ Play: Ports have types tooSOLUTION HIDDEN24 XP
  8. 57

    Level 57: The door on 8081

    AloneMedium

    Objective: The new site must answer on port 8081 (httpd.conf already says Listen 8081) but httpd will not start: get it running on 8081.

    Ports have types too, and httpd_t may only bind ports of type http_port_t (80, 443, 8443 ...). After Listen 8081, httpd fails to start with "(13)Permission denied: make_sock". semanage port -a gives 8081 the http_port_t type.

    ▶ Play: The door on 8081SOLUTION HIDDEN34 XP
  9. 58

    Level 58: Policy switches (booleans)

    GuidedEasy

    Objective: An app cannot reach its Redis. Read the denial, find the switch, flip it, then save it.

    The policy has on/off switches called booleans. audit2why reads a denial from the audit log and names the switch to flip, getsebool reads a switch, setsebool changes it. Without -P the change lasts until reboot; with -P it is saved.

    Commands taughtseboolaudit2why

    ▶ Play: Policy switches (booleans)SOLUTION HIDDEN26 XP
  10. 59

    Level 59: The proxy that could not call

    AloneMedium

    Objective: /api is proxied to the inventory service on 127.0.0.1:3000 and answers 503: find why with audit2why and fix it for good (the check reboots).

    Booleans are switches in the policy: httpd_can_network_connect lets httpd open outgoing connections (a reverse proxy to an API). setsebool -P flips one now AND for the next boot. audit2why reads an AVC and names the boolean.

    ▶ Play: The proxy that could not callSOLUTION HIDDEN36 XP
  11. 60

    Level 60: Night shift: read the log

    Alone⏱ TimedHard

    Objective: Pager says "menu page broken": find the recent denial among the old noise and fix it properly before the morning rush.

    The audit log is full of old denials from other days. ausearch -ts recent keeps only the last 10 minutes; sealert -a turns each denial into ranked advice. Fix what is broken NOW, the way the top suggestion says.

    Commands taughtsealert

    ▶ Play: Night shift: read the logSOLUTION HIDDEN44 XP
  12. 61

    Level 61: The migration

    Alone⏱ TimedHard

    Objective: Migration night: the site now lives in /web/bakery and the cut-over is in 8 minutes, so make it served, for good, still enforcing.

    The site moved to a new disk mounted at /web, and new top-level paths get default_t, which httpd_t may neither read nor even walk through. A rule must cover the parent too.

    ▶ Play: The migrationSOLUTION HIDDEN48 XP
  13. 62

    Level 62: BOSS: The 3-fault outage

    Boss⏱ TimedHard

    Objective: Bring the shop back on 8088 (httpd running, pages 200, /api 200 after a reboot): read the denials and fix each cause, never permissive.

    After a "quick change" the shop is down three ways: httpd moved to port 8088 and will not start, the pages were rebuilt in a home directory and mv'd in, and /api cannot reach the inventory. SELinux must stay enforcing the whole time.

    Commands taughtselinux-interview

    ▶ Play: BOSS: The 3-fault outageSOLUTION HIDDEN100 XP

World 6Hardening & Audit

15 levels

Harden a server to a checklist: loose files, services, kernel knobs, least-privilege sudo, PAM and auditd (SIM), logrotate, lynis, then the audit.

  1. 63

    Level 63: Compare two lists

    GuidedEasy

    Objective: Find the two programs in ~/suid-new.txt that are not in ~/suid-old.txt, one grep switch at a time.

    grep -f FILE reads its patterns from a file, one per line. With -v (match none), -x (whole lines) and -F (plain text, not a regex), grep tells you what is new in a list.

    ▶ Play: Compare two listsSOLUTION HIDDEN20 XP
  2. 64

    Level 64: Loose files

    GuidedEasy

    Objective: Close the world-writable files in /srv/app, give the orphaned files to root, and find + defuse the SUID program that is not in the baseline.

    An audit starts with three find searches: world-writable files (-perm -0002), files owned by a deleted user (-nouser), and SUID programs compared against a baseline list.

    Commands taughtperm-audit

    ▶ Play: Loose filesSOLUTION HIDDEN24 XP
  3. 65

    Level 65: Password rules

    GuidedEasy

    Objective: Require 14 chars from 3 classes, lock after 5 failures for 15 minutes, unlock bob and make him change his password every 90 days.

    On RHEL and Ubuntu, PAM reads /etc/security/pwquality.conf (how good a new password must be) and /etc/security/faillock.conf (lock after N failures). Alpine has no PAM: pwscore and faillock here are a SIM over those real files. chage is real.

    Commands taughtpwqualityfaillock

    ▶ Play: Password rulesSOLUTION HIDDEN26 XP
  4. 66

    Level 66: Rules that come back

    GuidedEasy

    Objective: List the live rules, write one rule file, load it with augenrules, and check that both sets agree.

    [SIM] auditd has two rule sets: the live one (auditctl -l) and the files in /etc/audit/rules.d. augenrules --load makes the files the live set; augenrules --check only says whether they differ.

    ▶ Play: Rules that come backSOLUTION HIDDEN22 XP
  5. 67

    Level 67: Who touched passwd?

    GuidedEasy

    Objective: Watch /etc/passwd and /etc/shadow (key identity), make the rules survive a reboot, then catch a change in the trail.

    auditd watches files: auditctl -w FILE -p wa -k KEY logs every write or attribute change with your key; ausearch -k KEY finds the events. Live rules die at reboot, rules in /etc/audit/rules.d come back. (auditd is a SIM here; the rules.d files are real.)

    Commands taughtauditd

    ▶ Play: Who touched passwd?SOLUTION HIDDEN28 XP
  6. 68

    Level 68: The log that ate /var

    GuidedEasy

    Objective: Give /var/log/webapp/*.log a daily rotation (keep 7, compressed, quiet when missing or empty), dry-run it, then force one rotation.

    logrotate renames a log to .1, compresses it, keeps N copies and starts a fresh one. Each app gets a block in /etc/logrotate.d/NAME; logrotate -d is a dry run, -f forces a rotation now.

    Commands taughtlogrotate

    ▶ Play: The log that ate /varSOLUTION HIDDEN24 XP
  7. 69

    Level 69: Too many doors

    AloneMedium

    Objective: Stop and disable telnetd, rpcbind and avahi-daemon while the shop app webapp keeps running.

    Every running service is code waiting for input. On a shop server, telnet (cleartext logins), rpcbind (NFSv3, not used here) and avahi (mDNS) have no business running. disable --now stops them AND keeps them off after reboot.

    Commands taughtdisable-services

    ▶ Play: Too many doorsSOLUTION HIDDEN30 XP
  8. 70

    Level 70: Apply a sysctl file

    GuidedEasy

    Objective: Write a one-line sysctl file, apply it with sysctl -p, and tidy up.

    A file in /etc/sysctl.d is a promise for the next boot. To apply it right now without rebooting: sysctl -p FILE reads the file and sets every key in it.

    ▶ Play: Apply a sysctl fileSOLUTION HIDDEN22 XP
  9. 71

    Level 71: Kernel knobs

    AloneMedium

    Objective: In /etc/sysctl.d/60-net-harden.conf: net.ipv4.conf.all. accept_redirects = 0, send_redirects = 0, log_martians = 1, applied now.

    Hardening guides set three network knobs on every server: accept ICMP redirects no, send them no, log martian packets yes. Live changes vanish at reboot; /etc/sysctl.d makes them stick (the check reboots to prove it).

    Commands taughtsysctl-harden

    ▶ Play: Kernel knobsSOLUTION HIDDEN32 XP
  10. 72

    Level 72: Least privilege

    AloneMedium

    Objective: Replace /etc/sudoers.d/lpro-deploy: deploy may only run /usr/bin/systemctl restart webapp as root, no password (visudo -cf the draft first).

    The CI user deploy has "ALL=(ALL) NOPASSWD: ALL": a root shell for anyone who steals its key. It only ever needs to restart webapp.

    Commands taughtsudoers-least

    ▶ Play: Least privilegeSOLUTION HIDDEN32 XP
  11. 73

    Level 73: Start lynis, then stop it

    GuidedEasy

    Objective: Start a lynis audit in the background, see that it runs, then stop it.

    lynis is a real security auditor and it is SLOW (minutes). So you never wait for it in the foreground: you start it in the background with & at the end of the line, keep working, and check on it with pgrep. Here you only learn the shape of the command, then stop it.

    Commands taughtlynis

    ▶ Play: Start lynis, then stop itSOLUTION HIDDEN26 XP
  12. 74

    Level 74: The long scan

    Alone⏱ TimedHard

    Objective: Run a full lynis audit in the background, wait for it, then save the hardening index to ~/index.txt and the test id of one warning to ~/warning.txt.

    lynis is a real host audit: ~240 tests, a hardening index (0-100) and a list of warnings in /var/log/lynis-report.dat. Here it takes a few minutes, so you start it in the background with & and keep an eye on it with pgrep.

    ▶ Play: The long scanSOLUTION HIDDEN40 XP
  13. 75

    Level 75: Read a checklist

    GuidedEasy

    Objective: Run the checklist, ask what 1.1 wants, fix it, and run again. Then peek at the full list.

    cis-check runs a checklist and prints [PASS] or [FAIL] for each control. --explain ID says what one control wants, --full adds the bigger controls. Run it, read it, fix one thing, run it again.

    Commands taughtcis-check

    ▶ Play: Read a checklistSOLUTION HIDDEN26 XP
  14. 76

    Level 76: The checklist

    Alone⏱ TimedHard

    Objective: Run hidden, fix every FAIL (use --explain) and re-run it until the score is full.

    cis-check turns a CIS-style checklist into [PASS]/[FAIL] lines, one command per control. --explain ID says what a control wants. The auditor arrives in eight minutes.

    ▶ Play: The checklistSOLUTION HIDDEN40 XP
  15. 77

    Level 77: BOSS: Pass the audit

    Boss⏱ TimedHard

    Objective: Make hidden pass, then prove it after a reboot.

    Final audit: cis-check --full, and the auditor re-runs it after a reboot. Live-only fixes do not count.

    ▶ Play: BOSS: Pass the auditSOLUTION HIDDEN100 XP

World 7Hypervisors

13 levels

Machines inside the machine: KVM, QEMU and libvirt with virsh for power, autostart, XML, qcow2 disks, snapshots, clones and networks (SIM).

  1. 78

    Level 78: Machines in the machine

    GuidedEasy

    Objective: Meet this KVM host (SIM): ask virsh what runs here and find the VM that is switched off.

    One host runs many virtual machines (VMs): type 1 hypervisors sit on bare metal (KVM, ESXi, Hyper-V), type 2 are desktop apps (VirtualBox). On Linux, KVM (kernel) lends the CPU, QEMU builds a fake PC per VM, and libvirt manages them, with virsh as its command line.

    Commands taughthypervisorsvirsh-simvirsh

    ▶ Play: Machines in the machineSOLUTION HIDDEN22 XP
  2. 79

    Level 79: The power buttons

    GuidedEasy

    Objective: Read web's ID card, power it on and off cleanly, then power on cache by yourself.

    virsh dominfo NAME is the ID card of a VM (state, CPUs, memory, autostart). virsh start NAME powers it on. virsh shutdown NAME presses the power button once: the guest OS gets the request and shuts itself down cleanly.

    Commands taughtvirsh-powerhyper-distros

    ▶ Play: The power buttonsSOLUTION HIDDEN24 XP
  3. 80

    Level 80: Pull the plug

    GuidedEasy

    Objective: db is frozen and blocks the backups: try the polite way, then pull the plug on db only, and bring it back.

    shutdown only asks the guest, so a hung guest OS ignores it. virsh destroy NAME pulls the plug: QEMU stops at once, and despite the name nothing is deleted (the VM and its disk stay, start brings it back).

    Commands taughtvirsh-destroy

    ▶ Play: Pull the plugSOLUTION HIDDEN26 XP
  4. 81

    Level 81: Who wakes up after a reboot?

    GuidedEasy

    Objective: The host gets patched tonight: web and test must come back on their own after the reboot, cache must not.

    When the host reboots, every VM stops. libvirt then starts only the VMs marked autostart (a link in /etc/libvirt/qemu/autostart/). virsh autostart NAME sets the mark, --disable takes it away, and hidden shows the marked ones.

    Commands taughtvirsh-autostart

    ▶ Play: Who wakes up after a reboot?SOLUTION HIDDEN28 XP
  5. 82

    Level 82: The blueprint

    GuidedEasy

    Objective: Read web's blueprint part by part, then write down where its disk lives.

    libvirt keeps every VM as an XML blueprint. <domain type='kvm'> holds <name>, <memory> (most RAM, in KiB), <vcpu> (virtual CPUs) and <devices>: a <disk> whose <source file=...> is the image, and an <interface> whose <source network=...> is its network.

    Commands taughtlibvirt-xml

    ▶ Play: The blueprintSOLUTION HIDDEN26 XP
  6. 83

    Level 83: Change the blueprint

    GuidedEasy

    Objective: web needs 2 GiB of RAM, 2 CPUs, and its disk moved to /srv/vm: change the blueprint and load it.

    To change a VM: save its XML to a file (hidden), edit the file, then hidden so libvirt stores the new config. Never edit /etc/libvirt/qemu/web.xml by hand: libvirt keeps its own copy. virsh edit web does the same three moves in an editor.

    Commands taughtvirsh-define

    ▶ Play: Change the blueprintSOLUTION HIDDEN30 XP
  7. 84

    Level 84: Disks made of files

    GuidedEasy

    Objective: In the image folder: make a new 2 GiB disk, read it, then build test overlays on top of the shared base image.

    A VM disk is a file. qemu-img makes and inspects them. qcow2 is thin: a 2 GiB disk starts as a tiny file that grows as the guest writes. A qcow2 can also sit on a read-only backing file (-b): the new overlay stores only the changes, so many test VMs can share one base image.

    Commands taughtqemu-img

    ▶ Play: Disks made of filesSOLUTION HIDDEN28 XP
  8. 85

    Level 85: The shelf and the boxes

    GuidedEasy

    Objective: A colleague made logs.qcow2 with qemu-img and libvirt cannot see it: find the pool, list it, refresh it.

    libvirt groups disk images into storage pools: a pool is a place (here the folder /var/lib/libvirt/images), each image in it is a volume. libvirt keeps its own list of volumes, and a file added behind its back (qemu-img, cp) only shows up after virsh pool-refresh.

    Commands taughtvirsh-pools

    ▶ Play: The shelf and the boxesSOLUTION HIDDEN24 XP
  9. 86

    Level 86: A VM from a blueprint

    AloneMedium

    Objective: Bring the mail VM to life from ~/mail.xml (its 10G qcow2 disk /var/lib/libvirt/images/mail.qcow2 is missing), running now and at every boot.

    A new VM needs a blueprint (virsh define FILE) and a disk image (qemu-img create): define does not check the disk, start does. Autostart keeps it coming back after reboots.

    ▶ Play: A VM from a blueprintSOLUTION HIDDEN34 XP
  10. 87

    Level 87: Snapshot before you patch

    GuidedEasy

    Objective: Patch web the safe way: snapshot, update, and when the update breaks the boot, revert and bring web back.

    virsh snapshot-create-as VM NAME saves the VM as it is now (inside its qcow2 disk). snapshot-list shows the saved points, snapshot-revert VM NAME goes back to one. "Snapshot before you patch" is a rule in every ops team.

    Commands taughtvirsh-snapshotsvirt-customize

    ▶ Play: Snapshot before you patchSOLUTION HIDDEN30 XP
  11. 88

    Level 88: Two of a kind

    GuidedEasy

    Objective: The sale starts tomorrow: clone web into web2 and run both.

    virt-clone copies a whole VM: the disk is copied and the config gets a new name, a new UUID and a new MAC address, so the copy can run next to the original. The original must be off while it is copied.

    Commands taughtvirt-clone

    ▶ Play: Two of a kindSOLUTION HIDDEN28 XP
  12. 89

    Level 89: Wires that are not there

    GuidedEasy

    Objective: The new app VM plugs into the network lan: find out why it will not start, fix it now and for every boot.

    VMs plug into libvirt virtual networks: default is NAT, VMs get 192.168.122.x addresses and reach out through the host (bridge virbr0) like phones behind a home router. A network is active and autostarted or not, like a VM, and a VM cannot start while its network is down.

    Commands taughtvirsh-networks

    ▶ Play: Wires that are not thereSOLUTION HIDDEN30 XP
  13. 90

    Level 90: BOSS: The morning after

    Boss⏱ TimedHard

    Objective: Get web running again (db stays up), then make sure it comes back by itself after the next reboot.

    After the host reboot web stayed off although it is marked autostart, because a start that fails at boot fails the same way by hand. virsh start prints why, one cause at a time: fix it and retry until it runs, keeping db up the whole time.

    Commands taughthyper-interview

    ▶ Play: BOSS: The morning afterSOLUTION HIDDEN100 XP

World 8Rescue Night (real VM)

6 levels

A real Rocky Linux 9 server on a serial console: catch the real GRUB menu, fix rescue and emergency boots, survive real reboots.

  1. 91

    Level 91: First light

    GuidedEasy

    Objective: Boot the box ONCE with the extra kernel argument pv.hello=1, added at the GRUB menu. The menu waits 90 seconds this time.

    This terminal is the serial console of a real Rocky Linux 9 server. When it boots, the real GRUB menu waits a few seconds: e edits the highlighted entry, Ctrl-E jumps to the end of a line, Ctrl-X boots your edit. An edit at the menu lasts one boot only.

    Commands taughtgrub-serial

    ▶ Play: First lightSOLUTION HIDDEN30 XP
  2. 92

    Level 92: The quiet room

    GuidedEasy

    Objective: The box hangs at boot. Get in through rescue mode (root password Lab-Root-1) and stop pv-hang from starting at boot. Keep its unit file.

    A unit that never finishes can hold the boot back forever. Rescue mode (systemd.unit=rescue.target on the kernel line) starts only the basics and gives you a root shell. There, systemctl disable keeps a unit from starting at the next boot.

    ▶ Play: The quiet roomSOLUTION HIDDEN36 XP
  3. 93

    Level 93: The wrong default

    GuidedEasy

    Objective: The default target is rescue. Make the box boot to multi-user.target for good. Root password: Lab-Root-1. CHECK reboots it.

    hidden shows the target a box boots to. set-default changes it for every boot. isolate and hidden only switch the running box: the next boot forgets.

    Commands taughtisolate-vs-default

    ▶ Play: The wrong defaultSOLUTION HIDDEN36 XP
  4. 94

    Level 94: The missing disk

    AloneMedium

    Objective: The backup disk is gone: the box stops in emergency mode. Boot clean and KEEP the /backup line. Root password: Lab-Root-1.

    An fstab line for a disk that is not there makes systemd wait 90 seconds, then stop in emergency mode with / read-only. nofail in the options column lets the box boot without that disk. Fix it, reboot from the console, then press CHECK.

    ▶ Play: The missing diskSOLUTION HIDDEN44 XP
  5. 95

    Level 95: Two faults, one boot

    Alone⏱ TimedHard

    Objective: Pressure: a mount option typo AND a wrong default target. Boot clean to multi-user.target with /boot mounted. Root password: Lab-Root-2.

    Real outages rarely have one cause. Fix one fault and reboot, and the second one stops you again. Read every red line before you reboot.

    ▶ Play: Two faults, one bootSOLUTION HIDDEN56 XP
  6. 96

    Level 96: BOSS: The Citadel won't boot

    Boss⏱ TimedHard

    Objective: Bring the Citadel back: a clean multi-user boot, SELinux enforcing, all three faults fixed for good. Root password: Pager-Duty-42.

    Three faults on one real box: a unit that hangs the boot, an fstab line for a missing disk, and a systemd.unit=rescue.target argument saved in the boot entry with grubby. A one-shot GRUB edit gets you in, but only fixes on disk survive the reboot.

    ▶ Play: BOSS: The Citadel won't bootSOLUTION HIDDEN110 XP

World 9Locked Out (real VM)

4 levels

Nobody knows root on a real Rocky Linux 9 server. Get in with rd.break, the RHEL 9 way and init=/bin/bash, then lock the door behind you.

  1. 97

    Level 97: The classic

    GuidedEasy

    Objective: Set root's password to Rescue-2026 with rd.break, then log in as root on the console. The GRUB menu waits 90 seconds.

    rd.break stops the boot inside the initramfs, with the real disk read-only at /sysroot. Remount it, chroot into it, change the password, and leave a note for SELinux: hidden. You did this on the simulator; now the disk, the kernel and SELinux are real.

    Commands taughtload-policy

    ▶ Play: The classicSOLUTION HIDDEN40 XP
  2. 98

    Level 98: The fast way

    GuidedEasy

    Objective: Set root's password to Night-Shift-7 the fast way: rd.break enforcing=0, no relabel, then hidden and hidden.

    The RHEL 9 docs skip the full relabel: boot with rd.break enforcing=0, change the password, boot on permissive (this boot only), then label the one file that changed: hidden, and hidden.

    Commands taughtgrub2-setpassword

    ▶ Play: The fast waySOLUTION HIDDEN44 XP
  3. 99

    Level 99: PID 1 is you

    AloneMedium

    Objective: Set root's password to Pid-One-9 with init=/bin/bash (not rd.break), keep SELinux happy, and boot on to a login.

    init=/bin/bash makes a shell the very first process (PID 1). No initramfs stop, no systemd, no SELinux policy loaded. Root is mounted read-only. Exit that shell and the kernel panics.

    ▶ Play: PID 1 is youSOLUTION HIDDEN48 XP
  4. 100

    Level 100: BOSS: Lock the door behind you

    Boss⏱ TimedHard

    Objective: Root's password is Rescue-2026. Log in as root, lock GRUB editing with grub2-setpassword, and give student passwordless sudo back (0440, valid).

    Getting in is half the job. Lock the GRUB editor with a password, so the next stranger at the console cannot do rd.break. Then give student its sudo back with a clean drop-in file.

    ▶ Play: BOSS: Lock the door behind youSOLUTION HIDDEN100 XP

World 10SELinux for Real (real VM)

7 levels

The Seal Room with real seals: a real Rocky 9 server, real httpd, real denials. Fix labels, ports and booleans for good, SELinux always on.

  1. 101

    Level 101: Enforce for good

    GuidedEasy

    Objective: This real box runs permissive, live AND in /etc/selinux/config. Make it enforcing now and at the next boot. No reboot needed: CHECK reads both.

    SELinux has two switches: the live mode (setenforce, lost at reboot) and /etc/selinux/config (read at every boot). sestatus shows both: Current mode and Mode from config file.

    ▶ Play: Enforce for goodSOLUTION HIDDEN30 XP
  2. 102

    Level 102: Moved, not copied

    GuidedEasy

    Objective: /var/www/html/sale.html answers 403 Forbidden. Fix its label: no chmod tricks, no permissive, no booleans.

    mv keeps a file's SELinux label. A page made in /root and moved to the docroot still wears admin_home_t, and httpd answers 403. matchpathcon shows the label the rules want; restorecon puts it back.

    ▶ Play: Moved, not copiedSOLUTION HIDDEN34 XP
  3. 103

    Level 103: A shop in /srv, for good

    GuidedEasy

    Objective: /srv/shop is the docroot now (already set in httpd) and answers 403. Make it served for good: it must survive a full relabel.

    /srv has no web rule, so files there are var_t and httpd gets 403. chcon would work until the next relabel. semanage fcontext writes a rule, restorecon applies it, and restorecon -n (dry run) proves a full relabel would change nothing.

    Commands taughtsemanage-real

    ▶ Play: A shop in /srv, for goodSOLUTION HIDDEN40 XP
  4. 104

    Level 104: The door on 8081

    AloneMedium

    Objective: httpd must also answer on 8081 (Listen 8081 is set) but will not start. Get it running and keep it running: CHECK reboots the box.

    httpd_t may only bind ports labelled http_port_t. After Listen 8081 the real httpd fails with "Permission denied: make_sock". 8081 already has a type (transproxy_port_t), so semanage port -m (not -a) gives it http_port_t, saved for every reboot.

    ▶ Play: The door on 8081SOLUTION HIDDEN44 XP
  5. 105

    Level 105: The proxy that could not call

    AloneMedium

    Objective: /api (a reverse proxy to 127.0.0.1:3000) answers 503. The API itself is up. Find why with ausearch and audit2why, and fix it for good: CHECK reboots the box.

    httpd_t may not open outgoing connections unless the boolean httpd_can_network_connect is on. On a real box the denial is in /var/log/audit/audit.log: ausearch finds it, audit2why names the switch, setsebool -P saves it.

    ▶ Play: The proxy that could not callSOLUTION HIDDEN46 XP
  6. 106

    Level 106: Uploads, and only uploads

    Alone⏱ TimedHard

    Objective: Pressure: the upload script /cgi-bin/up.cgi fails. Read the recent denial and give ONLY /var/www/uploads the read-write type, for good.

    A CGI script may read web content but not write it. The directory it writes to needs httpd_sys_rw_content_t, with a rule so a relabel keeps it. Not the boolean httpd_unified: that opens all of httpd's files for writing.

    Commands taughthttpd-rw-content

    ▶ Play: Uploads, and only uploadsSOLUTION HIDDEN56 XP
  7. 107

    Level 107: BOSS: The three-seal outage

    Boss⏱ TimedHard

    Objective: Bring the web server back: httpd on 80 and 8088, every page 200, /api 200, all fixes saved (CHECK reboots). Never permissive.

    Three seals broke at once: the shop must listen on 8088 (httpd will not start), the pages were moved in from a home folder, and the /api proxy may not call out. Each has a precise fix. None of them is hidden.

    ▶ Play: BOSS: The three-seal outageSOLUTION HIDDEN120 XP

World 11Hypervisors for Real (real VM)

4 levels

A real Rocky 9 host running real libvirt and QEMU: start, console, define, snapshot and revert tiny VMs, then rescue a host after a reboot.

  1. 108

    Level 108: A real hypervisor

    GuidedEasy

    Objective: Check what this host can do, then boot the tiny guest and watch it on its console.

    This Rocky VM runs real libvirt and QEMU, and inside it a tiny real guest (CirrOS). virt-host-validate says whether KVM works here (nested) or QEMU must emulate the CPU (TCG). virsh console attaches to the guest's serial line; Ctrl+] leaves.

    Commands taughtvirt-host-validate

    ▶ Play: A real hypervisorSOLUTION HIDDEN30 XP
  2. 109

    Level 109: Born from XML

    GuidedEasy

    Objective: Turn ~/lab.xml into a running VM that also starts at every boot.

    ~/lab.xml is a complete domain XML: name, memory, disk, network. virsh define loads it into libvirt for good, start boots it, autostart brings it back after every host boot. The disk is a qcow2 overlay on the CirrOS base.

    ▶ Play: Born from XMLSOLUTION HIDDEN34 XP
  3. 110

    Level 110: A real time machine

    GuidedEasy

    Objective: Snapshot tiny, make a bad change to its config, then revert it.

    A snapshot of a shut off VM with a qcow2 disk is stored inside the disk, with a copy of the VM config. snapshot-revert puts both back: disk and XML.

    ▶ Play: A real time machineSOLUTION HIDDEN36 XP
  4. 111

    Level 111: BOSS: The real morning after

    Boss⏱ TimedHard

    Objective: Get web running (128 MiB, its real disk, network pvnet), and make sure web and pvnet both come back by themselves after the next boot.

    The host rebooted. web is marked autostart but stayed off: libvirt tried and failed. hidden prints why, one cause at a time. web needs 128 MiB and its disk is now pv-web-2025.qcow2 in the same folder.

    ▶ Play: BOSS: The real morning afterSOLUTION HIDDEN110 XP

Final examThe Pro Exam

20 levels

Twenty tickets on one server, two hours and no hints, and every fix must survive the reboot at the end.

  1. 112

    Level 112: Ticket 1: Locked out of rhel10

    Exam⏱ TimedHard

    Objective: Reset the root password of rhel10 to Exam-Root-26, log in, then quit the console.

    rhel10 (console) waits at its GRUB menu and nobody knows its root password.

    ▶ Play: Ticket 1: Locked out of rhel10SOLUTION HIDDEN40 XP
  2. 113

    Level 113: Ticket 2: Reboot after a panic

    Exam⏱ TimedHard

    Objective: Make this VM reboot itself 10 seconds after a kernel panic, now and after every reboot.

    A panicked kernel waits forever by default (kernel.panic = 0).

    ▶ Play: Ticket 2: Reboot after a panicSOLUTION HIDDEN30 XP
  3. 114

    Level 114: Ticket 3: The archive disk

    Exam⏱ TimedHard

    Objective: Get the ARCHIVE disk mounted on /srv/larchive at every boot, and make sure a missing disk can never stop the boot.

    The archive disk (filesystem label ARCHIVE) was reformatted, and its fstab line still names the old UUID.

    ▶ Play: Ticket 3: The archive diskSOLUTION HIDDEN35 XP
  4. 115

    Level 115: Ticket 4: Lock the front door

    Exam⏱ TimedHard

    Objective: Harden sshd: no root logins, no passwords, only the user server may log in, sshd -t clean, and your key login to server@server still works.

    sshd reads sshd_config.d/*.conf in name order and the first value of each keyword wins.

    ▶ Play: Ticket 4: Lock the front doorSOLUTION HIDDEN40 XP
  5. 116

    Level 116: Ticket 5: Office time

    Exam⏱ TimedHard

    Objective: Make chronyd sync from the office time server 127.0.0.2 (^* in hidden) and start at every boot.

    The office time server answers on 127.0.0.2; this box still asks the internet pool, which the lab cannot reach.

    ▶ Play: Ticket 5: Office timeSOLUTION HIDDEN35 XP
  6. 117

    Level 117: Ticket 6: The file server name

    Exam⏱ TimedHard

    Objective: dig @127.0.0.1 files.office.lan must answer 10.20.0.15 and nothing else, and ntp.office.lan 127.0.0.2, also after a reboot.

    The office DNS is dnsmasq on 127.0.0.1. It also answers from /etc/hosts.

    ▶ Play: Ticket 6: The file server nameSOLUTION HIDDEN35 XP
  7. 118

    Level 118: Ticket 7: Share the handbook (SIM)

    Exam⏱ TimedHard

    Objective: Export /srv/share read-only to 10.20.0.0/24 and to nobody else, saved in /etc/exports and applied.

    NFS exports live in /etc/exports; exportfs -ra loads them (this VM has no NFS server: exportfs is a SIM).

    ▶ Play: Ticket 7: Share the handbook (SIM)SOLUTION HIDDEN30 XP
  8. 119

    Level 119: Ticket 8: The shop shows the intranet

    Exam⏱ TimedHard

    Objective: http://shop.office.lan/ must show the Office Shop (/var/www/shop) and http://localhost/ the intranet, also after a reboot.

    nginx picks the server block by the Host name; a name nobody claims lands on the default_server.

    ▶ Play: Ticket 8: The shop shows the intranetSOLUTION HIDDEN35 XP
  9. 120

    Level 120: Ticket 9: Both cooks

    Exam⏱ TimedHard

    Objective: Make app.office.lan send its requests to app1 AND app2 in turn, through an upstream block.

    app.office.lan is proxied by nginx; the app runs twice, on 127.0.0.1:8081 (app1) and 127.0.0.1:8082 (app2).

    ▶ Play: Ticket 9: Both cooksSOLUTION HIDDEN40 XP
  10. 121

    Level 121: Ticket 10: The dead third server

    Exam⏱ TimedHard

    Objective: Every request to 127.0.0.1:8080 must succeed: keep app3 in the config, let HAProxy skip it while it is down, and run HAProxy at boot.

    HAProxy on 127.0.0.1:8080 balances app1, app2 and app3; app3 (127.0.0.1:8083) is down for a rebuild.

    ▶ Play: Ticket 10: The dead third serverSOLUTION HIDDEN40 XP
  11. 122

    Level 122: Ticket 11: Save the wall

    Exam⏱ TimedHard

    Objective: Make the live firewall load again at every boot from /etc/nftables.nft, without doubling rules when it is loaded twice.

    The live nftables wall (table inet fw: policy drop, lo, replies, 22 and 80) exists only in memory.

    ▶ Play: Ticket 11: Save the wallSOLUTION HIDDEN35 XP
  12. 123

    Level 123: Ticket 12: The bouncer sleeps

    Exam⏱ TimedHard

    Objective: Make SELinux enforcing right now and at every boot.

    SELinux (SIM) on this box is permissive, live and in /etc/selinux/config.

    ▶ Play: Ticket 12: The bouncer sleepsSOLUTION HIDDEN30 XP
  13. 124

    Level 124: Ticket 13: 403 on port 81

    Exam⏱ TimedHard

    Objective: Make http://localhost:81/ serve the shop with SELinux labels that survive a full relabel.

    httpd (SIM) on port 81 serves /srv/shop and answers 403; the file permissions are fine.

    ▶ Play: Ticket 13: 403 on port 81SOLUTION HIDDEN40 XP
  14. 125

    Level 125: Ticket 14: /api says 503

    Exam⏱ TimedHard

    Objective: Make http://localhost:81/api answer 200 for good, with SELinux enforcing.

    httpd (SIM) proxies /api to the inventory service on 127.0.0.1:3000; the audit log knows why it fails.

    ▶ Play: Ticket 14: /api says 503SOLUTION HIDDEN35 XP
  15. 126

    Level 126: Ticket 15: Password policy

    Exam⏱ TimedHard

    Objective: Require passwords of 14 characters from 3 classes, and lock an account for 15 minutes after 5 failures.

    pam_pwquality reads /etc/security/pwquality.conf, pam_faillock reads /etc/security/faillock.conf.

    ▶ Play: Ticket 15: Password policySOLUTION HIDDEN30 XP
  16. 127

    Level 127: Ticket 16: Who touched sudoers?

    Exam⏱ TimedHard

    Objective: Audit every write and attribute change to /etc/sudoers under the key actions, live now and at every boot.

    auditd (SIM) watches files with -w PATH -p PERMS -k KEY; rules.d/*.rules is what survives a reboot.

    ▶ Play: Ticket 16: Who touched sudoers?SOLUTION HIDDEN35 XP
  17. 128

    Level 128: Ticket 17: Least privilege

    Exam⏱ TimedHard

    Objective: Let deploy run only /usr/bin/systemctl restart webapp as root without a password, and keep sudoers valid (mode 0440).

    /etc/sudoers.d/lpro-deploy gives the deploy user ALL commands as root.

    ▶ Play: Ticket 17: Least privilegeSOLUTION HIDDEN35 XP
  18. 129

    Level 129: Ticket 18: Too many doors

    Exam⏱ TimedHard

    Objective: Stop telnetd and rpcbind now and for every boot, while webapp keeps running.

    telnetd and rpcbind run on this box; webapp is the shop and must stay up.

    ▶ Play: Ticket 18: Too many doorsSOLUTION HIDDEN30 XP
  19. 130

    Level 130: Ticket 19: Kernel network knobs

    Exam⏱ TimedHard

    Objective: In /etc/sysctl.d/60-net-harden.conf set net.ipv4.conf.all accept_redirects = 0, send_redirects = 0 and log_martians = 1, applied now.

    The auditor wants ICMP redirects ignored and not sent, and martian packets logged.

    ▶ Play: Ticket 19: Kernel network knobsSOLUTION HIDDEN30 XP
  20. 131

    Level 131: Ticket 20: Loose files

    Exam⏱ TimedHard

    Objective: Leave no world-writable file and no ownerless file under /srv/app (give them to root), and no SUID file under /usr/local.

    The audit found world-writable files and files with no owner under /srv/app, and one SUID program that is not in the baseline.

    ▶ Play: Ticket 20: Loose filesSOLUTION HIDDEN40 XP

For teachers

Use these levels with a class

SOLUTION HIDDEN Teachers see answer keys in the classroom.

For teachers
ROOTSPIRE
DiscsFor teachers
▶ Play freeLibrary 16 discsDiscsFor teachersLog in