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 render

The rendered site is written to docs/.

Environment

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

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.

# Every input that drives the analysis. Each value is labelled:
#   [illustrative] constructed for teaching; not from a production SOC
#   [assumption]   a modelling or policy choice; change it to match your risk appetite
#   [convention]   a reporting choice with no effect on the underlying numbers

# Detection rules [illustrative]. Confusion-matrix counts at the current threshold
# over one labelled review window. Each rule has 1,000 events and 100 threats (10% prevalence).
#   unit:        what counts as one event (sets the denominator of the false-positive rate)
#   window_days: length of the labelled review window
#   fn_source:   how missed threats (false negatives) were identified
#   cost_ratio:  cost of one missed threat / cost of one false alarm [assumption],
#                illustrative; set from risk appetite. Plausible range 1-1000.
rules:
  - rule_name: "Brute Force Login"
    tp: 80
    fp: 200
    fn: 20
    tn: 700
    unit: "account-hour with failed logins"
    window_days: 30
    fn_source: "purple-team replay"
    cost_ratio: 5
  - rule_name: "Lateral Movement"
    tp: 55
    fp: 20
    fn: 45
    tn: 880
    unit: "host-pair admin session"
    window_days: 30
    fn_source: "purple-team replay"
    cost_ratio: 25
  - rule_name: "Data Exfiltration"
    tp: 90
    fp: 90
    fn: 10
    tn: 810
    unit: "outbound flow-hour per host"
    window_days: 30
    fn_source: "retro-hunt and DLP incidents"
    cost_ratio: 50

# EER-based rule (the original ATLAS reading) [assumption]
# HOLD when |FRR - FAR| is within this many proportion units (0.02 = 2 percentage points). Range 0.01-0.05.
eer_tolerance: 0.02

# Cost-weighted rule [assumption]
# HOLD when the current threshold is within this distance (model z-units) of the cost-optimal one. Range 0.05-0.25.
delta_t: 0.1
# IMPROVE SIGNAL when separability d' is below this AND moving to the cost-optimal threshold
# cuts expected cost by less than min_cost_reduction.
improve_signal_d_prime: 2
improve_signal_min_cost_reduction: 0.10

# Robustness [convention]
bootstrap_draws: 10000
seed: 2026
# A recommendation reproduced in fewer than this share of resamples is flagged "low confidence".
confidence_threshold: 0.80
ci_level: 0.95

# Prevalence sensitivity [assumption]: threat share of events to test precision against.
prevalence_grid: [0.10, 0.01, 0.001]

# Workload [assumption]: analyst minutes to triage one alert. Range 5-60.
analyst_minutes_per_alert: 15

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.yml sets freeze: auto, so a full quarto render re-executes a page only when that page’s .qmd file changes. Edits to params.yaml or the R/ scripts do not count as a change. After editing them, render each page explicitly (for example quarto 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 sets freeze: false and 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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. Prevalence is unrealistically high. At 10% prevalence the queues look far healthier than they would in production; see Sensitivity to threat prevalence.
  9. 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.

#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value
#>  version  R version 4.5.2 (2025-10-31)
#>  os       macOS Tahoe 26.6.2
#>  system   aarch64, darwin20
#>  ui       X11
#>  language (EN)
#>  collate  en_US.UTF-8
#>  ctype    en_US.UTF-8
#>  tz       America/New_York
#>  date     2026-11-21
#>  pandoc   3.10 @ /Applications/Positron.app/Contents/Resources/app/quarto/bin/tools/aarch64/ (via rmarkdown)
#>  quarto   1.8.26 @ /Applications/quarto/bin/quarto
#> 
#> ─ Packages ───────────────────────────────────────────────────────────────────
#>  ! package      * version date (UTC) lib source
#>  P brio           1.1.5   2024-04-24 [?] CRAN (R 4.5.0)
#>  P cli          * 3.6.6   2026-04-09 [?] CRAN (R 4.5.2)
#>  P desc           1.4.3   2023-12-10 [?] CRAN (R 4.5.0)
#>  P digest         0.6.39  2025-11-19 [?] CRAN (R 4.5.2)
#>  P dplyr        * 1.2.1   2026-04-03 [?] CRAN (R 4.5.2)
#>  P evaluate       1.0.5   2025-08-27 [?] CRAN (R 4.5.0)
#>  P farver         2.1.2   2024-05-13 [?] CRAN (R 4.5.0)
#>  P fastmap        1.2.0   2024-05-15 [?] CRAN (R 4.5.0)
#>  P forcats      * 1.0.1   2025-09-25 [?] CRAN (R 4.5.0)
#>  P fs             2.1.0   2026-04-18 [?] CRAN (R 4.5.2)
#>  P generics       0.1.4   2025-05-09 [?] CRAN (R 4.5.0)
#>  P ggplot2      * 4.0.3   2026-04-22 [?] CRAN (R 4.5.2)
#>  P glue           1.8.1   2026-04-17 [?] CRAN (R 4.5.2)
#>  P gt             1.3.0   2026-01-22 [?] CRAN (R 4.5.2)
#>  P gtable         0.3.6   2024-10-25 [?] CRAN (R 4.5.0)
#>  P hms            1.1.4   2025-10-17 [?] CRAN (R 4.5.0)
#>  P htmltools      0.5.9   2025-12-04 [?] CRAN (R 4.5.2)
#>  P htmlwidgets    1.6.4   2023-12-06 [?] CRAN (R 4.5.0)
#>  P jsonlite       2.0.0   2025-03-27 [?] CRAN (R 4.5.0)
#>  P kableExtra   * 1.4.0   2024-01-24 [?] CRAN (R 4.5.2)
#>  P knitr        * 1.50    2025-03-16 [?] CRAN (R 4.5.0)
#>  P lifecycle      1.0.5   2026-01-08 [?] CRAN (R 4.5.2)
#>  P lubridate    * 1.9.4   2024-12-08 [?] CRAN (R 4.5.0)
#>  P magrittr       2.0.5   2026-04-04 [?] CRAN (R 4.5.2)
#>  P otel           0.2.0   2025-08-29 [?] CRAN (R 4.5.0)
#>  P pillar         1.11.1  2025-09-17 [?] CRAN (R 4.5.0)
#>  P pkgconfig      2.0.3   2019-09-22 [?] CRAN (R 4.5.0)
#>  P pkgload        1.5.3   2026-06-15 [?] CRAN (R 4.5.2)
#>  P purrr        * 1.2.2   2026-04-10 [?] CRAN (R 4.5.2)
#>  P R6             2.6.1   2025-02-15 [?] CRAN (R 4.5.0)
#>  P RColorBrewer   1.1-3   2022-04-03 [?] CRAN (R 4.5.0)
#>  P readr        * 2.1.5   2024-01-10 [?] CRAN (R 4.5.0)
#>    renv           1.1.5   2025-07-24 [1] CRAN (R 4.5.0)
#>  P rlang          1.3.0   2026-07-05 [?] CRAN (R 4.5.2)
#>  P rmarkdown      2.30    2025-09-28 [?] CRAN (R 4.5.0)
#>  P rprojroot      2.1.1   2025-08-26 [?] CRAN (R 4.5.0)
#>  P rstudioapi     0.19.0  2026-06-11 [?] CRAN (R 4.5.2)
#>  P S7             0.2.2   2026-04-22 [?] CRAN (R 4.5.2)
#>  P sass           0.4.10  2025-04-11 [?] CRAN (R 4.5.0)
#>  P scales       * 1.4.0   2025-04-24 [?] CRAN (R 4.5.0)
#>  P sessioninfo    1.2.3   2025-02-05 [?] CRAN (R 4.5.2)
#>  P stringi        1.8.7   2025-03-27 [?] CRAN (R 4.5.2)
#>  P stringr      * 1.6.0   2025-11-04 [?] CRAN (R 4.5.0)
#>  P svglite        2.2.2   2025-10-21 [?] CRAN (R 4.5.0)
#>  P systemfonts    1.3.1   2025-10-01 [?] CRAN (R 4.5.0)
#>  P testthat     * 3.3.2   2026-01-11 [?] CRAN (R 4.5.2)
#>  P textshaping    1.0.4   2025-10-10 [?] CRAN (R 4.5.0)
#>  P tibble       * 3.3.1   2026-01-11 [?] CRAN (R 4.5.2)
#>  P tidyr        * 1.3.1   2024-01-24 [?] CRAN (R 4.5.0)
#>  P tidyselect     1.2.1   2024-03-11 [?] CRAN (R 4.5.0)
#>  P tidyverse    * 2.0.0   2023-02-22 [?] CRAN (R 4.5.0)
#>  P timechange     0.3.0   2024-01-18 [?] CRAN (R 4.5.0)
#>  P tzdb           0.5.0   2025-03-15 [?] CRAN (R 4.5.0)
#>  P vctrs          0.7.3   2026-04-11 [?] CRAN (R 4.5.2)
#>  P viridisLite    0.4.3   2026-02-04 [?] CRAN (R 4.5.2)
#>  P waldo          0.6.2   2025-07-11 [?] CRAN (R 4.5.0)
#>  P withr          3.0.3   2026-06-19 [?] CRAN (R 4.5.2)
#>  P xfun           0.54    2025-10-30 [?] CRAN (R 4.5.0)
#>  P xml2           1.4.1   2025-10-27 [?] CRAN (R 4.5.0)
#>  P yaml           2.3.10  2024-07-26 [?] CRAN (R 4.5.0)
#> 
#>  [1] /Users/patricklefler/Claude/r/2026-07-16_rQuarto_atlas-detection-rules-analysis/renv/library/macos/R-4.5/aarch64-apple-darwin20
#>  [2] /Users/patricklefler/Library/Caches/org.R-project.R/R/renv/sandbox/macos/R-4.5/aarch64-apple-darwin20/4cd76b74
#> 
#>  * ── Packages attached to the search path.
#>  P ── Loaded and on-disk path mismatch.
#> 
#> ──────────────────────────────────────────────────────────────────────────────