| Item | Value |
|---|---|
| R | R version 4.5.2 (2025-10-31) |
| Platform | aarch64-apple-darwin20 |
| Quarto | 1.8.26 |
| Packages | In sync with renv.lock |
| dplyr | 1.2.1 |
| ggplot2 | 4.0.3 |
| kableExtra | 1.4.0 |
| scales | 1.4.0 |
Reproducibility
ATLAS Threshold Detection Rules Analysis: how to rerun the analysis and where the results can mislead
Every number on this site is computed from the illustrative confusion-matrix counts and assumptions in params.yaml. Nothing is downloaded during a render, and the only random step (the resampling check) uses a fixed seed, so rendering the same commit with the same package versions gives the same results. This page explains how to rebuild the site, records the environment it was built in, and states where the results can mislead. It is re-executed on every render, so the tests and environment status below are always current.
Quick start
The code is in the GitHub repository patrick-lefler/atlas-detection-rules-analysis. To rebuild everything from a clean copy:
git clone https://github.com/patrick-lefler/atlas-detection-rules-analysis
cd atlas-detection-rules-analysis
Rscript -e 'renv::restore()' # once: install the package versions pinned in renv.lock
quarto renderThe rendered site is written to docs/.
Environment
How to read the table. Each row is one piece of software this page was built with and its version. The “Packages” row says whether the installed R packages match the versions pinned in renv.lock.
What the table tells you. If your versions match these and the packages are in sync, rebuilding the project should give the same numbers. If they differ, small differences in the results may come from the software rather than the analysis.
Pipeline
| Script | What it does | Main outputs |
|---|---|---|
R/setup.R |
Loads packages, sets the plot theme, the action colours and the table helpers | COLOURS, kable_house(), action_cell(), pct() |
R/atlas.R |
Defines the error-rate formulas, Wilson intervals, the Gaussian model, both decision rules, the bootstrap, workload projections and charts | Functions only |
R/analysis.R |
Reads params.yaml and computes every result the pages show |
rules, results, res, boot, projection, proj, prevalence_tbl |
Each page sources the three scripts in a hidden first chunk, so every page works from the same objects. Each script depends on objects from the one before it, so sourcing a later script on its own in a fresh session fails.
Parameters and seeds
All inputs live in params.yaml: the confusion-matrix counts and descriptions of each rule, the cost ratios, the decision-rule settings, the resampling settings, the prevalence grid and analyst minutes per alert. Each value is labelled as illustrative, an assumption or a reporting convention, and assumptions carry a plausible range. The only random step is the resampling check in bootstrap_rule(), which calls set.seed(2026) at the start of each rule, so a rule’s result does not depend on the order of the rules or on the number of cores.
Tests
Core functions are covered by testthat tests in tests/testthat/. They check the error-rate formulas and published Wilson intervals, that the model passes through the observed point and finds the crossover, that the cost-optimal threshold matches a numerical minimum and reduces to the EER at a cost ratio of (1 − p)/p, both decision rules, determinism of the bootstrap, the workload projection and the empirical curve. Run them with Rscript -e "testthat::test_dir('tests/testthat')". The suite is run each time this page is rendered:
| file | Tests | Expectations | Failed | Errors | Warnings | Skipped |
|---|---|---|---|---|---|---|
| test-atlas.R | 11 | 32 | 0 | 0 | 0 | 0 |
How to read the table. Each row is one file of automated checks on the analysis code. It counts the tests in the file, the individual checks (expectations) those tests make, and how many failed, stopped with an error, raised a warning or were skipped. The checks cover the error-rate formulas, the statistical model, both decision methods, the resampling and the workload projections, each compared with values worked out independently.
What the table tells you. All 32 checks across 11 tests ran with 0 failures and 0 errors when this page was last built, so the calculations behind every number on the site behaved as designed. The tests re-run on every render, so a change that broke a formula would appear here as a failure. Passing tests show the code does what it intends; they cannot show the illustrative data or assumptions are realistic.
Caching
- Quarto freeze (
_freeze/)._quarto.ymlsetsfreeze: auto, so a fullquarto renderre-executes a page only when that page’s.qmdfile changes. Edits toparams.yamlor theR/scripts do not count as a change. After editing them, render each page explicitly (for examplequarto render rules.qmd), because Quarto always executes a page that is rendered on its own, or delete_freeze/and render the whole site. This page setsfreeze: falseand is re-executed on every render.
Known limitations
Limits of reproducibility
- Bit-for-bit equality is expected only on the same platform and package versions. Floating-point and BLAS differences across machines can change low-order digits.
- The resampling check depends on R’s default random number generator. A future change to
rbinom()or the default generator could shift the resampled shares slightly. - Quarto versions affect rendering, not the numbers.
Model limitations
- The data are illustrative. Each rule has 1,000 events and 100 threats. The results show the method, not the performance of any real rule.
- Missed-threat labels carry verification bias. False negatives can only be counted where something else found the threat: red- or purple-team exercises, retro-hunts, or incidents caught by other controls. Each source finds some kinds of attack more easily than others, so FRR is the least reliable number here, and it drives the most consequential recommendation.
- FAR depends on the unit of analysis. What counts as one benign event (an authentication, a session, a flow-hour) sets the FAR denominator. A different unit can move FAR by an order of magnitude without any change to the rule.
- The curves are assumed, not fitted. The equal-variance Gaussian model is anchored to a single observed point, so it passes through that point by construction. Real scores are often skewed, heavy-tailed or discrete. See empirical curves for the alternative.
- Thresholds are in model units. The charts’ x-axis is a benign-score z, not a SIEM configuration value. Putting a recommendation into practice means mapping it to real units.
- Rules are evaluated in isolation. Defence in depth is ignored: a threat one rule misses may be caught by another control. Detection latency is ignored too, though for lateral movement a late detection can be nearly as bad as a miss.
- Samples are small. With about 100 threats per rule, the intervals are wide and two of the three EER-based recommendations are not robust; see Recommendation robustness.
- Prevalence is unrealistically high. At 10% prevalence the queues look far healthier than they would in production; see Sensitivity to threat prevalence.
- Cost ratios are illustrative. The cost-weighted recommendations depend directly on them.
What would change the conclusions
| Assumption | Current value | Conclusion that would change |
|---|---|---|
| Data Exfiltration cost ratio | 50:1 | At 9:1 the cost-optimal and EER thresholds coincide and LOOSEN becomes HOLD. |
| Brute Force Login cost ratio and the IMPROVE SIGNAL cut-offs | 5:1; d′ < 2, gain < 10% | A lower cost ratio or a lower gain cut-off returns TIGHTEN instead of IMPROVE SIGNAL. |
| Lateral Movement missed-threat count | 45 of 100 | If purple-team replays overstate misses, FRR and the size of the LOOSEN move shrink. |
| Prevalence | 10% | At realistic prevalence, cost-weighted thresholds that raise FAR would produce unmanageable alert volumes. |
What real data would replace each assumption
| Assumption | Replace with |
|---|---|
| Constructed counts | Confusion matrices from a fixed, labelled review window per rule |
| One observed point per rule | Counts at several real thresholds from replayed logs, fed to build_empirical_curve() |
| Unit of analysis and window | The unit the rule actually scores and the dates of the review window |
| Missed-threat labels | Documented purple-team, retro-hunt and incident sources, with coverage notes |
| Cost ratios | A per-rule ratio agreed with risk owners, linked to the risk-appetite statement |
| Analyst minutes per alert | Median triage time per rule from the case-management system |
How to use these results. Use them to learn the method, to see how recommendations depend on stated costs and on sampling noise, and as a template for a real calibration record. Do not use them as evidence about any real rule’s performance, or to set a production threshold without measured counts, real threshold units and an agreed cost ratio.
Licenses
The code on this site is released under the MIT License. The data and third-party software keep their own terms:
| Source | Terms |
|---|---|
| Confusion-matrix counts and parameters | Illustrative values written for this project; part of this repository under the MIT License |
| Quoted passages from Mattei, Data-Driven Cybersecurity (Manning, 2025) | Copyright of the publisher; short quotations with section references for commentary |
| R packages (tidyverse, ggplot2, dplyr, kableExtra, scales, cli, gt, testthat) | MIT, per each package’s DESCRIPTION file (e.g. ggplot2) |
| knitr, sessioninfo | GPL (knitr, sessioninfo) |
| yaml | BSD 3-clause (yaml) |
Session information
The site was built with R and Quarto. The analysis loads tidyverse, kableExtra, knitr, scales and cli, and also calls yaml, gt, testthat, renv and sessioninfo. Package versions are pinned in renv.lock; run renv::restore() to install them.