Practice: detection engineering
15 min · 2 ejercicio(s)
From hunt to rule
A good detection rule is specific (few false positives), robust (survives small attacker changes) and explained (the analyst knows what to do). Before you ship a rule:
- Run it over at least a week of data and count the hits.
- Read every hit. If you would not want to be woken up for it, tune the rule.
- Map it to MITRE ATT&CK and write a short triage note.
Robust conditions
| Fragile | Robust |
|---|---|
process.command_line == "wevtutil.exe cl Security" |
process.name : "wevtutil.exe" and process.args : ("cl", "clear-log") |
process.name == "PsExec64.exe" |
process.name : "psexesvc.exe" on the target (the service name is hard to change) |
file.path == "C:\\ProgramData\\rc\\rclone.exe" |
process.executable : ("*\\ProgramData\\*", "*\\AppData\\*") combined with network behaviour |
Rule types in Elastic Security
- Custom query (KQL): single events.
- EQL: single events with richer logic, and sequences.
- ES|QL: aggregations, e.g. "more than 50 failed logons per source IP in 5 minutes".
- Threshold, machine learning, indicator match and new terms for special cases.