Test it, tune it, keep it honest

Unit 5 of 5 in Logging and detection.

You will be able to measure a rule's noise, tune it, and test that it still fires.

Lesson

Every rule has two ways to be wrong

A rule can fire when nothing bad happened, a false positive, or stay silent when something bad did, a false negative. NIST's guide notes that security software often generates false positives when looking for malicious activity. Too many false positives and analysts stop trusting the alerts; too many false negatives and the rule gives false comfort.

You cannot drive both to zero. Tuning is choosing a balance you can defend.

Measure instead of arguing

Track, for each rule, how many times it fired and how many of those were real. That gives its precision. A rule with low precision should be fixed or retired, because its noise hides the alerts that matter. The Sigma format helps: its falsepositives field records the harmless events you expect, and those become the exclusions you test.

Tune by making a rule more specific, for example by excluding one known good program, not by raising a threshold until nothing fires. Record every change and why.

Test that it still fires

A rule that never fires might mean there are no attacks, or that a log source broke, a field was renamed or the rule is wrong. The only way to know is to create the behaviour safely, on a machine you own, and check that the alert appears. This practice is called validating detections.

ATT&CK's guidance applies here too: prioritise the techniques that are relevant to you, test those thoroughly, and do not treat one passed test as proof that the technique is covered in every form.

Keep a small, healthy set

Review rules on a schedule: retire the noisy, repair the broken, and add rules where an incident or a replay showed a gap. A short list of rules that analysts trust beats a long list they ignore.

Key points

Sources

Practice in the labs

Measure noise, trim it without losing a detection, and test with safe simulated behaviour.

Also try, in the simulators

Knowledge check

  1. What is a false negative? Answer: A rule stays silent when something bad happened. False negatives give false comfort; false positives are alerts on harmless activity.
  2. A rule has not fired for six months. What should you do? Answer: Test it by safely creating the behaviour, and check the log source. Silence can mean no attack or a broken source or rule; a safe test is the only way to tell.
  3. What is a good way to tune a noisy rule? Answer: Add a specific exclusion for a known harmless pattern and record why. Specific, recorded exclusions keep the detection alive; blanket suppression produces a rule that cannot fire.

Back to the syllabus or see all classes.

Related