Module 8 · Labs
These six labs turn security from a topic into a practice. The centerpiece (Lab 5) is the purple-team exercise — attack your own lab, hunt yourself in the logs, close the gaps — which produces the module deliverable. Everything happens against your own infrastructure and your isolated practice lab, never anything else.
Lab 1 · Self-assessment
Section titled “Lab 1 · Self-assessment”Goal: scan your own lab, produce a findings report, remediate, and re-scan to prove the fixes. Exercises Lesson 8.1.
- Enumerate your lab with
nmap(-snfor discovery,-sV -p-for full service/version on key hosts). Compare against your Module 3 diagram — is anything running you didn’t expect? - Vulnerability scan with OpenVAS/Greenbone (or Nessus Essentials, or Lynis on-host) against your own servers. Produce a findings report.
- Triage by real risk in context (exposure, blast radius), not CVSS alone. Pick the top items.
- Remediate each: patch (Lesson 2.2), tighten firewall/segment (Lessons 2.3 / 3.3), fix config, or remove the service.
- Re-scan and confirm each finding is gone. Capture before/after.
Verify
Section titled “Verify”- You produced a real findings report for your own lab.
- You remediated the top findings and re-scanned to verify they’re closed.
- You prioritized by contextual risk and can justify the order.
Commit
Section titled “Commit”security/01-assessment.md: the (sanitized) findings, your remediations, and the before/after
scan evidence. A genuinely strong portfolio artifact.
Lab 2 · Leak drill
Section titled “Lab 2 · Leak drill”Goal: build the secret-rotation reflex by detecting, rotating, and scrubbing a leaked secret. Exercises Lesson 8.2.
- In a throwaway test repo, deliberately commit a fake secret (a dummy API token) and make a few commits on top so it’s buried in history.
- Detect it:
gitleaks detect/trufflehog— confirm the tool finds it in history, not just the latest commit. - Rotate first (the reflex): in a real scenario you’d revoke the token and issue a new one — practice the steps and write down why rotation, not deletion, is the real fix.
- Scrub history (
git filter-repoor BFG) and confirm the scanner no longer finds it. - Prevent recurrence: add a
gitleakspre-commit hook and/or a CI gate (Lesson 7.4); prove it blocks a new secret before commit/push.
Verify
Section titled “Verify”- A secret scanner found the planted secret in history.
- You can explain why rotation must come before (or instead of) scrubbing.
- A pre-commit/CI guard now blocks secrets before they’re pushed.
Commit
Section titled “Commit”security/02-leak-drill.md (in a clean repo — not the one with the planted secret): your method
and the rotation-first reasoning.
Lab 3 · Dashboards
Section titled “Lab 3 · Dashboards”Goal: stand up monitoring and alerting for your homelab. Exercises Lesson 8.3.
- Deploy Prometheus + Grafana as containers (Module 6),
with
node_exporteron each host. - Build a dashboard showing your homelab’s vital signs: CPU, memory, disk, service health across hosts (the four resources from Lesson 1.1).
- Configure at least one alert that actually reaches you (email/push/webhook) on a real condition — e.g. disk >85%, a service down, or a TLS cert expiring within 14 days (Lesson 6.3).
- Trigger it deliberately (fill a disk on a test VM, stop a service) and confirm the alert fires and reaches you.
Verify
Section titled “Verify”- A Grafana dashboard shows your homelab’s health at a glance.
- At least one alert is wired to actually notify you.
- You triggered a real condition and received the alert.
Commit
Section titled “Commit”security/03-monitoring.md with your dashboard (screenshot) and alert config; add the
Prometheus/Grafana stack to your homelab/ Compose repo.
Lab 4 · Central logging & a detection rule
Section titled “Lab 4 · Central logging & a detection rule”Goal: centralize logs and write a detection rule that fires on attack behavior. Exercises Lesson 8.3.
- Ship logs from all hosts to a central store — Loki (with the Grafana stack), or Wazuh for a full SIEM experience.
- Confirm you can search across hosts from one place (e.g. find
auth.logfailed logins from every server at once). - Write one detection rule — start with SSH brute-force (many failed logins from one IP in a short window), or “a new listening port appeared,” or off-hours access.
- Trigger it deliberately from another VM (attempt repeated SSH logins to a target) and confirm the rule fires an alert.
- Note why central logging beats per-host logs for both correlation and integrity (Lesson 8.3).
Verify
Section titled “Verify”- Logs from all hosts are searchable in one central place.
- You wrote a detection rule and triggered it to confirm it fires.
- You can explain the correlation and integrity benefits of central logging.
Commit
Section titled “Commit”security/04-detection.md: your logging setup, the detection rule, and evidence it fired.
Lab 5 · Purple team
Section titled “Lab 5 · Purple team”This is the module’s centerpiece and deliverable. Attack your lab, hunt yourself in the logs, close the gaps. Exercises Lesson 8.4.
- Prepare — in your isolated lab, set up a sacrificial target with a planted weakness (weak SSH password, DVWA, a known-vulnerable service). Snapshot it.
- RED: run an attack chain — recon (
nmap), gain a foothold via the planted weakness, then do attacker things: create a user, open a new listening port, read a planted “sensitive” file, attempt lateral movement to another lab host. Keep timestamped notes. - BLUE: switch hats. Using only your dashboards and logs (Lesson 8.3), reconstruct the attack and build a timeline. Which steps did your detection catch? Which did it miss?
- Close the gaps: for everything you missed, add a detection rule / ship a missing log / tune an alert. Re-run the attack and confirm you now catch what you missed.
- Write the purple-team report (below).
Verify
Section titled “Verify”- You executed a multi-step attack against your own lab target.
- You reconstructed it from your defensive evidence and built a timeline.
- You honestly identified what your detection missed, then closed those gaps and verified.
Deliverable
Section titled “Deliverable”blog/08-purple-team-report.md — the module deliverable. Include: the attack narrative (what red
did), the detection evidence (dashboard/log screenshots), the timeline, an honest account of
what you missed, and the gaps you closed. This is the most impressive security-track artifact you
can show.
Lab 6 · Post-mortem
Section titled “Lab 6 · Post-mortem”Goal: practice incident response and write a blameless post-mortem. Exercises Lesson 8.4 and 0.5.
- Take the compromise from Lab 5 (or investigate a prepared “already-compromised” VM image) as your incident.
- Work the IR lifecycle: detect → contain → eradicate → recover (restore from your tested backups Lesson 4.3, or rebuild from code Module 7) → learn.
- Write a blameless post-mortem (Lesson 0.5): summary, timeline, root cause, what detection caught vs. missed, and concrete action items.
Verify
Section titled “Verify”- You worked the full IR lifecycle, including a real recovery from backup or code.
- Your post-mortem is blameless, factual, and has concrete action items.
Commit
Section titled “Commit”blog/08-incident-postmortem.md — pairs with the purple-team report as the deliverable.
Module 8 checkpoint
Section titled “Module 8 checkpoint”- I can state, precisely, what I am and am not legally allowed to test (Lesson 8.0)
- I regularly scan my own lab and remediate findings, with before/after proof (Lab 1)
- No secret lives in plaintext or in git history; I know how to rotate one (Lab 2)
- My homelab has metrics dashboards and alerts that reach me (Lab 3)
- My hosts ship logs centrally and I have at least one working detection rule (Lab 4)
- I’ve run a purple-team exercise and found (most of) my own attack in the logs (Lab 5)
- I can write a clear, blameless post-mortem (Lab 6)
Deliverable
Section titled “Deliverable”Your purple-team report + post-mortem (Labs 5–6): the attack narrative, detection evidence, an honest account of what you missed, the gaps you closed, and a blameless incident write-up — the single most impressive artifact for a security-track interview.
Next module: Module 9 · The Bridge to a Career → — where all of this becomes a job.