Helpful first: Write a detection for a behavior
Thirty days to Halcyon · Case 13: The quiet rules · Episode 3 of 5
Thursday, 09:00. Nyx, the Threat Hunter, has an approved test window until noon and two test hosts built like the ground-station hosts. Five rules should catch KS-4's three behaviors. None has fired on a known test.
Dax Mercer, a software engineer on the operations tools team, brings his own list. One of the five raised 1,400 alerts last week, all from the backup agent.
"Turn that one off," he says. Nyx opens her test plan. If a rule stays silent today, what has she learned?
By the end you can
- Test a detection with a safe emulation of the behavior it targets
- Tune a noisy rule with a narrow, documented exclusion instead of disabling it
- Keep each detection with an owner, a test, and a review date
No alerts proves nothing
Since Wednesday evening none of the five rules has raised an alert that points at KS-4. That silence has two readings. Either nothing happened, or the rules cannot see it. Silence alone cannot tell them apart.
Some of Meridian's 312 rules have been tested in earlier replays. None of these five has a recorded test. So far each one is a guess with a name and a tag.
A test removes the guess. Someone performs a known, harmless instance of the behavior, at a known time, on a known host. Then they look for the alert. If it fires, the rule, its data, and the path between them all worked once. If it stays silent, one of the three causes from the last lesson is at work: logic, missing data, or a wrong field name.
Testing a detection is not the same as a penetration test. A penetration test asks whether an attacker can get in. A detection test asks whether Meridian would notice a specific behavior when it happens. The two answers are independent.
Emulate the behavior, not the harm
An emulation performs the steps of a behavior without its harm. Nyx's first test creates a scheduled task that runs a harmless program, then deletes it. The second creates a service on one test host from the other, then removes it. The third packs a folder of dummy files into an archive and uploads 5 MB over HTTPS to a test server Meridian owns.
Atomic Red Team, maintained by Red Canary, is a public library of small tests mapped to ATT&CK techniques. Its guidance is plain. Ask the environment owner for permission first. Use a machine built like the real ones. Expect some tests to change the system, and run each test's cleanup commands afterwards.
So Nyx's plan names the behaviors, the two hosts, the window, and who approved it. It says what each test does, and how it is undone.
A test proves less than it seems. It shows the rule fires on those two hosts and that their events reach the SIEM. It does not show that all 38 ground-station hosts send the same events. Wednesday's forwarding check answers that part.
| Rule | Behavior and technique | Result |
|---|---|---|
task- | Scheduled task, T1053.005 | Fired |
service- | Remote service, T1569.002 | Silent: the rule read event 7045 from the System log but asked for ServiceFileName, the name event 4697 uses. Event 7045 names it ImagePath |
service- | Remote service, T1569.002 | Silent: it needs services on 3 hosts within 10 minutes, and the test made 1 |
archive- | Archive, T1560.001 | Fired, and 1,400 times last week on the backup agent |
large- | Upload over HTTPS, T1048.002 | Silent: it needs 500 MB to one new destination within an hour, and the test sent 5 MB |
PUT IT IN ORDER
Nyx plans the next emulation, for a rewritten rule. Put her steps in order.
- Check whether the expected alert fired
- Run the emulation at a recorded time
- Record the result, then clean up the test host
- Get written approval for a named test window
- Write the scope: the behavior, the test hosts, and the harmless action
Show the answer
- Write the scope: the behavior, the test hosts, and the harmless action
- Get written approval for a named test window
- Run the emulation at a recorded time
- Check whether the expected alert fired
- Record the result, then clean up the test host
The scope is what gets approved, and nothing runs before approval. The recorded run time is what the alert is checked against. The result goes in the rule's record, where the next test can compare with it.
Tune a noisy rule by narrowing it
The archive- rule works. It fired on the test. It also fired 1,400 times last week on the backup agent, which packs job folders into archives on every host. Counting today's test with last week's alerts gives 1,401. Only the test was the behavior the rule exists for, so its precision is 1 in 1,401, about 0.07 percent.
A rule like that teaches analysts to close its alerts unread. Real archives would be closed with the rest. So the noise has to go, and the question is how.
Tuning means narrowing a rule so it stops matching known harmless activity and still matches the behavior. The safe way is to exclude on facts you have checked. Nyx confirms the agent's path, C:\Program Files\BackupAgent\bkagent.. She confirms the account it runs as, svc-. Sysmon's process event records file hashes but not the signer, so she pins the hash of the vendor's signed release. The exclusion needs all three to match.
Every exclusion also creates a blind spot. Nyx writes this one down: the rule no longer sees the genuine agent, run by its own account. If someone abused that exact binary, this rule would stay silent.
WORKED EXAMPLE
Three ways to quiet the archive rule
- Disable the rule. The 1,400 alerts stop. The rule is now blind to every archive on all 38 hosts, KS-4's included.
- Exclude the agent's folder. The 1,400 alerts stop. Any program placed in
C:\Program Files\BackupAgent\, run by any account, now packs files unseen. - Exclude the signed binary at its path, for its account. The 1,400 alerts stop. Only the genuine agent, run as
svc-, is unseen. Any other program that packs files still raises an alert.backup - Check the result. Nyx reruns the archive emulation after the third option. The rule fires.
Result: All three silence the backup agent. Only the third keeps the rule watching for KS-4, and its blind spot is small enough to write down.
YOUR CALL
Dax and the noisy rule
It is 11:30. The archive rule has fired on the test, and the backup agent is still filling the queue.
Dax says every one of last week's alerts came from the backup agent. What do you do with the rule?
The exclusion is in. Dax asks what else needs doing.
Three weeks later the agent updates, its hash changes, and the alerts return. Dax has an idea.
Strong calls keep the rule, narrow it on checked facts, prove it still fires, and leave a written reason someone can review.
Show the strong calls
- Exclude the backup agent only when its path, its account, and its signed hash all match. The backup alerts stop. A renamed archive tool, run by anyone else, still raises an alert.
- Rerun the emulation, then record the reason, the blind spot, and a review date. The rule fires on the rerun. Anyone who reads the record later knows why the exclusion exists and when to look again.
- Match the vendor's signing certificate with the path and account, instead of the file hash. Updates signed by the vendor stay excluded, and anything unsigned or signed by someone else still alerts. The rule needs the signer in its events, which the endpoint tool can add. Dax's shortcut was the right one.
Keep the rule, its test, and its owner together
A test run once is a snapshot. Rules change, field names change, and agents update. So Nyx keeps each rule as a file in version control. Beside it sit a sample of the event it should match and the result she expects. A pipeline runs every rule against its samples whenever any rule changes. A renamed field fails there, before it reaches the SIEM. Teams call this practice detection as code.
Each rule also gets a record. Palantir's Alerting and Detection Strategy framework is one practitioner model for it. Its sections include blind spots and assumptions, false positives, and validation.
Nyx keeps a shorter record with six fields. Technique and data source say what the rule is for and what it reads. The test says when it last fired on purpose. The exclusion carries its reason. An owner and a review date make sure someone looks again.
A record with an empty test field marks a guess, whatever the rest says.
SPOT THE PROBLEM
Before the rerun, Nyx reads the draft record for the rewritten large-upload rule. Flag the lines that leave it a guess or leave a gap nobody will review.
Show the answers
- Test: none recorded Nobody has seen this rule fire on a known upload. Until someone does, it is a guess.
- Exclusion: any process in C:\Program Files\ (no reason given) A whole folder tree, with no reason and no blind spot written down. Nobody can review it.
- Owner: none A rule nobody owns is a rule nobody reviews or retests.
Lab / 6 records / 3 calls / 9 steps
The next noisy rule
Nyx runs a second tuning practice on a made-up copy of the alert queue. The rule is service-created-remote, already reading the right field, and it has been live on the copy since Monday at 08:00.
The management tool is rolling its helper out to every test host, and Dax wants the queue quiet. Nyx has a harmless emulation to run at 02:14 on Wednesday. Each alert arrives at its own time, and each move you make costs minutes.
Place each alert as a true or false positive. At each call, choose the move that quiets the queue and still lets the rule fire at 02:14.
Verdicts
Read the lab as text, with every path
The test ahead at the start
- The alert at 02:14 on Wednesday: Buried or excluded: no analyst sees it.
Hosts
- mgmt-01: Management server.
- gs-test-01: Test host one.
- gs-test-02: Test host two.
- gs-test-03: Test host three.
- gs-test-04: Test host four.
Verdicts
- True positive: It shows the behavior the rule exists for.
- False positive: It shows harmless activity.
Every best call: quiet queue, rule still fires
- Monday 08:00, gs-test-01 (test host one). Alert: MgmtHelper installed on gs-test-01 by svc-mgmt, from mgmt-01. Program: C:\Program Files\MgmtAgent\helper.exe. Its hash matches the vendor's. Verdict: False positive. The management tool installs its helper on a schedule. The folder, the account and the hash all match what the vendor ships, so this is harmless.
- Monday 09:40, gs-test-01 (test host one). Alert: updsvc installed on gs-test-01 by nyx-test, from gs-test-02. Program: C:\Temp\harmless.exe. Nyx logged this emulation at 09:40. Verdict: True positive. This is the behavior the rule exists for, done on purpose and harmlessly. An emulation that fires the rule is a true positive.
- Monday 13:15, gs-test-03 (test host three). Alert: MgmtHelper installed on gs-test-03 by svc-mgmt, from mgmt-01. One of 212 alerts since 08:00. Same program path and hash as the first. Verdict: False positive. Another run of the same routine install. Nothing differs from the first alert, so the verdict is the same.
- Call at Monday 13:15: Group the 212 by program path, account and hash. The best call. Checked facts are what a safe exclusion is built on. The grouping also shows whether any alert among the 212 differs from the rest. It takes hold at Monday 13:30.
- Monday 16:20, gs-test-04 (test host four). Alert: MgmtHelper installed on gs-test-04 by nyx-test, from gs-test-02. Program: C:\Users\Public\helper.exe, a copy of the vendor's file. Nyx's test. Verdict: True positive. Nyx's second emulation. The file name and the hash match the vendor's, but the folder and the account do not. A name alone does not make an install harmless.
- Call at Monday 16:20: Exclude only the vendor's helper: path, account and hash must all match. The best call. Only the genuine file, run by its own account, from its own folder, is unseen. A copy, a different account or a swapped file still alerts. It takes hold at Monday 17:00.
- Monday 16:50, gs-test-02 (test host two). Alert: MgmtHelper installed on gs-test-02 by svc-mgmt, from mgmt-01. One of 290 alerts since 08:00. Same path, account and hash as the first. It happened 10 minutes before it reached you. Verdict: False positive. The routine install again. Alerts keep arriving while an exclusion is being written and tested, which is why a change takes time to land.
- Call at Monday 17:00: Install a changed helper from the agent's folder as svc-mgmt, and fix any silence. The best call. This tests the blind spot, not just the noise. If the rule stays silent, the exclusion is too wide, and the missing facts go in. Then the record gets why the exclusion exists, what it hides, and the day it is checked next. It takes hold at Monday 17:30.
- Wednesday 02:14, gs-test-04 (test host four). At 02:14 svc-mgmt installs MgmtHelper on gs-test-04 from mgmt-01. The hash is not the vendor's, so no exclusion covers it. The rule alerts. Verdict: True positive. The exclusion matched the genuine file and nothing else, so the swapped file still alerts, and an analyst opens it. The queue is quiet enough for one alert to be read.
- Outcome: Quiet queue, rule still fires. The queue is quiet, and at 02:14 the swapped file raises an alert that an analyst reads. The rule's record holds the exclusion's reason, what it hides, and the day it is checked next.
A different first call, "Leave the queue for Wednesday's review": swapped file unseen
- Monday 08:00, gs-test-01 (test host one). Alert: MgmtHelper installed on gs-test-01 by svc-mgmt, from mgmt-01. Program: C:\Program Files\MgmtAgent\helper.exe. Its hash matches the vendor's. Verdict: False positive. The management tool installs its helper on a schedule. The folder, the account and the hash all match what the vendor ships, so this is harmless.
- Monday 09:40, gs-test-01 (test host one). Alert: updsvc installed on gs-test-01 by nyx-test, from gs-test-02. Program: C:\Temp\harmless.exe. Nyx logged this emulation at 09:40. Verdict: True positive. This is the behavior the rule exists for, done on purpose and harmlessly. An emulation that fires the rule is a true positive.
- Monday 13:15, gs-test-03 (test host three). Alert: MgmtHelper installed on gs-test-03 by svc-mgmt, from mgmt-01. One of 212 alerts since 08:00. Same program path and hash as the first. Verdict: False positive. Another run of the same routine install. Nothing differs from the first alert, so the verdict is the same.
- Call at Monday 13:15: Leave the queue for Wednesday's review. Not the best call. Wednesday's review comes after 02:14. The noise stays, and the exclusion lands too late to matter. It takes hold at Wednesday 09:00.
- Monday 16:20, gs-test-04 (test host four). Alert: MgmtHelper installed on gs-test-04 by nyx-test, from gs-test-02. Program: C:\Users\Public\helper.exe, a copy of the vendor's file. Nyx's test. It happened 40 hours 40 minutes before it reached you. Verdict: True positive. Nyx's second emulation. The file name and the hash match the vendor's, but the folder and the account do not. A name alone does not make an install harmless.
- Call at Wednesday 09:00: Exclude only the vendor's helper: path, account and hash must all match. The best call. Only the genuine file, run by its own account, from its own folder, is unseen. A copy, a different account or a swapped file still alerts. It takes hold at Wednesday 09:40.
- Monday 16:50, gs-test-02 (test host two). Alert: MgmtHelper installed on gs-test-02 by svc-mgmt, from mgmt-01. One of 290 alerts since 08:00. Same path, account and hash as the first. It happened 40 hours 50 minutes before it reached you. Verdict: False positive. The routine install again. Alerts keep arriving while an exclusion is being written and tested, which is why a change takes time to land.
- Call at Wednesday 09:40: Install a changed helper from the agent's folder as svc-mgmt, and fix any silence. The best call. This tests the blind spot, not just the noise. If the rule stays silent, the exclusion is too wide, and the missing facts go in. Then the record gets why the exclusion exists, what it hides, and the day it is checked next. It takes hold at Wednesday 10:10.
- Wednesday 02:14, gs-test-04 (test host four). svc-mgmt installs MgmtHelper on gs-test-04 from mgmt-01. Program: C:\Program Files\MgmtAgent\helper.exe. The hash is not the vendor's. No analyst sees an alert. It happened 7 hours 56 minutes before it reached you. Verdict: True positive. Nyx swapped the vendor's file for her own. The path and the account look routine, so only the hash gives it away. This is the behavior the rule exists for.
- Outcome: Swapped file unseen. At 02:14 a swapped program installs its service and no analyst sees an alert. The queue buried it, or an exclusion hid it. The calls marked not best show which. The rule's record holds the exclusion's reason, what it hides, and the day it is checked next.
A different first call, "Switch the rule off until the rollout ends": rule off by your hand
- Monday 08:00, gs-test-01 (test host one). Alert: MgmtHelper installed on gs-test-01 by svc-mgmt, from mgmt-01. Program: C:\Program Files\MgmtAgent\helper.exe. Its hash matches the vendor's. Verdict: False positive. The management tool installs its helper on a schedule. The folder, the account and the hash all match what the vendor ships, so this is harmless.
- Monday 09:40, gs-test-01 (test host one). Alert: updsvc installed on gs-test-01 by nyx-test, from gs-test-02. Program: C:\Temp\harmless.exe. Nyx logged this emulation at 09:40. Verdict: True positive. This is the behavior the rule exists for, done on purpose and harmlessly. An emulation that fires the rule is a true positive.
- Monday 13:15, gs-test-03 (test host three). Alert: MgmtHelper installed on gs-test-03 by svc-mgmt, from mgmt-01. One of 212 alerts since 08:00. Same program path and hash as the first. Verdict: False positive. Another run of the same routine install. Nothing differs from the first alert, so the verdict is the same.
- Call at Monday 13:15: Switch the rule off until the rollout ends. Not the best call. Every service install on the copy now goes unseen, the swapped file included, and nobody is named to switch it back on.
- Outcome: Rule off by your hand. The queue is quiet because the rule sees nothing. Harmless installs and a swapped file would both pass. A narrow exclusion would have kept the rule watching.
Every choice at each call
After the Monday 13:15 record: 212 alerts since 08:00 look like the first one, and Dax wants the queue quiet. What is your first move?
- Group the 212 by program path, account and hash (15 minutes, the best call). Checked facts are what a safe exclusion is built on. The grouping also shows whether any alert among the 212 differs from the rest.
- Close the 212 as routine without looking (5 minutes). Closing alerts unread is the harm that noise causes. If one of the 212 differed, nobody would find out.
- Switch the rule off until the rollout ends (5 minutes). Every service install on the copy now goes unseen, the swapped file included, and nobody is named to switch it back on.
- Leave the queue for Wednesday's review (until Wednesday 09:00). Wednesday's review comes after 02:14. The noise stays, and the exclusion lands too late to matter.
After the Monday 16:20 record: The harmless alerts share a path, an account and a hash. Nyx's copy in Public also uses the name helper.exe. How do you write the exclusion?
- Exclude only the vendor's helper: path, account and hash must all match (40 minutes, the best call). Only the genuine file, run by its own account, from its own folder, is unseen. A copy, a different account or a swapped file still alerts.
- Exclude any program named helper.exe (20 minutes). The 212 alerts stop. A name is easy to copy, and the copy in Public shows it. Anything called helper.exe now runs unseen.
- Exclude everything in the agent's program folder (20 minutes). The 212 alerts stop. A file someone drops into MgmtAgent, run by any account, would install a service unseen.
- Exclude by path and account, and skip the hash (30 minutes). Closer, but a file swapped into the same folder, run by the same account, still passes. The hash is what ties the exclusion to the vendor's file.
After the Monday 16:50 record: The exclusion is written and the queue is quiet. What do you do before you trust it?
- Install a changed helper from the agent's folder as svc-mgmt, and fix any silence (30 minutes, the best call). This tests the blind spot, not just the noise. If the rule stays silent, the exclusion is too wide, and the missing facts go in. Then the record gets why the exclusion exists, what it hides, and the day it is checked next. In the outcome: The rule's record holds the exclusion's reason, what it hides, and the day it is checked next.
- Close the change: the 212 have stopped (5 minutes). The stop shows the exclusion covers the routine installs. Nobody has sent a changed helper through it to see what it lets past.
- Rerun the first emulation and stop there (20 minutes). That program sits outside the agent's folder, so it fires under almost any exclusion. It cannot show what the exclusion hides.
- Ask Dax to watch the queue overnight (10 minutes). An empty queue overnight looks the same whether the exclusion is right or too wide. Only a test that should alert can tell them apart.
A practice queue runs on a script. Event 7045 holds no hash and no source host, so these alerts are joined with logon and file data first. Real queues hold more kinds of noise, and here each change takes a fixed time. The hosts, counts and times are made up.
CHECK YOUR JUDGMENT
The task-created-cli rule fired on test host gs-test-01 at 09:20. On Wednesday Nyx confirmed that all 38 ground-station hosts now send process events. Dax drafts a line for the board update. Which line can Meridian stand behind?
CASE FILE · CASE 13 · ENTRY 3 OF 5
Answer the closing question correctly to add this entry to your case file.
Two of five fired
Harmless emulations fired only 2 of 5 rules, because one silent rule used a wrong field name and two waited for a burst that one attempt never makes.
Next episode: The rules work on a known test. What if the attacker is already inside?
Review sheet: exam notes and quick reference
Alert A notification that a rule or model wants a human to look at one or more records.
SIEM A capability that collects, parses, stores, and searches security telemetry and often fires alerts.
False positive An alert that did not represent the harmful event the detector was meant to catch.
Precision True positives divided by all positive alerts in a defined, labeled evaluation set: TP / (TP + FP).
Backup A copy of data kept so integrity and availability can be restored after loss, preferably beyond the production identity’s reach.