Skip to content
Tutorials Center
My learning

Topics

Lesson 4 of 37 ยท Getting Started

Build a Safe SIEM Practice Lab

Plan a legal SIEM home lab with virtual machines, free tools and synthetic logs. Includes a Python log generator you can run to practice detections with no real targets.

You learn detection by looking at logs, and you need logs that contain both normal and suspicious behavior. The safe way is a lab you control: your own virtual machines or, even simpler, synthetic logs you generate yourself. This lesson shows both and sets the ground rules.

Ground rules

  • Only generate, replay or test activity on machines and networks you own or have written permission to test.
  • Keep the lab isolated (host-only or internal virtual network) so nothing reaches the internet or other people.
  • Never run real malware samples on a connected machine.
  • Use documentation address ranges in examples and sharing: 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are reserved for examples, and 10.0.0.0/8 is private.
  • Do not put real company or personal data in a lab.

Option 1: synthetic logs (what this course uses)

The fastest lab needs no installation at all. You write a small program that emits realistic log lines, including a planted "attack" you later try to detect. Because you planted it, you know the right answer, which lets you measure your rule.

Option 2: a small virtual lab

flowchart TB
    subgraph Host["Your PC (isolated virtual network)"]
        W["Windows VM<br/>Sysmon + event logs"]
        L["Linux VM<br/>auth.log, auditd"]
        S["SIEM VM<br/>Wazuh or Elastic or Security Onion"]
    end
    W -->|logs| S
    L -->|logs| S

Two endpoints send logs to one SIEM machine, all on an internal network.

Typical resources: 16 GB RAM is comfortable for three small VMs; a SIEM VM wants 4 to 8 GB. Free options include Wazuh, Elastic Stack, Graylog and Security Onion. Follow each project's official installation guide; version numbers change, so this course does not pin them.

Generate synthetic logs

Python Synthetic SSH log generator with a planted attack

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The program always prints the same lines because of the fixed seed. Detections you write later can be tested against this file and compared with the known answer: the attacker is 203.0.113.66.

Measure your detection

Because you planted the attack, you can count true positives and false positives. This habit, detection testing, is the core of professional rule development.

Python Test a rule against ground truth

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice how a low threshold flags innocent addresses (false positives) and a high one misses the attack. Tuning is a trade-off you will meet again in chapter 4.

Replaying real public datasets

Public sample log sets exist for research. If you download one, read its license, store it in your isolated lab, and treat it as untrusted data: do not open attachments or run executables found inside. Prefer text logs.

Lab checklist

  1. Isolated network, snapshots of every VM before experiments.
  2. Time synchronized on all machines (a later lesson shows why).
  3. A written lab notebook: what you generated, what you expected, what the SIEM showed.
  4. A reset plan: delete and rebuild instead of "cleaning up".

Never point scanners, brute-force tools or exploit code at systems that are not yours, even "just to test" a detection. That is illegal in most countries. Synthetic logs give the same learning with no risk.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which address range is reserved for documentation and safe to use in examples?

    192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24 are set aside for examples (RFC 5737).
  2. 2. Why plant a known attack in synthetic logs?

    Ground truth lets you count true and false positives and tune the rule.
  3. 3. What is the correct network setup for a malware-analysis or attack-testing lab?

    Isolation prevents accidental harm to real systems.
  4. 4. Raising a threshold from 2 to 12 failures usually does what?

    A higher threshold is quieter but risks missing slower attacks.

Summary

  • Practice only on systems you own, in an isolated lab, with documentation IP ranges.
  • Synthetic logs with a planted attack are the fastest, safest lab.
  • Detection testing measures true positives, false positives and misses.
  • Snapshots, synced clocks and a lab notebook keep experiments reproducible.

Next: Inside the Security Operations Center