Find your next article

Search article titles and content.

← All articles

How to validate a detection rule before production

Criteria for measuring a detection's usefulness, noise, and coverage without confusing alerts with protection.

#detection#SIEM#telemetry#Blue Team
A sieve separates metal fragments from a single blue marker on a dark workbench
HACKTHESHIELD / BLUE TEAM
In this article

A rule that fires in a controlled test is not yet ready for production. It must find relevant behavior, operate on reliable data, and generate alerts a team can investigate.

This article addresses the space between “the rule worked in my test” and “the rule improves the organization’s detection capability” — two very different things.

Define the detectable hypothesis

Describe the behavior the rule intends to observe, the environment where it occurs, and the required telemetry fields.

Distinguish the technique from the indicator used in the test. This distinction determines the rule’s useful life:

LevelExampleEvasion cost
Specific valueA file hashRecompile — seconds
ToolAn executable nameRename — seconds
Behavioral patternOffice process spawning a shell child processChange the technique — high

Rules at the first level have value, but age within days. If detection depends on a single process name or address, its coverage is narrow — and the coverage report it produces is too optimistic.

Specify known limits as well: sources without collection, lost events, ingestion delay, and out-of-scope systems. These limits are part of the rule’s real capability. A detection covering 40% of the fleet and reported as complete coverage is worse than none, because it creates unjustified confidence.

Prepare positive and negative cases

Build authorized examples that should trigger and similar legitimate examples that should not generate an incident.

Negative cases are where the real work happens, and the list must be specific to your environment:

  • the administration tool doing exactly what the rule looks for;
  • backup software reading entire volumes;
  • the authorized vulnerability scanner;
  • the deployment window when scripts execute in bulk;
  • the development environment, where almost everything is atypical.

Run cases in a controlled environment and record the raw events, not just the rule result. Check whether it uses the fields you expected and whether differences between systems change the result — field names, time formats, and logging detail vary across platforms and versions.

A positive test answers “can it detect this case?” Negative cases answer “how often will it interrupt the team unnecessarily?” Neither question is sufficient alone.

Measure operational cost before publishing

One practice prevents most problems: run the logic retrospectively against historical data before publishing. Thirty days of history answer, without operational cost, how many alerts the rule would have generated — and how many would have been legitimate activity.

The calculation that determines publication:

alerts per day × average triage time = team hours per day

A rule generating 40 alerts daily at 10 minutes each consumes almost 7 analyst hours per day. If the expected true positive rate is low, this rule does not improve detection: it consumes capacity other detections would need.

Also observe volume, duplicates, and time to alert. An overly sensitive rule may produce so many alerts that important signals go unanalyzed — the most common and least discussed failure mode in detection operations. Before creating broad exceptions, understand which legitimate patterns generate noise: a poorly designed exception is a permanent coverage hole.

Prefer reducing noise through logic over exceptions. Requiring two correlated conditions often cuts false positives without opening an exception an adversary could occupy.

Write the alert for someone receiving it at 3 a.m.

Prioritize useful enrichment: asset identification, account role, related actions, and access to original events. An alert should support the analyst’s first decision.

An actionable alert contains:

  1. What happened, in one sentence without internal jargon.
  2. Why it matters — the hypothesis motivating the rule.
  3. Asset and account context — criticality, owner, privilege.
  4. The first three suggested verification steps.
  5. A link to raw events, without making the analyst reconstruct the query.
  6. What this is not — the known false positive and how to rule it out.

Item 6 is the most neglected and saves the most time. If the team already knows the rule fires during a maintenance window, writing that in the alert prevents the same investigation from being repeated dozens of times.

An alert saying only “suspicious activity detected on host X” transfers all contextual work to the on-call person — precisely the person with the least time and information to reconstruct it.

Treat the rule as a product

Every rule needs an owner, purpose, data source, test cases, and scheduled review. Version the logic and record the reasons for changes — the question “why does this condition exist?” appears months later, and without an answer nobody dares change it.

Triggers requiring reassessment:

  • a field renamed or a format changed by the vendor;
  • a new telemetry source changing coverage;
  • an operational process change creating a new false positive;
  • a system update altering observed behavior;
  • the technique covered by the rule falling out of use.

A detection must also be able to be retired. Rules retained solely because they exist consume triage and create an illusion of coverage.

Measure the health of the whole set, beyond each rule:

MetricWhat it reveals
Proportion of alerts becoming investigationsSignal quality
Alerts closed as false positivesTuning candidates
Rules that never fired in 90 daysMissing telemetry or broken logic
Time from event to alertIngestion delay
Coverage by ATT&CK tacticStructural gaps

The third row deserves attention. A rule that never fires may mean the behavior does not occur — or that its data source stopped arriving two months ago and nobody noticed. Silence is not evidence of security; monitoring telemetry arrival is as important as monitoring its contents.

Beware of what coverage maps do not tell you

Mapping detections against ATT&CK tactics is useful and has become common practice. It is also the most efficient source of false confidence in a detection operation.

Three traps when reading a coverage map:

A technique marked as covered by a weak rule. If the rule uses an executable name, the column turns green and evasion costs one mv. The map does not distinguish behavioral detection from string matching.

A technique with many procedures and one rule. An ATT&CK technique can be executed in dozens of distinct ways. Covering one colors the whole cell — and the colored cell is what leadership sees.

Coverage that exists where telemetry is easy. Teams tend to write rules for sources they already collect. The map then reflects the distribution of available telemetry rather than the environment’s actual risk.

A more honest reading records three things per technique: the required data source, whether it is collected across the entire fleet, and the level at which the rule operates — specific value, tool, or behavior. The result is less colorful and far more useful for deciding the next investment.

When the gap is telemetry, writing more rules does not solve it. No logic compensates for an event that was never collected — and this is the most common reason a “ready” detection fails to trigger in production.

Document the rule so it can outlive you

Minimum detection documentation fits on one page and answers what an on-call analyst or successor will need:

FieldContent
HypothesisThe behavior the rule intends to find
Related techniqueATT&CK reference, when applicable
Data sourcesWhich events, from which systems
CoverageWhere in the fleet the source actually exists
Positive casesAuthorized examples that should trigger
Known false positivesWhat has been observed and how to rule it out
Active exceptionsEach with a reason and review date
Owner and reviewWho is responsible and when to reassess

The exceptions field ages worst. Exceptions are added to solve temporary noise, nobody removes them, and after a year the rule has more exclusions than logic. Recording a reason and review date for each turns a temporary decision into something someone will actually reassess.

Review after publishing

Follow the results in production. After each investigation, ask whether the alert provided enough context for the first decision. If it did not, prefer enriching the event, clarifying the hypothesis, or improving documentation before broadening exceptions.

The aim is not to maximize alert count. It is to increase the chance of recognizing relevant activity in time to act. A useful detection reduces uncertainty for the person on call.

Next step

Choose a rule already in production and answer three questions about it: how many alerts it generated last month, how many became real investigations, and when its data source was last checked. If any answer is unavailable, that is the gap to resolve before writing the next rule.

Validate detections only in environments you own, labs, or with explicit authorization for the test.

References

End of articleNext recommended article ↗
FOLLOW THE BLOG

Get new articles via RSS.

No sign-up or tracking: follow new posts in your preferred reader.

Subscribe via RSS