A security operations (SOC) practice lab

Collect and search real logs on your own machines, use a free SIEM or just command-line tools, and practise triage, detection and hunting on data you generate yourself.

  • Time: 1 to 2 hours
  • Cost: free software, your own computer

What you need

Security analysis needs data. You can generate your own safely: the authentication log of a Linux VM, the web server log of a test site, command history and process events. Then you search it, exactly as the lessons did in the browser.

You can start with no extra software at all: grep, awk, sort, uniq -c and jq can count failed logins, group by address and find rare values, and they teach the same thinking as a query language. When you want a proper search interface, free options include the Elastic stack (elastic.co, self-managed with its free features), Wazuh (wazuh.com, open source detection and response) and Security Onion (a free security-monitoring distribution). They are heavy, so give the VM 4 to 8 GB of memory.

Set it up

  1. Build a small lab: a target VM (Ubuntu with SSH and a web server such as nginx) and a log VM (or the same VM at first). Keep them on an internal or host-only network.
  2. Make the target produce data. Failed logins appear in /var/log/auth.log; web requests in /var/log/nginx/access.log.
  3. Practise the lesson queries by hand. For example, failed logins by address:
grep "Failed password" /var/log/auth.log | awk '{print $(NF-3)}' | sort | uniq -c | sort -rn | head
  1. To use a platform, follow its official quick-start for a single-node install in a VM, install its agent on the target, and confirm events arrive.
  2. For detection rules, learn Sigma (a generic rule format used by many tools) and write one rule for a behaviour from the course, such as repeated failed logins followed by a success.

Check that it works

  • You can answer “which address failed most often?” from the log with a one-line command.
  • Fresh events appear in your platform within a minute of you causing them (for example, three wrong SSH passwords from the log VM).
  • A rule you write fires on your staged attack and stays quiet on normal logins.

Practise safely

  • Stage attacks only against your own lab VMs. Failed logins and scans against your own target are fine; never aim anything at a system you do not own.
  • Mark your staged events (a note in your lab diary with times) so you can tell tests from real activity.
  • Keep real personal data out of the lab. Use made-up users and fake passwords, and do not collect logs from real people.
  • Protect the log platform like any server: change default passwords and keep it off the internet.

Go further

  • Add a second source (for example web logs) and rebuild a timeline across the two sources, as in the incident case.
  • Hunt your own data: find the rarest user agent, the rarest process parent or the most regular connection interval.
  • Write three detections and test each against your staged attacks and some normal behaviour; measure what each catches and falsely flags (the capstone asks for exactly this).
  • Practise on public, safe datasets and challenges from blue-team training sites; read their terms and current free offers first.

Courses that use this lab

Other lab guides

Software changes quickly. Menu names and version numbers may differ a little from what you see; the ideas and the check at the end of each section stay the same. Always download from the project's own website, and read the licence terms for your situation.