Stage 5 of 10 · about 14–20 hours · beginner · checked 2026-11-22

First detections

Goal. By the end you can build a small set of detections in a lab, each with a rule, a written explanation, an ATT&CK mapping and evidence that it fires.

Why it matters#

Everything so far was preparation. Now you build, and you find out how much the earlier stages mattered: whether you can see the data, whether the behaviour has a clean invariant, whether your rule matches harmless activity. Your first five detections are also the start of a portfolio, so do them properly.

What you will learn#

The loop for one detection#

Follow the same path every time. It is a compressed version of the lifecycle from stage 1:

  1. Pick a behaviour and write down why it matters (stage 2).
  2. Confirm the data exists in your lab, with the fields you need (stage 3).
  3. Find the invariant. Read the ATT&CK page and one or two public rules for the same behaviour.
  4. Write the rule, as Sigma first (stage 4), and convert it for your SIEM.
  5. Run it against your lab and look at what it returns, both the hits and the surprises.
  6. Write the detection card (below).
  7. Record the evidence that it fires, for stage 6 to build on.

A starter set of ten behaviours#

These are common across many intrusions and need only the data you set up in stage 3. Build at least five.

Behaviour Data you need What to key on (the invariant) Common false positives
Office program starts a shell Process creation with the parent process An Office program as parent, a shell or script interpreter as child Add-ins, legitimate macros
Encoded or hidden PowerShell Process creation with the command line, or script block logging PowerShell started with an encoded command or a hidden window, with a long encoded value Management and deployment tools that do this legitimately
A file fetched with a built-in tool Process creation with the command line A system utility used to download from a URL, which is unusual for that tool Admin scripts, software updaters
Scheduled task created Process creation, or task-creation events A new task made from the command line or by an unusual parent, running from a user-writable folder Installers, administration
Start-up registry entry added Registry value set events A new value under a run key pointing to a user-writable folder Installers and updaters
New service from an unusual path Service-installed events A service whose program sits in a temporary or user-writable folder Software installs
LSASS memory accessed Process-access events A non-system process opening the LSASS process with memory-read rights Security and monitoring agents
Backups or shadow copies deleted Process creation with the command line A command that deletes shadow copies or backup catalogues Backup software housekeeping
Password spraying Failed-logon events, identity sign-in logs One source failing against many different accounts in a short window Gateways, misconfigured services
Security log cleared Log-cleared events A log-cleared event, which is rare in normal operation Rebuilds and some maintenance

Three of these are already worked through in stage 4 (the Office rule, a scheduled-task rule and the spray correlation). For each new one, look up the technique on the live ATT&CK site and copy its ID. Then read a public rule for the same behaviour, for instance in the SigmaHQ repository, and ask what it assumed that you can or cannot assume in your lab.

Write a detection card#

A rule alone is not a detection. The analyst who sees the alert needs to know what it means and what to do. Palantir published a template for exactly this, called the Alerting and Detection Strategy (ADS) framework. This is a trimmed version to adapt:

Section What to write
Goal The behaviour you detect, in one sentence
ATT&CK mapping Tactic and technique, copied from the live site, and the ATT&CK version you used
How it works The invariant you key on, and why the attacker cannot easily avoid it
Data needed Sources and fields, and how you checked them
Logic A link to the rule file
Blind spots and assumptions What this misses, and what must be true for it to work
False positives What harmless activity looks the same, and how to tell
Validation How you proved it fires, and where the evidence is
Severity and priority How serious a hit is, and how fast someone should look
Response What the analyst does first, and when to escalate
Owner and review date Who maintains it, and when it is next reviewed

Here is a filled-in example for the Office rule:

Goal. Alert when a Microsoft Office program starts a command shell or script interpreter. ATT&CK. Execution, T1059 (checked against the live site, v20.1, 2026-11-22). How it works. Malicious documents commonly run their payload by launching a shell from the Office process. An attacker who wants the macro or exploit to run must launch something from Office, so we key on the parent and child relationship rather than on a file name. Data needed. Process creation with parent image and command line (Sysmon event 1 or an EDR table). Checked on lab hosts on 2026-11-22. Blind spots. Does not catch a payload injected into the Office process without starting a child process. Assumes parent process information is recorded accurately. False positives. Office add-ins and automation that run scripts. Tell them apart by the command line and the signed publisher. Validation. Test document run in the lab; evidence saved alongside the rule (stage 6). Severity. Medium. Response. Check the document that was opened, the user's recent mail, and the command line of the child. Isolate the host if the child connects out or downloads a file.

Writing the card often exposes a weak rule. If you cannot say what the analyst should do, the alert is not ready.

Naming, status and severity#

  • Names. Follow a convention such as <source>_<platform>_<behaviour>.yml, so rules sort and search well.
  • Status. Sigma's status field moves from experimental to test to stable as evidence builds. New rules start as experimental.
  • Level. Reserve high and critical for behaviours that almost always mean trouble. A rule with several known false positives is low or medium until you have tuned it (stage 6).

Do this#

  1. Build five detections (8 to 12 hours). Choose five from the table. For each, keep one folder with the Sigma rule, the converted query for your SIEM, the detection card, and a screenshot or exported result showing it firing in your lab.
  2. Map them (1 hour). Colour the five techniques in an ATT&CK Navigator layer and export it. Compare it with the layer from stage 2: which behaviours from that real intrusion could you now see?
  3. Review each other's cards (2 hours). Swap cards with another learner, or re-read your own a day later, and mark anything an analyst could not act on.
  4. Put them in Git (1 hour). Create a repository for your rules and commit them with clear messages. Stage 7 will build on it.

Resources#

Free first

Paid or needs an account

  • None needed for this stage.

Checkpoint#

You are ready to move on when you can:

Go deeper (optional)#

  • Pick one rule from each of the Splunk, Elastic and Sentinel repositories and compare how each documents its false positives.
  • Take a detection you built and write down three ways an attacker could slip past it. This is the "blind spots" section, and the seed of stage 6.
  • See what the analyst does with your alert in SOC & Incident Response stage 2.

0 / 6 checkpoints ticked

View this page on GitHub

9 lines · 59 stages · 77 pages 0 of 59 stages done