TExcelTAD
Home › Defensive Security: SOC, SIEM, Detection Engineering & Threat Hunting › SOC Metrics: MTTD, MTTR, Dwell Time and Their Pitfalls

SOC Metrics: MTTD, MTTR, Dwell Time and Their Pitfalls

Every SOC report has a slide with "mean time to detect" and "mean time to respond", and most of those numbers are either misleading or measure the wrong thing. Metrics still matter: they are how a SOC shows it is improving and where it is not. This lesson defines the common time metrics precisely, computes them on a synthetic quarter of incidents in pandas, and shows the four ways they lie.

The timeline of one incident

Every metric is a difference between two timestamps on the same timeline:

Timestamp Meaning Where it comes from
t_start first malicious activity (initial access) only known after investigation, often an estimate
t_detect first alert or report that led to the incident SIEM / EDR / user report
t_ack an analyst started working on it case management system
t_contain the attacker can no longer act (host isolated, account disabled) case notes
t_resolve eradicated, recovered, case closed case management system

From these:

  • Dwell time = t_detect − t_start for one incident (some reports measure to containment instead; say which).
  • MTTD (mean time to detect) = the average dwell time over incidents.
  • MTTA (mean time to acknowledge) = average of t_ack − t_detect: how long alerts wait in the queue.
  • MTTC (mean time to contain) = average of t_contain − t_detect.
  • MTTR (mean time to respond, or to resolve or recover; vendors disagree) = average of t_resolve − t_detect. Always define the R.

Other useful metrics are not times: the false-positive rate per rule, the share of incidents found by the SOC rather than by a third party, the ATT&CK coverage of the rule set (Coverage Mapping), and the share of log sources healthy.

A quarter of incidents

python · try it yourself
import pandas as pd

rows = [  # synthetic incidents; times in hours from an arbitrary origin, "source" = who found it
    ("INC-01", "phishing",      0.0,    0.5,    0.7,   2.0,   20, "SOC rule"),
    ("INC-02", "brute force",  10.0,   10.2,   10.3,  10.5,   12, "SOC rule"),
    ("INC-03", "malware",      30.0,   31.0,   33.0,  34.0,   60, "EDR"),
    ("INC-04", "phishing",     50.0,   50.4,   50.5,  51.0,   54, "user report"),
    ("INC-05", "web exploit",  60.0,  130.0,  131.0, 133.0,  200, "SOC hunt"),
    ("INC-06", "brute force",  90.0,   90.1,   90.2,  90.3,   95, "SOC rule"),
    ("INC-07", "malware",     100.0,  100.3,  104.0, 105.0,  130, "EDR"),
    ("INC-08", "insider",     120.0, 1560.0, 1561.0, 1562.0, 1700, "external notification"),
    ("INC-09", "phishing",    200.0,  200.6,  200.7, 201.0,  205, "SOC rule"),
    ("INC-10", "malware",     220.0,  221.0,  221.2, 222.0,  260, "EDR"),
    ("INC-11", "brute force", 300.0,  300.2,  309.0, 309.5,  312, "SOC rule"),
    ("INC-12", "phishing",    310.0,  310.3,  310.4, 311.0,  315, "user report"),
]
inc = pd.DataFrame(rows, columns=["id", "kind", "t_start", "t_detect", "t_ack", "t_contain", "t_resolve", "found_by"])
m = pd.DataFrame({
    "dwell": inc.t_detect - inc.t_start,
    "ack": inc.t_ack - inc.t_detect,
    "contain": inc.t_contain - inc.t_detect,
    "resolve": inc.t_resolve - inc.t_detect,
})
summary = pd.DataFrame({"mean": m.mean(), "median": m.median(), "p90": m.quantile(0.9)}).round(1)
print("hours, 12 incidents\n", summary.to_string(), sep="")

print("\nwithout INC-08 (one insider case found by an outsider after 60 days):")
print((m.drop(index=7).mean()).round(1).to_string())

print("\nfound by:", inc.found_by.value_counts().to_dict())
inc["dwell"] = m.dwell
print("\nmedian dwell by kind (h):", inc.groupby("kind").dwell.median().round(1).to_dict())
hours, 12 incidents
          mean  median   p90
dwell    126.2     0.4  63.1
ack        1.4     0.2   3.5
contain    2.2     1.2   4.5
resolve   29.9    15.7  66.9

without INC-08 (one insider case found by an outsider after 60 days):
dwell       6.8
ack         1.5
contain     2.2
resolve    19.9

found by: {'SOC rule': 5, 'EDR': 3, 'user report': 2, 'SOC hunt': 1, 'external notification': 1}

median dwell by kind (h): {'brute force': 0.2, 'insider': 1440.0, 'malware': 1.0, 'phishing': 0.4, 'web exploit': 70.0}

Read the table before trusting any one number:

  • The mean is dominated by one case. INC-08 alone moves the mean dwell time from 6.8 hours to 126 hours (more than five days), while the median stays at 0.4 hours. The median and a high percentile (p90) describe the typical case and the bad tail separately; report both.
  • MTTA hides queue problems. The median wait is small, but INC-03, INC-07 and INC-11 waited 2 to 9 hours. In INC-11, a brute force detected in 12 minutes then waited almost 9 hours for an analyst: the detection was fast, the SOC was not.
  • Who found it is a metric in itself. An incident found by an external notification is a detection failure, whatever its MTTR.

The four ways time metrics lie

  1. Survivorship. MTTD is computed over the incidents you found. The intrusions you never detected have infinite dwell time and are not in the average. A falling MTTD can mean you got faster, or that you stopped finding the slow, quiet ones. Pair it with hunting results and purple-team tests, where the start time is known because you ran the test.
  2. t_start is a guess. Dwell time depends on how far back the investigation looked. Shallow investigations give short dwell times. Record how t_start was established (log evidence, estimate, unknown).
  3. Definitions drift. "Respond" means acknowledge in one team and resolve in another; "detect" may be the alert or the analyst's confirmation. Write the definitions down and never compare across organisations without them.
  4. Goodhart's law. When a measure becomes a target, people optimise the measure. Reward short MTTR and analysts will close cases early; reward few false positives and engineers will delete noisy but useful rules. Use time metrics to find problems, not to rank people.

How metric problems are detected and fixed

Symptom in the data Likely cause Fix
Mean far above median A few long cases Report median and p90; review the long cases individually
Many incidents found by third parties Detection gaps Coverage mapping; hunts on those techniques
MTTA spikes at night or weekends Staffing Shift coverage, MDR for off-hours, auto-enrichment
MTTD drops while hunts find more old intrusions Survivorship Track hunt findings and their dwell separately
Cases closed minutes before an SLA Gaming the target Sample closed cases for quality; drop individual targets

Pitfalls

  • Averaging across incident types. A phishing click and an insider case have nothing in common; report per kind (the last line of the program).
  • Mixing clock sources. Case-system times in local time and SIEM times in UTC produce negative MTTAs; normalise first (Time Sync and Time Zones).
  • Too few incidents. With twelve incidents, one changes everything. Show counts next to every metric.

Practice

1. Compute the median time to contain for the brute-force incidents only.

INC-02: 10.5 − 10.2 = 0.3 h; INC-06: 90.3 − 90.1 = 0.2 h; INC-11: 309.5 − 300.2 = 9.3 h. Median = 0.3 h. The mean (3.3 h) is pulled up by INC-11's queue wait.

2. Your MTTD fell from 30 h to 6 h this year. List two checks before you celebrate.

(1) Did the number of incidents found by external parties or by hunting change? If hunts keep finding old intrusions, the drop may be survivorship. (2) Did the definition of t_start or t_detect change, or did investigations become shallower? Compare the median as well as the mean, and per incident type.

3. Add a column "found_by_soc" (True for SOC rule, SOC hunt and EDR) and compute its share.

inc["found_by_soc"] = inc.found_by.isin(["SOC rule", "SOC hunt", "EDR"]) and inc.found_by_soc.mean(): 9 of 12 = 75 %. Two were user reports (a healthy sign: users report) and one an external notification.

Test yourself

Why does the program report the median and p90 next to the mean?

  1. Because the mean is always wrong
  2. One long incident (INC-08) dominates the mean; median and p90 describe the typical case and the tail
  3. pandas cannot compute the mean
  4. The p90 is required by law

What is the survivorship problem of MTTD?

  1. It only counts incidents that were detected, so undetected intrusions never enter the average
  2. It counts incidents twice
  3. It uses the wrong time zone
  4. It ignores phishing

In INC-11 the brute force was detected 0.2 h after it started but contained 9.3 h after detection. What does this point to?

  1. A detection gap
  2. A queue or staffing problem: the alert waited for an analyst
  3. A bad rule
  4. Clock drift

What does Goodhart's law predict when analysts are rewarded for short MTTR?

  1. Better security
  2. Cases closed early to meet the target
  3. Longer dwell times only
  4. No effect