Courses3 levels
Level 1 · Foundations11 courses
Level 2 · Core5 courses
Level 3 · Advanced5 courses
Labs8 topics
Library Practice exams AI Range Pricing Start free

Scenario test · 90 minutes

Investigate a break-in and a data leak at a freight company

After this lesson you can
  • Run a whole case from sealed evidence to a report, with the tools you built
  • Find what the tools got right and what they could not see
  • Link an incident to the vulnerability that made it possible
Lab files of this lesson (53)

The lab folder as it stands after this lesson. Unzip it in ~/krlab.

More

The zip holds every file that the course has printed up to here. To start this lesson with the files of the earlier lessons only, take the zip of the lesson before. Type the code yourself first: you learn more.

Scenario

Ironwood Freight is an invented company that moves parcels for web shops. It is the evening of Thursday 3 December 2026, and you review the whole day. Two things reached the security mailbox: a customer wrote, later that morning, that the search page "showed a strange error", and the night-shift operator kfoster says that she did not log in to web01 after 04:00 UTC. You are the analyst on duty. You have the logs of the customer portal web01 (ssh and system messages, and web requests), the log of the VPN gateway vpn01, the context files of the company (staff, assets, known addresses, approved changes), and an inventory of the systems with their software. The day may hold more than one incident, from more than one actor: the logs decide, not the first guess.

Read the clocks first. On web01, auth.log and syslog use a clock that runs five hours behind UTC, and access.log is in UTC. The clock of vpn01 runs one hour ahead of UTC. The year is 2026. All times in the tasks are UTC. You took the first alert at 06:45:00, and the access to web01 was cut at 07:05:00. Your review reads the logs of the whole day, so it also shows what happened after the cut. Tasks 1 to 10 take about 60 minutes, and the report about 30 minutes more, when the programs of lessons 2 to 14 are in your lab folder. Tasks 11 to 13 are an extension of about an hour more: they follow the intruder to the file server, test your detection and triage the endpoint alerts. The hand-in does not need them, and a reader who does them can reach "Strong" in the rows of the table below that name the extension.

The generator makes the whole case in the folder ironwood. It uses a fixed seed, so your files match the numbers below. Save it in your lab folder and run it. You do not need to read it.

The finished file: gen_case.py

gen_case.py

"""gen_case.py: write the case of the scenario test into the folder ironwood: logs, context files and an inventory.

    python3 gen_case.py          The company is Ironwood Freight, an invented firm. The same files every time.
"""
import hashlib
import random
from datetime import datetime, timedelta, timezone
from pathlib import Path

r = random.Random(31)  # only random() is used: the files are the same on every Python version
INTRUDER, VICTIM = "198.51.100.200", "kfoster"
STAFF = {"kfoster": ("192.0.2.111", 1011), "lnguyen": ("192.0.2.112", 1012), "tomas": ("192.0.2.113", 1013),
         "amir": ("192.0.2.114", 1014)}
MON = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split()
DAY = datetime(2026, 12, 3, tzinfo=timezone.utc)
lines = {"auth.log": [], "access.log": [], "syslog": []}
pids = [3000]

def rnd(n):
    return int(r.random() * n)

def pick(items):
    return items[rnd(len(items))]

def at(h, m=0, s=0):
    return DAY + timedelta(hours=h, minutes=m, seconds=s)

def pid():
    pids[0] += 1 + rnd(9)
    return pids[0]

def local(t):  # the clock of web01 runs five hours behind UTC
    t -= timedelta(hours=5)
    return f"{MON[t.month - 1]} {t.day:2d} {t:%H:%M:%S}"

def sys_line(file, t, proc, text, with_pid=True, p=None):
    who = f"{proc}[{p or pid()}]" if with_pid else proc
    lines[file].append((t, f"{local(t)} web01 {who}: {text}"))

def ssh(t, ok, user, ip, how="password", stay=0):
    port, p = 32768 + rnd(28000), pid()
    if ok:
        sys_line("auth.log", t, "sshd", f"Accepted {how} for {user} from {ip} port {port} ssh2", p=p)
        sys_line("auth.log", t, "sshd", f"pam_unix(sshd:session): session opened for user {user}(uid={STAFF.get(user, ('', 1500))[1]}) by (uid=0)", p=p)
        sys_line("auth.log", t + timedelta(seconds=stay or 120 + rnd(900)), "sshd", f"pam_unix(sshd:session): session closed for user {user}", p=p)
    else:
        who = user if user in STAFF or user == "root" else f"invalid user {user}"
        sys_line("auth.log", t, "sshd", f"Failed password for {who} from {ip} port {port} ssh2", p=p)

def web(t, ip, path, status, size, ua=None, method="GET"):
    stamp = f"{t.day:02d}/{MON[t.month - 1]}/{t.year}:{t:%H:%M:%S} +0000"
    lines["access.log"].append((t, f'{ip} - - [{stamp}] "{method} {path} HTTP/1.1" {status} {size} "-" "{ua or pick(UAS)}"'))

UAS = ["Mozilla/5.0 (X11; Linux x86_64) Firefox/126.0", "Mozilla/5.0 (Windows NT 10.0) Chrome/124.0"]
CUSTOMERS = [f"203.0.113.{n}" for n in range(120, 160)]
PAGES = [("/", 200, 4800), ("/track", 200, 9100), ("/quote", 200, 6200), ("/contact", 200, 2900), ("/static/app.js", 200, 33100),
         ("/favicon.ico", 404, 196), ("/downloads/rates-2026.pdf", 200, 2150000)]
PROBES = ["/wp-login.php", "/.env", "/phpmyadmin/", "/.git/config", "/backup.zip", "/server-status"]

for _ in range(300):  # customers
    ip, t, ua = pick(CUSTOMERS), at(0) + timedelta(seconds=int((r.random() + r.random()) / 2 * 86400)), pick(UAS)
    for _ in range(1 + rnd(4)):
        t += timedelta(seconds=1 + rnd(20))
        path, status, size = pick(PAGES)
        web(t, ip, path, status, size + rnd(300) * (status == 200), ua=ua)
for i in range(144):
    web(at(0, 10 * i), "192.0.2.5", "/healthz", 200, 2, ua="kr-monitor/1.0")
for name, (ip, _uid) in STAFF.items():  # staff log in; kfoster works the night shift, the others the day
    for _ in range(2):
        ssh(at(1 + rnd(3) if name == "kfoster" else 13 + rnd(9), rnd(60), rnd(60)), True, name, ip, pick(["password", "publickey"]))
t = at(14, 10, 5)
for _ in range(6):  # lnguyen forgets a password
    ssh(t, False, "lnguyen", "192.0.2.112")
    t += timedelta(seconds=7 + rnd(5))
ssh(t, True, "lnguyen", "192.0.2.112")
for h in range(24):
    ssh(at(h, 5, rnd(30)), True, "deploy", "192.0.2.8", "publickey", stay=20)
    sys_line("syslog", at(h, 16, 1), "CRON", "(root) CMD (cd / && run-parts --report /etc/cron.hourly)")
sys_line("syslog", at(7, 0, 2), "systemd", "Starting Daily apt upgrade and clean activities...")
sys_line("syslog", at(7, 0, 40), "systemd", "Finished Daily apt upgrade and clean activities.")
t = at(3)  # the authorised scan
for _ in range(60):
    t += timedelta(seconds=1)
    web(t, "192.0.2.7", pick(PROBES + ["/", "/track"]), pick([404, 404, 403]), 196, ua="IronScan/4.0")
t = at(4, 15)  # a scanner that is known on the internet
for _ in range(30):
    t += timedelta(seconds=1 + rnd(2))
    web(t, "198.51.100.66", pick(PROBES), 404, 196, ua="Go-http-client/1.1")
for i in range(2):
    sys_line("syslog", at(6, 5, 20 + 9 * i), "kernel", f"[{23100 + i}.4] UFW BLOCK IN=eth0 SRC={INTRUDER} DST=192.0.2.10 PROTO=TCP "
             f"SPT={32768 + rnd(28000)} DPT={pick([23, 3389])}", with_pid=False)

# The spray: one guess for each of many accounts, then two more for kfoster, then a success.
t = at(6, 10, 4)
for name in ["kfoster", "lnguyen", "tomas", "amir", "admin", "root", "backup", "deploy", "test", "guest", "oracle", "git",
             "ubuntu", "support"]:
    ssh(t, False, name, INTRUDER)
    t += timedelta(seconds=12 + rnd(9))
t = at(6, 28, 41)
for _ in range(2):
    ssh(t, False, VICTIM, INTRUDER)
    t += timedelta(seconds=19)
t += timedelta(seconds=24)
ssh(t, True, VICTIM, INTRUDER, stay=41 * 60)
lines["auth.log"].append((t + timedelta(minutes=3), f"{local(t + timedelta(minutes=3))} web01 sudo:   {VICTIM} : TTY=pts/1 ; "
                          f"PWD=/home/{VICTIM} ; USER=root ; COMMAND=/usr/sbin/useradd -m helpdesk2"))
sys_line("auth.log", t + timedelta(minutes=3, seconds=1), "useradd",
         "new user: name=helpdesk2, UID=1015, GID=1015, home=/home/helpdesk2, shell=/bin/bash")
sys_line("syslog", t + timedelta(minutes=6), "crontab", "(helpdesk2) REPLACE (helpdesk2)")
for m in (10, 15, 20):
    sys_line("syslog", t + timedelta(minutes=m), "CRON", "(helpdesk2) CMD (/home/helpdesk2/.cache/up)")

# The shop search: five requests that bend the query. The last one is answered with a very large page.
t = at(9, 15)
for gap, status, size in [(0, 500, 312), (17, 500, 312), (14, 400, 312), (15, 500, 312), (16, 200, 1402118)]:
    t += timedelta(seconds=gap)
    web(t, "203.0.113.77", "/search?q=%27%20UNION%20SELECT%20name%2Cemail%20FROM%20customers--", status, size, ua="curl/8.5.0")

Path("ironwood").mkdir(exist_ok=True)
for name, rows in lines.items():
    rows.sort(key=lambda row: row[0])
    text = "".join(line + "\n" for _, line in rows)
    Path("ironwood", name).write_text(text)
    print(f"{name:11s} {len(rows):5d} lines  sha256 {hashlib.sha256(text.encode()).hexdigest()[:12]}")

# The VPN server: its clock runs one hour ahead of UTC.
vpn = [(7 * 3600 + 2 * 60 + 15, "event=connect user=kfoster src=198.51.100.200 assigned=192.0.2.171"),
       (7 * 3600 + 41 * 60 + 50, "event=disconnect user=kfoster src=198.51.100.200 bytes=73110412"),
       (9 * 3600 + 20 * 60 + 3, "event=connect user=tomas src=203.0.113.141 assigned=192.0.2.172"),
       (10 * 3600 + 4 * 60 + 40, "event=disconnect user=tomas src=203.0.113.141 bytes=6120931")]
Path("ironwood/vpn.log").write_text("".join(f"2026-12-03 {s // 3600 + 1:02d}:{s % 3600 // 60:02d}:{s % 60:02d} vpn01 {text}\n"
                                            for s, text in vpn))
files = {
    "assets.csv": "ip,host,owner,role,criticality\n192.0.2.5,monitor01,it,monitoring,2\n192.0.2.7,scan01,it,vulnerability scanner,2\n"
                  "192.0.2.8,ci01,dev,build server,3\n192.0.2.10,web01,ops,customer portal,5\n192.0.2.20,db01,ops,shipment database,5\n"
                  "192.0.2.30,files01,ops,file server,3\n192.0.2.111,ws-kfoster,ops,workstation,2\n192.0.2.112,ws-lnguyen,sales,workstation,2\n",
    "staff.csv": "user,name,team,usual_ip\nkfoster,Kay Foster,ops,192.0.2.111\nlnguyen,Linh Nguyen,sales,192.0.2.112\n"
                 "tomas,Tomas Eriksen,ops,192.0.2.113\namir,Amir Haddad,sales,192.0.2.114\ndeploy,Deploy job,dev,192.0.2.8\n",
    "known_bad.csv": "ip,note\n198.51.100.66,listed by a public feed as a mass scanner\n",
    "changes.csv": "ip,what,start,end,ticket\n192.0.2.7,vulnerability scan of web01,2026-12-03T02:50:00Z,2026-12-03T03:30:00Z,CHG-2210\n",
    "inventory.csv": "asset,host,role,exposure,criticality,data\nC01,web01,customer portal,internet,5,customer\n"
                     "C02,db01,shipment database,internal,5,customer\nC03,vpn01,vpn gateway,internet,4,internal\n"
                     "C04,ci01,build server,internal,3,internal\nC05,mail01,mail relay,internet,3,customer\n"
                     "C06,files01,file server,internal,3,internal\n",
    "installed.csv": "asset,product,version\nC01,shopkit,4.2.1\nC01,edgeproxy,2.8.0\nC02,dbstore,9.4.0\nC03,vpngate,7.1.0\n"
                     "C04,buildrunner,5.1.0\nC05,mailrelay,3.3.1\nC05,edgeproxy,2.9.0\nC06,fileshare,3.1.0\n",
}
for name, text in files.items():
    Path("ironwood", name).write_text(text)
print("wrote vpn.log and", len(files), "context files")
python3 gen_case.py
auth.log      126 lines  sha256 aea45fbc1ede
access.log    978 lines  sha256 4e13b791102e
syslog         32 lines  sha256 854712f61a58
wrote vpn.log and 6 context files

Work in ~/krlab/security-operations, with the programs and the files of lessons 2 to 14 (logparse.py, vpn_parse.py, rules.py, rules.json, triage.py, analyse.py, contain.py, timeline.py, evidence.py, report.py, incident.py, patchrank.py, sigma_lite.py, sigma_test.py, gen_winevents.py, winevents.py, win_hunt.py, gen_edr.py, endpoint_triage.py, the folder detections of lesson 8 and the vulnerability files of lesson 9).

Two of these files come with the test as lab files. They are not part of the model solution. If you skipped lesson 2 or lesson 3, or if your own file differs, save these two. The numbers of this test hold for this rules.json, the six rules of lesson 3 as lesson 4 gives them. vpn_parse.py needs logparse.py from lesson 2. Its function parse_vpn(line, hours) takes two arguments, not three, so it does not go into sources(): call it in a loop over the lines of the VPN log.

The finished file: vpn_parse.py (a lab file)

vpn_parse.py

"""vpn_parse.py: turn one line of vpn.log into an event. Needs logparse.py."""
from datetime import datetime, timedelta, timezone
from logparse import event, iso

MAP = {"auth_fail": ("login", "failure"), "connect": ("vpn_connect", "success"),
       "disconnect": ("vpn_disconnect", "closed")}

def parse_vpn(line, hours):
    """One line of vpn.log. The clock of the gateway runs `hours` ahead of UTC."""
    day, clock, host, *pairs = line.split()
    kv = dict(p.split("=", 1) for p in pairs)
    when = datetime.fromisoformat(f"{day}T{clock}").replace(tzinfo=timezone(timedelta(hours=hours)))
    action, outcome = MAP[kv["event"]]
    return event(ts=iso(when), source="vpn", host=host, process="vpn", action=action,
                 outcome=outcome, user=kv["user"], ip=kv["src"], msg=line)
The finished file: rules.json (a lab file)

rules.json

[
  {"id": "R1", "title": "Many failed logins from one address", "severity": "medium",
   "where": {"action": "login", "outcome": "failure"}, "group_by": "ip", "count": 5, "window_s": 300},
  {"id": "R2", "title": "Many missing pages from one address", "severity": "low",
   "where": {"action": "request", "status": 404}, "group_by": "ip", "count": 20, "window_s": 60},
  {"id": "R3", "title": "Large web response", "severity": "medium",
   "where": {"action": "request", "status": 200}, "at_least": {"bytes": 1000000}, "group_by": "ip",
   "allow": {"path": ["/downloads/catalogue-2026.pdf"]}},
  {"id": "R4", "title": "New account created", "severity": "high",
   "where": {"action": "user_add"}, "group_by": "user"},
  {"id": "R5", "title": "Database words in a web path", "severity": "medium",
   "where": {"action": "request"}, "contains": {"path": ["%27", "UNION", "DROP"]}, "group_by": "ip", "window_s": 60},
  {"id": "R6", "title": "Many firewall blocks from one address", "severity": "low",
   "where": {"action": "firewall_block"}, "group_by": "ip", "count": 5, "window_s": 120}
]

Your tasks

Do the tasks in this order. Keep your commands and results: the report at the end uses them.

  1. Evidence. Before you do anything else, seal the four log files of the case (the three of web01 and the VPN log) in a case folder of their own, with hashes and a chain of custody.
  1. Read the logs with the right clocks. Make the events of the three logs of web01 in iron-events.jsonl. Then read the VPN log with parse_vpn (yours from lesson 2, or the lab file) and the right offset: the clock of vpn01 runs one hour ahead, so hours is 1. The VPN events stay out of iron-events.jsonl.
  1. Detect and tune. Run your six rules over the events as they are. Then make one change only: the public rate card /downloads/rates-2026.pdf is a big file that customers download all day, so put its exact path on the allow-list of R3, next to the catalogue of Fernwood Press. Count the alerts again. Save the tuned rules as iron-rules.json and keep rules.json as it is.
  1. Triage. Run analyse.py (lesson 14) on the logs in ironwood, with iron-rules.json, the context folder ironwood and the right offset. Read the ranked alerts one by one, and open the raw lines of the alerts for 203.0.113.77.

Decide for yourself, and write down in your report: is that priority right? Look at the status and the size of that answer, and at the product that the portal runs.

  1. Contain. Run the containment program on iron-events.jsonl, with iron-rules.json and the context folder ironwood.

Then decide whether the list is complete. Write down any address or account that you would add, with the reason.

  1. Timeline. Build the timeline of the address 198.51.100.200 from iron-events.jsonl, the events of the three logs of web01.
  1. VPN session. The access to web01 was cut at 07:05:00 UTC. Look at your parsed VPN events for 198.51.100.200: was the intruder still connected when the access was cut? Write down the time of the disconnect.
  1. Patch order. Rank the findings of the inventory ironwood/inventory.csv and ironwood/installed.csv with your patch ranking and the vulnerability files of lesson 9.
  1. Classify and report. The night holds two incidents, one for each actor, and both are confirmed. Use incident.py to classify them. The break-in with the stolen account: one system (web01, criticality 5), no proof that customer data left. The attack on the search page by 203.0.113.77: one system (web01, criticality 5), and customer data that may have left. Then write the notes iron-case.json for the intruder 198.51.100.200: you took the alert at 06:45:00 UTC and the access was cut at 07:05:00 UTC, on 2026-12-03. Run the report program on iron-events.jsonl with iron-rules.json.
  1. A detection for next time. Run your Sigma rule for database words (sigma/web_sql_words.yml, lesson 7) over iron-events.jsonl. Then write a second Sigma rule, iron-sql-worked.yml, that fires only when such a request worked: one more selection asks for status 200 and 1,000,000 bytes or more, and the condition joins the two. Give it the level high.

Extension: the file server, detection tests and the endpoint

These three tasks need gen_winevents.py, win_hunt.py, gen_edr.py, endpoint_triage.py and sigma_test.py from lessons 5 to 8.

  1. Windows events. Ironwood also exports the Security log of its Windows file server files01 (the computer FILES01 of the domain IRONWOOD). Make the export with the generator of lesson 5, day 3: python3 gen_winevents.py 3 ironwin (it prints export.xml 66 events sha256 3c04c98c0170). Run win_hunt.py on ironwin/export.xml. Then list the Remote Desktop logons (type 10) yourself, with parse and timeline as in lesson 5, and follow the one that does not belong. Did the intruder reach the file server, from which address and when, and what did it do there? Why does win_hunt.py not report that logon?
  1. Detection as code. Put your iron-sql-worked.yml in the folder detections of lesson 8. Give it a folder detections/tests/iron-sql-worked/ with two sample files made from iron-events.jsonl: match.jsonl holds the one request of 203.0.113.77 that worked, nomatch.jsonl the four that failed. The answers below hold when detections also holds the three rules of lesson 8 with their samples (if they are missing, run the lines of lesson 8, steps 1 and 3, again; they need events.jsonl from lesson 2 and win-events.jsonl from lesson 7, so make those first, as lessons 2 and 7 show, if you do not have them). Run sigma_test.py on detections. If the harness names a missing fact of your rule, add it. Give the new rule its own id: python3 -c "import uuid; print(uuid.uuid4())" prints a new one, and a copied rule keeps the id of the old one. Then change the condition of your rule to selection only, run the harness again, and put the condition back.
  1. Endpoint alerts. The EDR of Ironwood (lesson 6) raised three alerts on 3 December. Make them with python3 gen_edr.py 3 ironwood/edr. Triage them with endpoint_triage.py and the context files of Ironwood: the tool reads assets.csv and staff.csv from the folder where you run it, so run it from inside ironwood. Print the ticket of the P1 alert. Then decide for yourself: is the tool right about the other alert on files01?

Hand in

A written report in your own words, ironwood-report.md, of one to two pages. It is the proof that you can show an employer. Use these headings:

  • Summary: what happened, for each actor, the impact and the state, in four sentences.
  • Timeline: the key events in UTC, each with its source file and line.
  • Impact: the accounts, the systems and the data, in numbers from your tools. Correct what the report program cannot know (see "What the tools missed").
  • What the tools missed: at least two alerts or facts that a program could not judge, and what you decided (for example the priority of one alert, and one alert that you believe is harmless).
  • Detection: your new Sigma rule (task 10) and the request that it finds and the tools ranked too low. If you did the extension, add what the file server events show (task 11), the harness result for your rule with the one change that made it fail (task 12), and the ticket of the P1 endpoint alert with your own decision on the other alert of files01 (task 13).
  • Containment and evidence: what you blocked and disabled, what the containment missed, the hash of each sealed file and where the chain of custody is.
  • Vulnerability: which finding explains the attack on the search page, its tier, and how fast it should have been fixed under your policy. Say why the break-in has no such finding.
  • Changes: four changes with an owner each, and the rule or runbook that each one touches.

Review your work

One model solution

Seal the evidence first, and parse with the right clocks.

mkdir -p ironcase
(cd ironcase && python3 ../evidence.py seal ../ironwood auth.log access.log syslog vpn.log)
python3 logparse.py ironwood 2026 iron-events.jsonl -5 | head -n 1
sealed auth.log aea45fbc1ede
sealed access.log 4e13b791102e
sealed syslog 854712f61a58
sealed vpn.log adaeb1bbc7f1
1136 events written to iron-events.jsonl, 0 lines not read

The VPN clock runs one hour ahead, so the connect at 08:02:15 on the clock of the gateway is 07:02:15 UTC. Then detect, tune and triage. The tuned file is a copy of rules.json with the rate card added to the allow-list of R3.

python3 - <<'EOF'
import json

rules = json.load(open("rules.json"))
r3 = next(r for r in rules if r["id"] == "R3")
r3["allow"]["path"].append("/downloads/rates-2026.pdf")
json.dump(rules, open("iron-rules.json", "w"), indent=1)
EOF
python3 rules.py iron-events.jsonl rules.json | tail -n 1
python3 rules.py iron-events.jsonl iron-rules.json | tail -n 1
python3 analyse.py --logs ironwood --context ironwood --offset -5 --rules iron-rules.json | head -n 3
python3 -c "import csv; [print(r['id'], r['priority'], r['verdict'], r['rule']) for r in csv.DictReader(open('ranked.csv'))]"
118 alerts: R1 2, R2 2, R3 111, R4 1, R5 2
8 alerts: R1 2, R2 2, R3 1, R4 1, R5 2
Read 1136 events from ironwood, 0 lines not read.
Window: 2026-12-03T00:00:00Z to 2026-12-03T23:50:00Z
Alerts: 8 (P1 2, P2 4, P3 1, P4 1)
A004 1 true positive, impact R4
A003 1 true positive, impact R1
A005 2 true positive, no impact R5
A006 2 true positive, no impact R3
A007 2 true positive, no impact R5
A008 2 true positive, no impact R1
A002 3 true positive, no impact R2
A001 4 false positive R2

The verdict holds a comma, so ranked.csv puts it in quotes. cut -d, would split it: read the file with the csv module.

Without the allow-list for the rate card, 110 of the 118 alerts are noise. After the change, eight alerts are left, and two are priority 1: the new account helpdesk2 and the guessing from 198.51.100.200. Rule R1 counts failures for each address, so it fired on that spray at 06:11 UTC, 18 minutes before the login. A rule that counts failures for each user would also catch a spray from many addresses. The tool gives priority 2 to the three alerts for 203.0.113.77, because no login came from that address. That is wrong. The requests carry the words UNION SELECT in the path, four of them failed, and the fifth was answered with status 200 and 1,402,118 bytes. A page of that size from a search is very likely customer data. That a large answer left the search page is a fact about its size; that it held customer data is an assumption until the application log is read, which is why the task says "may have left". The portal runs shopkit 4.2.1, which has the open flaw LAB-2026-0001 (SQL injection in the search page, in the catalogue of known exploited vulnerabilities). The alert is priority 1, and the address belongs on the block list. Next, contain and build the timeline.

python3 contain.py iron-events.jsonl iron-rules.json ironwood
python3 timeline.py 198.51.100.200 iron-events.jsonl
grep -E "success|useradd|REPLACE" timeline.csv | cut -c1-110
block   198.51.100.200  alerts A003
disable helpdesk2       alerts A004
disable kfoster         alerts A003
1 address(es) in blocklist.txt, 2 account(s) in disable.txt
27 events from 2026-12-03T06:05:20Z to 2026-12-03T07:10:43Z in timeline.csv
2026-12-03T06:29:43Z,auth,login success for kfoster,auth.log:44
2026-12-03T06:32:43Z,auth,sudo kfoster /usr/sbin/useradd -m helpdesk2,auth.log:46

The list has one address and two accounts, kfoster (the password was guessed after a spray against fourteen account names) and helpdesk2 (made by the intruder). Add 203.0.113.77 by hand. The alert for 192.0.2.112 (lnguyen) is a false positive in practice: six failures in 43 seconds and then a success ten seconds later, from her own workstation, which is a forgotten password. The tool cannot know that.

The VPN log shows that containment was not complete. The intruder connected to the VPN at 07:02:15 UTC with the stolen account, from the same address, and stayed until 07:41:50 UTC, with about 73 MB moved. The access was cut at 07:05:00, so the session outlived it by almost 37 minutes. Disable the VPN access of kfoster too. The ssh session on web01 also closed late, at 07:10:43 (the last line of the timeline), almost six minutes after the cut: blocking an address does not end a session that is already open. End it by name. Now classify the two incidents, then the patch order and the report. The number of lines of the report depends on your notes. With these notes (one line of root cause, four changes) it has 40.

Save this as iron-case.json, the notes for the report:

{
  "title": "Stolen account on web01",
  "address": "198.51.100.200",
  "acknowledged": "2026-12-03T06:45:00Z",
  "contained": "2026-12-03T07:05:00Z",
  "root_cause": "The password of kfoster was guessed in a spray over many accounts. The account has no second factor and ssh accepts passwords from any address.",
  "changes": ["Ops: a second factor for every account that can log in by ssh (runbook: stolen account)", "Ops: ssh only from the office network and the VPN (runbook: stolen account)", "Security: page the analyst on duty when rule R1 fires (rule R1)", "Dev: patch shopkit and vpngate (runbook: patch order)"]
}

Save this as iron-incidents.json. It holds the two incidents in the form of lesson 11. Both are confirmed, on one system of criticality 5. Only the second may have lost customer data.

[
  {"id": "INC-301", "summary": "Break-in with the stolen account kfoster", "confirmed": true, "systems": 1, "criticality": 5, "customer_data": false},
  {"id": "INC-302", "summary": "SQL injection on the search page, large answer", "confirmed": true, "systems": 1, "criticality": 5, "customer_data": true}
]

The second argument of incident.py, phase_log.csv, is the file of lesson 11. The tool does not use it for the level, so it can stay as it is.

python3 incident.py iron-incidents.json phase_log.csv | head -n 2
python3 patchrank.py ironwood/inventory.csv ironwood/installed.csv | sed -n '1,2p;$p' | cut -c1-100
python3 report.py iron-case.json iron-events.jsonl iron-rules.json
grep -E "First alert|Access to" incident-report.md
INC-301 SEV1 tell 4 first message within 15 min  Break-in with the stolen account kfoster
INC-302 SEV1 tell 4 first message within 15 min  SQL injection on the search page, large answer
 1 tier 1 LAB-2026-0001 web01   internet crit 5 cvss  9.8 KEV epss 0.93 shopkit 4.2.1 -> 4.3.0
 2 tier 1 LAB-2026-0008 vpn01   internet crit 4 cvss  9.8 KEV epss 0.97 vpngate 7.1.0 -> 7.2.1
8 findings
incident-report.md written, 40 lines
- First alert to the analyst: 34 min 0 s
- Access to containment: 35 min 17 s

The first finding of the ranking, LAB-2026-0001 on web01, is tier 1: in the catalogue, on the internet, on a system of criticality 5. It is the flaw that the SQL injection used, so the patch order and the search-page incident point at the same system. The break-in has no such finding: it used a guessed password. The second finding is the VPN gateway, also tier 1. The intruder used the gateway with the stolen account, so it needs a second factor as well as the patch, but the logs show no sign that the flaw itself was used. Under the example policy of lesson 10, both were due in days.

The report program cannot separate the two actors. Its impact lines for 198.51.100.200 list fifteen accounts, all the names that the spray tried, and say that no web request came from the address. Correct them by hand: two accounts are involved (kfoster and helpdesk2 on web01, and helpdesk3 on files01 if you did task 11), and the data that may have left belongs to the other actor, 203.0.113.77.

For task 10, the second rule is the first one with a new id, title, description, author, date and level, one more selection and a new condition. It finds the one request that the tools ranked too low in task 4. Save it as iron-sql-worked.yml.

title: Database words in a web path, answered with a large page
id: ae3f7b8e-50c6-4a68-a4b7-4dd9181214fc
status: experimental
description: A web request with words of an SQL injection in the path, answered with status 200 and 1,000,000 bytes or more.
author: Ironwood Freight security team
date: 2026-12-03
logsource:
    product: fernwood
    service: events
    definition: 'The normalised events of logparse.py (lesson 2), with its field names'
detection:
    selection:
        action: 'request'
        path|contains:
            - '%27'
            - 'UNION'
            - 'DROP'
    worked:
        status: 200
        bytes|gte: 1000000
    condition: selection and worked
falsepositives:
    - A large public file whose name holds one of the words
level: high
tags:
    - attack.initial-access
    - attack.t1190
python3 sigma_lite.py sigma/web_sql_words.yml iron-events.jsonl | tail -n 1
python3 sigma_lite.py iron-sql-worked.yml iron-events.jsonl | cut -c1-60
5 of 1136 events match: Database words in a web path (level medium)
2026-12-03T09:16:02Z action=request path=/search?q=%27%20UNI
1 of 1136 events match: Database words in a web path, answer

The extension starts here. For task 11, make the Windows export and run the hunt. Then list the Remote Desktop logons and follow the first one for 12 events.

python3 gen_winevents.py 3 ironwin
python3 win_hunt.py ironwin/export.xml
python3 - <<'EOF'
from winevents import parse
from win_hunt import timeline

events = parse("ironwin/export.xml")
rdp = [e for e in events if e["id"] == 4624 and e["data"]["LogonType"] == "10"]
for e in rdp:
    print(e["ts"], e["computer"], e["data"]["TargetUserName"], "from", e["data"]["IpAddress"])
print("\n".join(timeline(events, rdp[0])[:12]))
EOF
export.xml     66 events  sha256 3c04c98c0170
failures by reason: {'bad password': 3}
log cleared: 2026-12-03T07:15:44Z FILES01 id 1102 by kfoster
log cleared: 2026-12-03T07:15:46Z FILES01 id 104 by kfoster
2026-12-03T07:06:44Z FILES01 kfoster from 192.0.2.171
2026-12-03T15:40:02Z FILES01 adm-ops from 192.0.2.50
2026-12-03T07:06:44Z 4624 logon success: kfoster
2026-12-03T07:06:44Z 4672 special privileges: kfoster
2026-12-03T07:07:44Z 4688 process created: whoami /all
2026-12-03T07:08:44Z 4688 process created: net user helpdesk3 * /add
2026-12-03T07:08:45Z 4720 account created: helpdesk3
2026-12-03T07:09:44Z 4688 process created: net localgroup Administrators helpdesk3 /add
2026-12-03T07:09:45Z 4732 added to local group: Administrators
2026-12-03T07:11:44Z 4104 PowerShell script block: Get-ChildItem D:\Shares -Recurse | Measure-Object Length -Sum
2026-12-03T07:12:44Z 4698 scheduled task created: \IronSync
2026-12-03T07:13:44Z 7045 service installed: IronSyncSvc
2026-12-03T07:15:44Z 1102 Security log cleared: kfoster
2026-12-03T07:15:46Z 104 log cleared: System

win_hunt.py finds no brute force and no odd logon, only the two cleared logs. The three failures are a typing mistake of lnguyen at her own keyboard. The reason for the silence is the address. The Remote Desktop logon of kfoster at 07:06:44 came from 192.0.2.171, the address that the VPN gave to the intruder's session at 07:02:15 (task 7). The VPN gives addresses inside the office network 192.0.2.0/24, so outside() counts the session as the office. There were no failed logons, because the intruder knew the password. The logon of adm-ops at 15:40 from the administrator's PC is normal.

So the containment at 07:05:00 missed more than a VPN session. Through that session the intruder reached files01, made the administrator helpdesk3, measured the shares, set up the task \IronSync and the service IronSyncSvc, and cleared both logs at 07:15:44. Add files01 to the scope of INC-301: two systems, and the level stays SEV1 (incident.py gives SEV1 with "systems": 2). Disable helpdesk3 too. Collect the evidence of files01 first, then let its owner remove the task and the service. The 73 MB of the VPN session may be files from D:\Shares: that is an assumption until the file server or the EDR shows what was read. Keep the cleared log in the report as a fact, not as proof of who did it.

The export is a sample. A real domain controller would show a ticket request for kfoster at 07:06, and a real 4688 would show sync.exe and the encoded PowerShell that the EDR saw. Missing events are a finding too (lesson 5, Field notes: the audit policy).

For task 12, put the rule and its samples in detections, test it, break the condition, and put it back.

cp iron-sql-worked.yml detections/
mkdir -p detections/tests/iron-sql-worked
grep "203.0.113.77" iron-events.jsonl | grep '"status": 200' > detections/tests/iron-sql-worked/match.jsonl
grep "203.0.113.77" iron-events.jsonl | grep -v '"status": 200' > detections/tests/iron-sql-worked/nomatch.jsonl
python3 sigma_test.py detections | tail -n 1
sed -i 's/condition: selection and worked/condition: selection/' detections/iron-sql-worked.yml
python3 sigma_test.py detections | tail -n 1
sed -i 's/condition: selection$/condition: selection and worked/' detections/iron-sql-worked.yml
4 rule(s), 0 problem(s)
4 rule(s), 4 problem(s)

Without worked, the four failed requests in nomatch.jsonl match too: four problems. The harness proves that the second selection does the work.

For task 13, make the alerts and triage them from inside ironwood, so that the tool reads the context files of Ironwood.

python3 gen_edr.py 3 ironwood/edr
cd ironwood
python3 ../endpoint_triage.py edr
python3 ../endpoint_triage.py edr G02
cd ..
edr_alerts.json       sha256 ed62eb78091d
known_hashes.csv      sha256 11884bf2b99f
endpoint_changes.csv  sha256 5f23926a7ea8
3 alerts
P1 G02 files01 kfoster score 6 true positive
   tree: explorer.exe > cmd.exe > sync.exe
   signals: known_bad_hash(+4) edr_malicious(+2)
   ask: isolate host files01; collect the triage package; disable account kfoster
P3 G01 files01 kfoster score 3 needs review
   tree: explorer.exe > cmd.exe > powershell.exe
   signals: encoded_command(+2) edr_suspicious(+1)
   T1059.001 Command and Scripting Interpreter: PowerShell
   decoded: Get-ChildItem D:\Shares -Recurse | Measure-Object Length -Sum
   ask: collect the triage package; ask kfoster what they ran
P4 G03 ci01 deploy score -1 false positive
   tree: services.exe > ci-agent.exe > powershell.exe
   signals: encoded_command(+2) edr_suspicious(+1) approved_change(-4)
   T1059.001 Command and Scripting Interpreter: PowerShell
   decoded: Get-Item C:\build
   ask: close and note the ticket
1 true positive, 1 needs review, 1 false positive
Title: true positive, Known bad file started by a command shell, on files01 (G02)
Seen: at 2026-12-03T07:12:37Z the user kfoster ran explorer.exe > cmd.exe > sync.exe.
Command: sync.exe -install
Evidence: signals known_bad_hash, edr_malicious; score 6
Decision: true positive, priority P1.
Asked: isolate host files01; collect the triage package; disable account kfoster.
Not known yet: the EDR only detected: we do not yet know what the process did after it started.

G02 is the file that the task and the service of the Windows export start. Its hash is on the list of known bad files, and the EDR only detected it, so it is P1. The tool asks to isolate files01 (criticality 3) and to disable kfoster. Add the decoded share measure, the address 192.0.2.171 and the person who approves the isolation to the ticket by hand. The tool calls G01 "needs review" and asks kfoster what she ran. That is wrong. The encoded command is the share measure of the 4104 event at 07:11:44, in the same Remote Desktop session, and kfoster said that she did not use her account. G01 is a true positive and part of INC-301. G03 on ci01 is covered by change CHG-2214: a false positive.

Mark your report

You mark this yourself, or you ask a colleague or a mentor to mark it. The page checks the numbers above; it cannot read your report.

CriterionNot yetMeets the standardStrong
FindingsOne actor, or no VPN session.Two incidents; helpdesk2, the injection, the VPN session.Also the false positive of lnguyen's password and, from the extension, helpdesk3, files01 and G03.
EvidenceNumbers without a source, or local times.Each claim cites a file and line or a command; times in UTC.Names both clock offsets and the sealed hashes.
JudgementKeeps the tools' priorities.Injection alert to priority 1, with reasons.Separates facts from assumptions (customer data, 73 MB); from the extension, G01 to true positive.
Containment and scopeStops at "access cut at 07:05".Shows that the VPN session and the ssh session outlived the cut; disables the VPN access of kfoster.From the extension: shows files01, widens INC-301, and orders the steps: VPN, accounts, evidence, then task and service.
ChangesVague, or blames kfoster.Four changes with an owner and a rule or runbook each (as in the model iron-case.json); the root cause is a missing control.A rule that counts failures for each user, a page when R1 fires, patch deadlines.
Vulnerability and detectionNo tier or no deadline; no new rule.Names LAB-2026-0001, tier 1 and its deadline under the policy; says why the break-in has none; shows the matches of the new Sigma rule (task 10).Also says what the finding of the VPN gateway adds; from the extension, the harness result before and after the change.
WritingJargon, no dates, over two pages.A manager can act on the summary alone; dated; no blame.Impact and state of each actor in plain words.

Meets the standard in every row: you can show this report as a work sample. Remove names and data that are not yours to share.

The report shows your work on this scenario, done on your own machine without a proctor.

This is an example of a summary that meets the standard (four sentences):

On 3 December 2026 two actors attacked Ironwood Freight. The first guessed the password of kfoster in a spray over fourteen accounts, logged in to web01 at 06:29 UTC and made the account helpdesk2; it then used a VPN session (07:02 to 07:41 UTC) that outlived the cut. The second, 203.0.113.77, used the open flaw LAB-2026-0001 in shopkit to bend the search query, and one answer of 1,402,118 bytes may hold customer data. The first incident is contained on web01 but not yet on the VPN, the second is confirmed and waits for the patch; both are SEV1.

With the extension, the second sentence adds that the session reached files01, where the intruder made helpdesk3, set up a task and a service, and cleared the logs, and the fourth says that files01 is not yet contained.

Get a result link

When all 31 answers above are right, the server can check them again and give you a signed link. You can put the link in a CV or send it to a manager: it opens a page that shows the course, the test, the date and the name you give here. No account, and nothing is stored: keep the link.