Base rates and the precision of security alerts
A detector that catches 95% of attacks with a 2% false-alarm rate appears excellent. When attacks are rare, however, more than nine alerts in ten are false. A Sankey diagram of ten thousand events and a log-odds waterfall illustrate Bayes' rule in this setting.
Consider a detector that catches 95% of real attacks and fires on only 2% of benign events. When an alert fires, what is the probability of an actual attack?
A common intuitive answer is about 95%. For a realistic base rate, the correct answer is below 10%. This is the base-rate fallacy, one of the best-documented errors in human reasoning, and a major reason why security operations centres receive so many false alerts. The calculation is Bayes' rule, which is easier to interpret when presented as a flow of events than as a formula.
Kahneman and Tversky (1973) showed that people judging probabilities largely ignore base rates when given vivid, specific evidence, and Bar-Hillel (1980) mapped when the fallacy appears and when it disappears. Gigerenzer and Hoffrage (1995) identified an effective remedy: present the problem in natural frequencies ("of 10,000 events, 20 are attacks; of those, 19 raise an alert...") instead of percentages, which substantially increases the share of correct answers. In security, Axelsson (2000) applied the argument to intrusion detection and concluded that the false-alarm rate, not the detection rate, is the factor that limits a detector's usefulness, because attacks are so rare among events. It is the same arithmetic as the scan gate in a signed and scanned container pipeline for Docker hosts.
Natural frequencies
Take 10,000 events, of which 0.2% are real attacks: 20 attacks and 9,980 benign events.
- The detector catches 95% of the attacks: 19 true alerts, 1 missed.
- It fires on 2% of the benign events: about 200 false alerts.
So there are about 219 alerts, of which 19 are real. The probability that an alert is real is . The detector performs well, but benign events greatly outnumber attacks.
The problem Gigerenzer and Hoffrage used was medical: a screening test for breast cancer with a prevalence of 1%, a sensitivity of 80% and a false-positive rate of 9.6%. Of 1,000 women screened, 10 have the disease and 8 of them test positive; of the 990 without it, about 95 test positive. A positive result therefore indicates disease in about 8 cases out of 103, under 8%, which is why a positive screening result leads to further examination rather than directly to treatment.
In symbols, with base rate , sensitivity and false-positive rate :
Drawn as a flow, the formula becomes intuitive: the thin stream of real attacks is joined by a much thicker stream of benign events that leak into the alert queue.
Evidence on the log-odds scale
Analysts rarely decide on one signal. A login from a new country, an administrative action outside working hours, a known-bad hash: each piece of evidence should move the belief. Bayes' rule is cleanest in odds:
Take logarithms and multiplication becomes addition: start from the prior log-odds and add one term per independent piece of evidence. Email spam filters have long worked this way: each word in a message adds or subtracts evidence, and the message is filtered when the total crosses a threshold. This can be shown as a waterfall chart. The detector above has a likelihood ratio of , worth on the scale. The base rate starts at . Even after the alert, the log-odds are still negative: less likely than not.
The independence assumption
Adding log-likelihood ratios assumes the signals are independent given the truth. Real signals often are not: a new-country login and an unusual time of day are correlated, because travelling users exhibit both. Treating correlated signals as independent double-counts evidence and makes analysts overconfident. Spam filters show the same weakness: words such as "free" and "offer" tend to appear together, and counting each as separate evidence makes the filter more certain than it should be. Calibrating combined signals on historical, labelled alerts is the remedy.
The figure below combines these elements.
The Sankey diagram follows 10,000 events; the donut shows what the alert queue is made of; the waterfall adds evidence in log-odds.
Suggested settings:
- Default settings. With the defaults (0.2% attacks, 95% sensitivity, 2% false positives), only about 8.7% of alerts are real, and there are about 10 false alarms for every attack caught.
- Sensitivity and false-positive rate. Raise the sensitivity to 99.9%. The share of real alerts barely moves. Now lower the false-positive rate from 2% to 0.2%: it rises to around 49%. This illustrates Axelsson's argument.
- Additional evidence. Turn on "login from a new country" (likelihood ratio 8). The waterfall gains a step, and the probability of a real attack rises to about 43%. Add "off-hours admin action" (ratio 4): about 75%. Two moderate signals have a larger effect than a more sensitive detector.
- Higher base rate. Set the attack share to 10%, as it might be in a narrow, high-risk population such as privileged accounts. The same detector now produces mostly true alerts. Scoping a detector to a riskier population is a way of raising its base rate.
Derivation. By the definition of conditional probability, , and the law of total probability gives . Substituting , and gives the formula above. Dividing by cancels and gives the odds form. If and are independent given and given , the likelihood ratio of both is the product of the separate ratios, and its logarithm is the sum. With the defaults: , posterior odds , probability about 75%.
Viewing detection as a flow changes what a security team measures. The headline figure for a detector should be its false-positive rate at the base rate it will face in operation, and the headline figure for the operation should be the precision of the alert queue. Those two numbers decide how much of an analyst's day is spent on real attacks.
References
- D. Kahneman and A. Tversky, "On the psychology of prediction", Psychological Review, 80(4), 237-251, 1973.
- M. Bar-Hillel, "The base-rate fallacy in probability judgments", Acta Psychologica, 44(3), 211-233, 1980.
- G. Gigerenzer and U. Hoffrage, "How to improve Bayesian reasoning without instruction: frequency formats", Psychological Review, 102(4), 684-704, 1995.
- S. Axelsson, "The base-rate fallacy and the difficulty of intrusion detection", ACM Transactions on Information and System Security, 3(3), 186-205, 2000.