SOC › Module 5 › Lesson 4
Lab — Rules
Pack rule anatomy, Sigma, and tuning cards — detection rules file from $SOC_LAB only.
Visual · t29_rules_lab
Lab: rules pack. $SOC_LAB only. Original Cyberlium.
Opening
Rules pack merges anatomy to Sigma to tuning — paperwork before alert triage module.
Lessons 5-1–5-3 named rule anatomy, Sigma structure, and tuning hygiene. This lab merges three sections into one $SOC_LAB detection artifact with optional Sigma-to-field mapping table. No production rule deployment — detection literacy paperwork only. Next: Quiz — Detection Rules.
1. Lab contract: rules pack
Create $HOME/cyberlium-lab/t29-m05-l04-rules-lab.txt merging anatomy diagram, Sigma structure card, and tuning plan with $SOC_LAB scenario ID and M1 ethics cross-reference.
Optional: paste five-line fictional Sigma-style YAML skeleton — no production hostnames.
Command guide
Try these commands — Lab contract: rules pack
═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)
Sigma repo — https://github.com/SigmaHQ/sigma Elastic detection engine — https://www.elastic.co/guide/en/security/current/detection-engine-overview.html Splunk sigma — https://docs.splunk.com/Documentation/ES
═══ INSTALL ═══
Linux (Debian/Ubuntu):
Command — copy this
sudo apt install curl
macOS: Built-in
Windows: Built-in (PowerShell: Invoke-WebRequest)
═══ LINUX / macOS ═══
Command — copy this
export SOC_LAB=${SOC_LAB:-$HOME/cyberlium-lab/t29-soc}
cat > "$SOC_LAB/notes/sigma-lab-notes.txt" <<'EOF'
YOUR failed-logon-lab.yml maps to:
- Seeded pattern: 3x 4625 from 10.0.5.88 (jsmith) in auth.jsonl
- MITRE: T1110.001 Password Guessing
- Tuning: add threshold (e.g. >5 in 5min) to reduce FP on typo
- Production: import via Elastic/Splunk — never deploy against stranger logs
EOFCommand — copy this
grep -E 'Seeded|MITRE|never' "$SOC_LAB/notes/sigma-lab-notes.txt" curl -sS https://github.com/SigmaHQ/sigma/tree/master/rules/windows/builtin/security | head -8
═══ WINDOWS ═══
Command — copy this
Get-Content $HOME/cyberlium-lab/t29-soc/rules/failed-logon-lab.yml | Select-String EventID Get-Content $HOME/cyberlium-lab/t29-soc/notes/sigma-lab-notes.txt | Select-String MITRE
Primary tools to practice this lesson: grep, curl. Reference sites: Sigma repo (https://github.com/SigmaHQ/sigma); Elastic detection engine (https://www.elastic.co/guide/en/security/current/detection-engine-overview.html); Splunk sigma (https://docs.splunk.com/Documentation/ES). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.
2. Cross-check ethics
Grep for production index names, live rule IDs, stranger tenant URLs — remove. Pack labels all rules as $SOC_LAB training only.
Confirm malware/phishing/brute references stay detection literacy on fake logs — no exploit steps.
3. Lock the proof
chmod 600 on the pack. Quiz next — then Triage Process in M6.
Detection rule literacy feeds alert triage lessons next module.
4. What you ship: detection rules pack for $SOC_LAB
Merged anatomy, Sigma, tuning sections. $SOC_LAB named. NO prod deploy. chmod 600.
5. What you record before the next lesson
Date. Rules pack path. $SOC_LAB named. File t29-m05-l04-rules-lab.txt chmod 600.
6. Wrong vs right: stranger SIEM vs YOUR sample logs
Worked failure — same MSF word, opposite target. Right never needs a café Wi-Fi or classmate laptop.
Wrong
Include production Splunk savedsearch name in pack. Skip tuning plan section.
Right
Write YOUR detection rules pack for $SOC_LAB. chmod 600. Next: Quiz — Detection Rules.
Mission: freeze YOUR detection rules pack
1) Merge M5 literacy sections. 2) Confirm zero production rule refs. 3) Link M1 ethics cross-ref. 4) chmod 600.
Stuck? Ask Cyberlium AI Mentor
One governed rules pack beats ten noisy alerts on a stranger tenant.
Knowledge Check
APPLY: This lab requires:
Multiple choice
Knowledge Check
APPLY: True or False: Rules pack must label scenarios as $SOC_LAB training only.
True or False
Knowledge Check
APPLY: Brute/phishing/malware in rules pack are:
Multiple choice