Detection Rule Tuning and Testing

By Ambuj Kumar, CEO

Part of AI Detection Engineering: How AI Tunes and Writes Detection Rules, which gives a short answer to every question in the guide.

How do you prioritize which detections to build next?

Prioritize which detections to build next by working in dependency order: missing telemetry first, misconfigured controls second, and missing rules last. A rule written on a log source you don't collect will never fire, so the most urgent-looking backlog item is often blocked by something underneath it.

Typical configuration gaps are custom rules that exist but sit disabled, or DNS (Domain Name System) filtering on the firewall that alerts only on threat-intelligence matches. The Gaps view in the AI Detection Engineering Agent lists work in this same order (telemetry gaps, then configuration gaps, then detection gaps). It does not rank the rules it suggests by severity, so the order inside the detection layer is the team's call, and each suggested rule is a candidate until a human approves it.

Before anyone starts a new rule, search the rule set for the technique, since widening a rule that half-covers it costs less than writing one from nothing. Then rank what is left. Most teams weigh techniques seen in their own incidents and hunts, techniques a pentest got through without raising an alert, and techniques used by the groups that target their industry.

How are detection teams validating rules against recent production telemetry before deployment?

Most detection rule validation before deployment is a backtest: the team runs the candidate query over a recent window of logs already stored in the SIEM (security information and event management) system and reads what the rule would have matched.

The match count per day is the alert volume analysts would inherit. Group the matches by the fields an analyst will triage on, such as host, account, and parent process. If one service account produces most of the hits, that exclusion gets decided before deployment. Zero matches needs a second look. Confirm the fields the query references are populated in that log source, because in SPL (Search Processing Language) and other search-style languages a renamed field returns nothing and reads like a clean rule.

A few hours of data won't include the weekend jobs or the month-end run, and a long window over a high-volume source such as process-creation or DNS (Domain Name System) logs burns query compute in SIEMs that bill for it. A rule written by the AI Detection Engineering Agent is backtested against the customer's own SIEM history while it is still a candidate, before a human is asked to approve it. The default window is short and cost-safe, and the engineer can extend it.

Whether the rule fires on a real attack is a separate replay check, covered in our guide to detection as code.

Does a backtest replace testing with simulated attacks?

No. Detection backtesting measures how often a rule would have fired on your real log history, and a simulated attack proves the rule fires when the technique is run. Unless an attacker used the technique inside the backtest window, there is nothing malicious in the data to match, so zero hits only tells you the rule is quiet. A rule that matches on the wrong value passes a backtest every time.

To see whether the rule fires, run the technique on a test host, by hand or with Atomic Red Team (an open-source library of attack tests mapped to MITRE ATT&CK, the public catalog of attacker techniques). Send the test events to the SIEM (security information and event management) system through the same pipeline and parser as production logs. A lab has none of the admin scripts, backup software, and deployment tools that cause false positives, so teams run both tests before approval.

How often should detection rules be tuned?

Rule tuning should run on a cadence each team sets from its alert volume, from a review pass every few hours in a SOC (security operations center) with a heavy queue to a weekly pass in a team with a light one. A pass is a review of what is new since the last one (new alerts, new closures, new hosts, and new accounts), and it doesn't have to end in a rule change. The once-a-quarter clean-up works poorly, since a noisy rule costs analyst hours on every shift until someone gets to it.

Some changes should trigger a pass on the day they happen, whatever the calendar says: a new application rollout, an EDR (endpoint detection and response) sensor upgrade, a change to a log schema, or a rule whose daily alert count jumps overnight. And if the same rule gets closed as benign for the same reason several shifts in a row, it's due.

Review the rules that produce nothing as well. Roughly 20% of SOC detection rules stop firing within six months (Simbian, 2026), and a review sorted by alert count never reaches them. Sort by last-fired date too, and for each silent rule check whether its log source still arrives and its fields still exist.

How should organizations decide whether to tune or disable a detection?

Organizations should tune a detection when the behavior it looks for still matters in their environment and rule tuning can remove the noise without removing the true positives, and disable it when the rule can no longer do its job.

Tuning fits when the telemetry is arriving and the false positives share a cause you can name, such as one software deployment tool or one admin group. A rule can't do its job when the log source was retired, the product it watched is gone, or a newer rule covers the same behavior with better fields.

Record the decision on the rule itself, including a decision to leave it alone. Rule history in the AI Detection Engineering Agent keeps each change as a version entry with who changed it and why, and logs "no safe tuning found" when the Agent can't find a safe change. A change it does suggest is a candidate until a human approves it.

Some rules matter and can't be narrowed, because benign and malicious activity look the same in the fields available. Disabling one leaves the technique uncovered. It can be dropped to a lower severity, kept as a scheduled hunt query outside the paging path, or used as one signal in a correlation rule that needs a second event before it alerts.

How can security teams reduce false positives without missing real threats?

To get false positive reduction without missing real threats, narrow one detection rule at a time and test each change against past logs in the SIEM (security information and event management) system before it goes live. The danger is an exclusion that quiets a noisy rule and also hides the attack the rule was written to catch.

Start with the per-rule count of alerts that analysts closed as benign. Then ask why each one fires. The cause is typically a known service account, a scheduled job such as a nightly batch run, a vulnerability scanner, or an admin tool that behaves the way an attacker would.

An exclusion scoped to one account on one host under one parent process is the safer kind, since an exclusion on the account alone also covers an attacker who is using that account. The AI Detection Engineering Agent tunes rules on a cadence the team sets, and a human approves each change before it reaches the SIEM.

Before deploying, run the old and new versions over the same window of past logs (a backtest). If the new version no longer fires on the activity behind alerts that were confirmed as true positives, where the window contains them, the change isn't safe.

Re-run it against logs from a known attack too, such as a pentest run, and check it still fires.

What do teams get wrong when they move detections from testing into production?

The most common mistake when moving detections from testing into production is treating the move as a copy-paste, with no approval step, no record of what changed, and no quick way back.

A query that passed in a development workspace can return nothing in production because the index or table name differs, so run the deployed rule against a known test event in production. Schedules break rules too. A rule that runs every hour with a five-minute lookback is blind for most of that hour, and a lookback shorter than the ingestion delay of the log source misses events that arrive late. A new rule that goes live at full severity and pages the on-call analyst tends to get disabled before anyone tunes it, so many teams run a new rule quietly at first and read what it produces.

A workable promotion path treats each new rule as a candidate until a named person approves it. The approved version is pushed by automation, so the text that was reviewed and the text that runs are the same. The previous version stays available for rollback. An audit trail records who approved the rule and when it deployed.

What happens to detections during a SIEM migration?

During a SIEM migration, detections don't carry over: each rule has to be rewritten in the new SIEM (security information and event management) system's query language and mapped to its field names, and any rule left behind stops running at cutover.

SPL (Search Processing Language) in Splunk doesn't convert line for line into KQL (Kusto Query Language) in Microsoft Sentinel, and conversion tools usually handle a simple field match better than a join, a lookup, or a statistical threshold. A rule also depends on things outside its own text. Allowlists and exclusions often live in lookup tables, and thresholds were calibrated on the old system's data volume.

Take inventory before translating anything, and drop rules that never fire, duplicates, and rules on retired log sources.

Run both systems in parallel for a while. A rule that fired in the old SIEM and is silent in the new one usually has a field mapping problem, and comparing alert counts per rule is how it gets found.

How long should it take my SOC to have a detection in production after a new attack technique goes public?

No single figure fits every SOC (security operations center): the time from a new attack technique going public to a detection in production is the sum of five steps, and the telemetry and adaptation steps usually take longest.

  • Relevance: check whether you run the affected product, version, or configuration. If you don't, record that and stop.
  • Telemetry: confirm the log source that would show the technique is collected from the affected hosts, with the fields the rule needs, such as command-line arguments on process-creation events.
  • Adaptation: the rule published with an advisory is written for nobody's environment. Rewrite it for your SIEM (security information and event management) system, your field names, and your known-benign activity.
  • Testing: backtest the rule for noise and, where a proof of concept is public, run it in a lab to confirm the rule fires.
  • Approval: a named reviewer approves the rule, and it deploys with a rollback path.

Relevance and telemetry go much faster for a team with an asset inventory and a map of which log sources cover which hosts. Then look backward through the logs. If the technique was in use before it went public, run the query across retained logs as well, since a rule deployed today only sees events from today onward.

Which ATT&CK techniques can I not detect because of the logs I am not collecting?

To find the ATT&CK techniques you can't detect, check log source coverage: list the data each technique needs, then compare that list with what your SIEM (security information and event management) system receives. MITRE ATT&CK, the public catalog of attacker techniques, describes for each technique the kind of data that reveals it.

Windows Security event ID 4688 records process creation but includes the command line only when the policy named Include command line in process creation events is turned on. Without it, command-line rules for PowerShell abuse (T1059.001) have nothing to match. Script block logging is often off. Servers and Linux hosts frequently have no EDR (endpoint detection and response) sensor, and cloud audit logs such as AWS CloudTrail are sometimes enabled but never forwarded.

Check coverage per host too, by comparing the hosts reporting each log source against the asset inventory or the sign-in logs. A laptop that authenticates every day and has no EDR sensor reporting is a gap for every endpoint technique. Mark every technique whose data never arrives as blind on the coverage map before counting any rule mapped to it.

Sign up for Simbian's Newsletter

By submitting this form, you agree to our Privacy Policy.

Ask AI about Simbian