# Edr Tuning Detection Operations

> Use when running EDR tuning and detection engineering operations on a defended fleet. Covers detection lifecycle management, false positive reduction, alert volume and fidelity measurement, suppression and exclusion governance, MITRE ATT&CK coverage mapping, detection-as-code testing, and tuning validation. Use when the SOC is drowning in noisy EDR alerts, when a detection keeps firing on benign activity, when coverage gaps need closing, or when a new detection must be shipped safely to production.

- Skill: `mizazhaider-ceh/edr-tuning-detection-operations` (Agent Skill)
- Install (CLI): `npx get-skill add mizazhaider-ceh/edr-tuning-detection-operations`
- Raw SKILL.md: https://api.skillmd.com/api/skills/mizazhaider-ceh/edr-tuning-detection-operations/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: mizazhaider-ceh (https://skillmd.com/u/mizazhaider-ceh)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/mizazhaider-ceh/edr-tuning-detection-operations

---


EDR basics get the sensor on the host. This skill is what comes
after: keeping detections sharp month after month. A detection that
fires 500 times a day on benign admin work is not protecting anyone,
it is training analysts to ignore alerts. Tuning is the disciplined
work of measuring that noise, fixing the rule or the data, proving
the fix with a test, and recording why the change was made. This
skill is for fleets you own or are authorized to defend, and every
suppression here is scoped, expiring, and reviewed, never a blanket
blind spot.

## Quick Workflow

1. Measure before tuning: alert volume, true positive rate, and
   time to triage per detection over the last 30 days.
2. Rank the noise: the top 10 detections by volume and by
   false positive rate go first, not the loudest complaint.
3. Diagnose the cause: bad logic, missing context, benign process
   not excluded, or telemetry that cannot distinguish the cases.
4. Fix at the right layer: improve the rule first, enrich the
   data second, suppress narrowly only as a last resort.
5. Test the change against historical true positives and a
   benign replay set before it ships.
6. Ship in stages: a pilot group, then the fleet, watching volume
   and true positive retention at each stage.
7. Record the change: rule, reason, scope, expiry, owner, and the
   test evidence, in the detection registry.
8. Re-measure after 14 days and roll back any change that lost
   true positives or failed to cut noise.

## 1. Measuring detection health

Do not tune on anecdotes. Pull per-rule numbers first, then decide.
A rule with 1,000 alerts and 2 true positives is a tuning candidate
even if nobody complained about it. A rule with 5 alerts and 5 true
positives is precious, leave it alone.

```spl
index=edr earliest=-30d@d
| stats count AS alerts,
    sum(eval(if(verdict="true_positive", 1, 0))) AS true_positives,
    avg(triage_minutes) AS avg_triage_minutes
    BY rule_name
| eval false_positive_rate = round(100 * (1 - true_positives / alerts), 1)
| eval wasted_hours = round(alerts * avg_triage_minutes / 60, 1)
| sort - alerts
| head 20
```

Track these four numbers per rule, every month: alert volume,
false positive rate, true positives retained, and mean time to
triage. A tuning change must improve at least one without making
another worse. If volume falls but true positives fall with it,
the change was a cut, not a tune, and it gets reverted.

```python
# detection_health.py - score every rule from an alert export (CSV)
# Columns expected: rule_name, verdict, triage_minutes
import csv
from collections import defaultdict

stats = defaultdict(lambda: {"alerts": 0, "tp": 0, "minutes": 0.0})
with open("alerts_30d.csv", newline="") as fh:
    for row in csv.DictReader(fh):
        s = stats[row["rule_name"]]
        s["alerts"] += 1
        s["minutes"] += float(row["triage_minutes"] or 0)
        if row["verdict"] == "true_positive":
            s["tp"] += 1

print(f"{'rule':<40} {'alerts':>7} {'fp_rate':>8} {'wasted_h':>9}")
for rule, s in sorted(stats.items(), key=lambda kv: -kv[1]["alerts"])[:20]:
    fp = 100 * (1 - s["tp"] / s["alerts"]) if s["alerts"] else 0
    print(f"{rule:<40} {s['alerts']:>7} {fp:>7.1f}% {s['minutes']/60:>9.1f}")
```

## 2. Tuning at the right layer

Work through the layers in order. Most noise is fixed at layer 1
or 2, and jumping straight to suppression is how coverage dies.

Layer 1, rule logic: add a distinguishing condition the benign
activity lacks, such as a parent process, a command line argument,
or a file path pattern. Layer 2, data enrichment: join in asset
context (is this host a build server where compilers are normal?)
so the rule can tell admin work from attacker work. Layer 3,
scoped suppression: exclude one exact process path plus one
signer, on one host group, with an expiry date. Never suppress
by rule name alone, never suppress fleet-wide, and never suppress
without an expiry.

```yaml
# Example: a scoped, expiring suppression, not a blanket exclusion.
# This shape is the minimum record for any suppression in the registry.
title: Suppress signed backup agent spawning compression tool
rule_name: suspicious_child_of_backup_service
reason: Vendor backup agent legitimately spawns 7z on backup hosts nightly
scope:
  process_path: C:\Program Files\BackupVendor\agent.exe
  signer: BackupVendor Inc.
  host_group: backup-servers
  condition: parent_process_is_backup_agent AND time_between_01_and_04
expires: 2027-01-27
owner: detection-engineering
reviewed_by: soc-lead
compensating_control: Backup host file writes still alert via separate rule
```

```yaml
# Example: a Sigma-style detection with a distinguishing condition.
# The benign case (admin script) and the attacker case differ on the
# grandparent process, so the rule keys on that instead of the child.
title: LSASS access from an unusual parent
logsource:
  product: windows
  service: sysmon
detection:
  selection:
    EventID: 10
    TargetImage|endswith: '\lsass.exe'
  filter_admin_tool:
    SourceImage|endswith: '\approved-admin-tool.exe'
    GrantedAccess: '0x1010'
  condition: selection and not filter_admin_tool
level: high
tags:
  - attack.credential_access
  - attack.t1003.001
```

## 3. Detection-as-code pipeline

Detections live in version control, not in a console someone
clicked through. Every rule gets a test: a set of historical true
positive events it must still catch, and a set of benign events
it must not fire on. A change that fails either test does not
ship, no matter how urgent the noise complaint feels.

```bash
# Test a changed rule before shipping it: true positives must be
# retained and the benign replay set must stay quiet.
# Directory layout: detections/<rule>.yml, tests/<rule>_tp.jsonl,
# tests/<rule>_benign.jsonl (one event per line, Sigma test format).

python3 -m pytest tests/test_detections.py -k lsass_access -q

# Promote only on a green test run, and tag the release so a bad
# change can be rolled back to a known good rule set in one step.
git add detections/lsass_access.yml
git commit -m "Tune lsass_access: exclude approved admin tool, keep TP set green"
git tag detections-2026-10-27
```

Ship in stages: pilot on 5 percent of hosts for 48 hours, then
25 percent, then the fleet. At each stage compare alert volume
and true positives against the pre-change baseline. A staged
rollout turns a bad tune into a small incident instead of a
fleet-wide blind spot.

## 4. Coverage mapping

Map every production detection to MITRE ATT&CK techniques, then
look at what is uncovered, not just what is covered. The gaps
that matter are the techniques your threat model says attackers
actually use against you, in the order they appear in real
intrusions: initial access, persistence, credential access,
lateral movement. A technique with no detection and no compensating
log source is a decision to accept blindness, and it should be
recorded as such, with an owner and a date to revisit it.

```python
# coverage.py - report ATT&CK techniques with no production detection.
# Input: detections.csv with columns rule_name, technique, status.
import csv
from collections import defaultdict

covered = defaultdict(list)
with open("detections.csv", newline="") as fh:
    for row in csv.DictReader(fh):
        if row["status"] == "production":
            covered[row["technique"]].append(row["rule_name"])

priority = ["T1566", "T1059", "T1055", "T1003", "T1021", "T1078", "T1562"]
print("Techniques with no production detection:")
for tech in priority:
    if tech not in covered:
        print(f"  GAP: {tech} - no production rule, record as accepted risk or build one")
    else:
        print(f"  OK:  {tech} - {len(covered[tech])} rule(s)")
```

## Edge cases

- A rule that never fires: it may be broken, not quiet. Test it
  with a synthetic event every quarter, or it is decoration.
- Suppression requests from application owners: require the exact
  process path and signer, plus a compensating control, before
  approving. A request that says "exclude our app" is denied until
  it is specific.
- Tuning during an active incident: freeze non-essential tuning.
  A rule change mid-incident can destroy the timeline and hide
  attacker activity behind a fresh suppression.
- EDR tamper alerts: never tune these down. If the sensor is
  being disabled, that is the incident, not noise.
- Shared infrastructure (build servers, jump hosts): benign
  activity there looks exactly like attacker activity elsewhere.
  Tune by host group, not by rewriting the rule for everyone.
- Alert fatigue metrics that look good because analysts stopped
  triaging: measure triage rate alongside volume, so a quiet
  queue cannot hide an untriaged backlog.

## Key references

- MITRE ATT&CK coverage mapping: https://attack.mitre.org/
- Sigma rule format and testing: https://github.com/SigmaHQ/sigma
- MITRE ATT&CK T1003.001 (LSASS Memory), T1055 (Process Injection),
  T1562.001 (Impair Defenses - Disable or Modify Tools).
- Sysmon configuration reference: https://learn.microsoft.com/en-us/sysinternals/downloads/sysmon
- Detection engineering practice: measure, test, stage, record,
  re-measure, and never suppress without scope and expiry.

