Cyberlium

Purple › Module 5 › Lesson 4

BeginnerModule 5Lesson 4/5

Lab — Testing

Pack unit test rules, replay logs, and baselines cards — testing file from $PURPLE_LAB only.

25 min+40 XP3 quiz
Module progress4 of 5

Visual · t35_testing_lab

Lab: testing pack. $PURPLE_LAB only. Original Cyberlium.

Opening

Testing pack merges unit tests to replay to baselines — paperwork before atomic simulation module.

Lessons 5-1–5-3 named unit test rules, replay logs, and baselines. This lab merges three sections into one $PURPLE_LAB testing artifact with M1 ethics and M4 Sigma cross-references. No live victim logs or stranger-network telemetry — detection testing paperwork only. Next: Quiz — Testing Detections.

1. Lab contract: testing pack

Create $HOME/cyberlium-lab/t35-m05-l04-testing-lab.txt merging unit test rules, replay logs, and baselines sections with $PURPLE_LAB fictional T1059 rule and M1/M4 cross-references.

Optional: link replay log set to purple exercise from M2 concepts pack.

Command guide

Try these commands — Lab contract: testing pack

═══ TOOLS & WEBSITES ═══ Browse / read these (authorized learning only — stay in YOUR lab / program scope)

Optional command

jq manual — https://jqlang.github.io/jq/manual/

Sigma — https://sigmahq.io/ Elastic detection — https://www.elastic.co/guide/en/security/current/rules-ui.html

═══ INSTALL ═══

Linux (Debian/Ubuntu):

Command — copy this

sudo apt install jq

macOS:

Command — copy this

brew install jq

Windows:

Command — copy this

choco install jq

═══ LINUX / macOS ═══

Command — copy this

export PURPLE_LAB=${PURPLE_LAB:-$HOME/cyberlium-lab/t35-purple}
echo '=== jq validate failed-logon rule logic against FAKE auth.jsonl ==='
jq -c 'select(.event_id==4625) | {user, src_ip, host, ts}' "$PURPLE_LAB/telemetry/auth.jsonl"
python3 - <<'PY'
import json, os, collections
lab = os.environ.get('PURPLE_LAB', os.path.expanduser('~/cyberlium-lab/t35-purple'))
events = [json.loads(l) for l in open(os.path.join(lab,'telemetry','auth.jsonl'))]
by_user = {}
for e in events:
    by_user.setdefault(e['user'], []).append(e)
print('Purple rule validation (failed-then-success):')
for user, evs in by_user.items():
    fails = [x for x in evs if x['result']=='failure']
    succ = [x for x in evs if x['result']=='success']
    if len(fails) >= 3 and succ:
        print(f'  MATCH UT-01: {user} — {len(fails)} fail → success — tune rule fires')
PY

Command — copy this

grep -E 'title:|EventID:' "$PURPLE_LAB/rules/failed-logon-lab.yml"
grep UT-01 "$PURPLE_LAB/testing/unit-test-plan.md"

═══ WINDOWS ═══

Command — copy this

findstr 4625 $HOME/cyberlium-lab/t35-purple/telemetry/auth.jsonl
Get-Content $HOME/cyberlium-lab/t35-purple/rules/failed-logon-lab.yml | Select-String t1110

Primary tools to practice this lesson: jq, grep. Reference sites: jq manual (https://jqlang.github.io/jq/manual/); Sigma (https://sigmahq.io/); Elastic detection (https://www.elastic.co/guide/en/security/current/rules-ui.html). Run every command in the box — install first, then the usage lines — only on YOUR lab / program scope.

2. Cross-check ethics

Grep for live victim logs, stranger-network telemetry, production SIEM exports — remove. Confirm all fixtures are $PURPLE_LAB fictional.

Test fixtures use synthetic or lab-captured data — no real victim events.

3. Lock the proof

chmod 600 on the pack. Quiz next — then Atomic Named.

Testing literacy feeds atomic simulation lessons in M6.

4. What you ship: testing pack for $PURPLE_LAB

Merged unit test, replay, baseline sections. $PURPLE_LAB named. chmod 600.

5. What you record before the next lesson

Date. Testing pack path. $PURPLE_LAB named. File t35-m05-l04-testing-lab.txt chmod 600.

6. Wrong vs right: stranger networks vs YOUR purple lab

Worked failure — same MSF word, opposite target. Right never needs a café Wi-Fi or classmate laptop.

  • Wrong

    Include live victim log fixtures. Skip baselines section.

  • Right

    Write YOUR testing pack for $PURPLE_LAB. chmod 600. Next: Quiz — Testing Detections.

Mission: freeze YOUR testing pack on disk

1) Merge M5 literacy sections. 2) Confirm fictional fixtures only. 3) Link M1/M4 cross-refs. 4) chmod 600.

Stuck? Ask Cyberlium AI Mentor

One governed testing pack beats deploying rules with zero validation.

Knowledge Check

1

APPLY: This lab requires:

Multiple choice

Knowledge Check

2

APPLY: True or False: Testing pack should include baselines with FP thresholds.

True or False

Knowledge Check

3

APPLY: Testing pack supports:

Multiple choice

← Previous

Answer all 3 knowledge checks to continue. (0/3 answered)