In part 1 I measured how long an open-source SOAR stack takes to stop
an attacker: a median of 5.30 s from an SSH brute-force event to dropped packets through Wazuh → Shuffle → MikroTik CHR,
and 1.66 s when Wazuh's Active Response calls the router directly.

That number answers "how fast is the first block". It says nothing about what a blocking pipeline has to do afterwards:

  • release the block when its TTL expires — on time, without leaving entries behind
  • survive a burst of alerts when nothing deduplicates them
  • decide what to do when the same attacker is detected again — while blocked, while the block is being removed, or right after it was removed

This post covers three experiments on exactly that (B1–B3, 87 measured trials). It is not a product comparison. The question
is: in this architecture and this processing path, where is the bottleneck, and which control changes what? Every number
below comes from the lab; the one formula that explains most of them is a plain queueing estimate.

The lab

Same lab as part 1, on Oracle Cloud Infrastructure Always Free:

Component Version / size
Wazuh manager / indexer / dashboard 4.14.10, on one A1.Flex VM (3 OCPU / 18 GB) together with Shuffle
Shuffle 2.3.0
MikroTik CHR 7.25.1 arm64 (A1.Flex 1 OCPU / 6 GB), address list + raw/prerouting drop, REST API
Attacker / protected workload E2.1.Micro VMs

Two response paths were measured side by side:

  • P-AR: Wazuh rule → Active Response script → CHR
  • P-SH: Wazuh rule → integration (integratord) → Shuffle workflow (one Python action) → CHR

Both call the same small blocking service (blocklife): a SQLite state store with one row per lifecycle
(PENDING → ACTIVE → RELEASING → RELEASED), compare-and-set transitions, and a separate reaper that is the only component
allowed to remove entries. The router entry itself only carries a backstop timeout (TTL + 600 s), so a crashed reaper cannot
leave an attacker blocked forever — and if the backstop ever fires, it shows up in the data.

Measurement: all VMs NTP-synced (offset < 51 µs), UDP probes every 10 ms to see when traffic actually stops and resumes, and
"canary" detections every 5 ± 1 s from unique documentation addresses to measure block latency during a burst. Bursts use
synthetic sshd log lines from the RFC 2544 benchmarking range (198.18.0.0/15), written to the protected VM's syslog — the same
path real events take, but no traffic to anyone.

B1 — one block, one release (n = 30)

The baseline lifecycle on P-AR with a 30 s TTL:

Metric p50 p95
Attack → traffic stops 1.43 s 2.52 s
Block actually held 29.897 s (TTL − 103 ms, stdev 2.6 ms) 29.900 s
Release starts → traffic resumes 128 ms 375 ms
Reaper lag behind the scheduled expiry 0.2 ms 0.3 ms

30 of 30 lifecycles completed. Two details worth knowing:

  • From the router's API response to packets actually stopping took ~100 ms, in both directions (103.5 ms to block, 104.2 ms to unblock, ±5 ms). The block is held ~103 ms less than the TTL because the expiry is counted from the API response, not from the moment the data plane applied it.
  • The first two trials after a VM start had slow SQLite writes (up to 1.2 s). A warm-up and synchronous=NORMAL (safe in WAL mode) removed that for the later experiments.

B2 — bursts without deduplication

Next I removed every safety net: a naive pipeline that sends one router add per alert, as a simple playbook would.
Duplicate adds for an address already on the list are refused by RouterOS (HTTP 400) — I count those as conflicts.

Bursts, 60 s each: G2-low 10 lines/s, G2-high 50 lines/s, G2-sat 200 lines/s (3 lines per synthetic source), and
G1: real SSH logins from the attacker VM at 20/s.

Canary latency during and after a burst

Burst P-AR worst canary P-AR queue recovery P-SH worst canary P-SH queue recovery
L0 (no burst, p50 / p95) 1.19 / 2.05 s — 11.3 / 18.2 s —
G2-low (10/s, 600 lines) 3.7 s 3.7 s 415 s 416 s
G2-high (50/s, 3,000 lines) 246 s 247 s 2,224 s 2,225 s
G2-sat (200/s, 12,000 lines) 1,186 s 1,188 s not run ≈ 8,960 s (projected)

The bottleneck is one serial process in each path

Nothing in this table is limited by CPU, memory or the router:

  • P-AR: wazuh-execd runs Active Responses one at a time — never more than one concurrently in any trial. Each run takes ~63 ms of real work; with process start-up the path sustains ~9.7 runs/s, constant across loads. Upstream, analysisd dropped 0 events and its queue stayed at 0 %.
  • P-SH: wazuh-integratord hands alerts to Shuffle one at a time, ~0.75 s each (a Python integration script per alert): ~1.33 runs/s. The queue builds up before Shuffle; Shuffle itself takes 3–15 s per execution but runs them in parallel.

With a burst of rate λ for 60 s and a serial stage of capacity μ, the last line is processed after roughly

recovery ≈ (λ − μ) × 60 s ÷ μ

Predicted Measured
P-AR G2-low / G2-high / G2-sat 2 s / 250 s / 1,180 s 3.7 s / 247 s / 1,188 s
P-SH G2-low / G2-high / G2-sat 391 s / 2,196 s / 8,960 s 416 s / 2,225 s / not run

That is why P-SH G2-sat was not run: the formula predicted 2.5 hours of backlog for a one-minute burst.

Recovery time per trial

"CPU is back to normal" is not "recovered"

SOAR VM resources

On P-AR the SOAR VM never exceeded 64 % CPU in G2-high, and after G2-sat the CPU was back to baseline in 94 s — while
block latency stayed elevated for about 20 minutes. A serial queue drains at a fixed rate with almost no CPU. On P-SH it is
the other way round: Shuffle's containers keep the CPU busy for the whole backlog, so CPU and queue recover together
(2,270 s vs 2,225 s). Watching resource graphs alone gets one of the two pipelines badly wrong.

Integrity: parallel + naive = unmanaged blocks

Router outcomes of repeated block requests

On P-AR, conflicts matched lines − sources exactly (400 / 2,000 / 8,000), and nothing else went wrong: the serial executor
never ran two adds at once.

On P-SH, Shuffle runs executions in parallel. Sometimes the duplicate add for an address reached the router before the
original one. RouterOS accepted it, the original then failed with 400, and the result was an entry no lifecycle owns — it
only carries the 600 s backstop, so the address stays blocked ~20× longer than the TTL and the reaper never releases it.
That happened 15 times in the G2 bursts; 5 entries were still on the router after the backlog drained, and 4 of 14 P-SH
trials failed the integrity check (P-AR: 17/17 passed).

Two more effects

  • G1 throttles itself. Real SSH at 20/s produced only 3–8 alerts per trial on P-AR: the first block cuts the attacker off, and before that sshd's MaxStartups 10:30:100 drops most connections. On P-SH (blocking takes 10+ s) the same attack produced 29–51 alerts — slower blocking means more duplicates.
  • Re-detection after release. Connections caught by the block were retransmitted after the TTL expired, re-detected tens of seconds later and blocked again: block → release → block flapping.

B2 left four problems: P1 duplicate races that create unmanaged entries, P2 re-detection after release, P3 a
detection arriving while the entry is being removed (not observed yet, but possible), and P4 stale alerts processed
minutes late.

B3 — controls for those problems

Six controls, all in the blocking service, all off by default so B1/B2 behaviour stays reproducible:

Control Targets
C1 Dedup at the state store: while an address has an open lifecycle, further detections never call the router (a unique index makes this hold under concurrency) P1
C2 Adopt on conflict: if the router answers 400 for a new lifecycle, look the entry up and take it over instead of failing P1 cascade
C3 Reconciliation every 30 s: router entries vs. state store; adopt untracked lab entries P1 leftovers
C4 Escalating TTL (×2 per release within 10 min, cap 600 s) and extension while blocked P2
C5 Release-race control: a detection before the DELETE cancels the release; one during the DELETE triggers an immediate re-block P3
C6 Alert age recorded (alert time → processing), measured only P4

Three targeted scenarios, each compared against the B1/B2 behaviour. Every B3 trial started from an empty state store.

R1 — duplicate bursts (P-SH)

Ten lines per source within one second, 30 sources:

Duplicate race

Policy Router adds per source Conflicts per trial Untracked
naive 10 270 0
dedup 1 0 0

Dedup turned the duplicates into extensions of the active block. Honest note: in these 900 lines the naive race did not
occur — integratord spaces same-source alerts ~0.75 s apart, so they rarely reach the router together. In B2 the 15 races came from
12,000 burst lines. Dedup removes the race structurally (exactly one router add per source); that property is
verified on the lab (3 trials) and by deterministic and randomized concurrency tests offline. The adopt and reconcile paths had
nothing to do on the lab and are verified offline only. Queue clearance did not change (≈ 190 s either way): dedup fixes load
and integrity, not latency.

R2 — a persistent attacker

Real SSH from the attacker VM at 2/s for 300 s, with a probe timeline recording when the attacker could actually reach the
target:

Block / release cycles

Pipeline / policy Attacker could reach the target Blocks TTL
P-AR, fixed TTL 4.5–4.8 % of the attack 10 30 s
P-AR, escalating + extend 1.2–1.6 % 4 30 → 60 → 120 → 240 s
P-SH, fixed TTL 23–27 % 7–8 30 s
P-SH, escalating + extend 9–14 % 3 30 → 60 → 120 s

Each release gives the attacker a window until it is re-detected and re-blocked (≈ 2 s on P-AR, 10+ s on P-SH). Fewer releases
means fewer windows — the effect is largest on the slow pipeline.

R3 — a detection racing with the release (P-AR)

A second detection aimed at the TTL expiry (±2 s), 50 sources × 3 trials per policy. The removal itself (the DELETE round
trip) takes about 20 ms, so only 5 of 300 detections landed exactly inside it:

Release race

Policy Arrived while blocked After release During the release
count-only (B1/B2 behaviour) 31 117 2 → both lost — the attacker stayed unblocked
dedup 30 (extended) 117 3 → all re-blocked within 17.8–18.2 ms

A detection that arrives after the release is re-blocked once it is processed (median 1.9 s later here) under either policy. The
case the control is for — a detection that would otherwise be silently dropped — went from 2 lost to 0. The "cancel before the
DELETE" path never triggered on the lab (its window is a few ms) and is covered by offline tests.

Nothing got slower

Baseline (L0) p50 / p95 B2 (no controls) B3 (dedup)
P-AR 1.19 / 2.05 s 1.16 / 1.87 s
P-SH 11.3 / 18.2 s 11.5 / 19.2 s

All 26 B3 trials passed the integrity check (no open lifecycle after the trial, no router leftovers, no unmanaged entries).
Alert age, measured only: ~72 ms on P-AR, but on P-SH already 11 s at the median without any burst and up to ~3 minutes behind
an R1 backlog — stale evidence is the next thing to deal with.

Takeaways

  1. Find the serial stage. Both paths were limited by one single-threaded Wazuh daemon (execd for Active Response, integratord for integrations), not by CPU, memory or the router. Measure its rate μ once and (λ − μ) × burst ÷ μ tells you how long a burst of rate λ will hurt.
  2. Don't read recovery off a CPU graph. A serial queue drains at low CPU; measure latency with canaries.
  3. Deduplicate where the state lives, not in the playbook. Without it, parallel execution turns duplicate alerts into router entries nobody manages.
  4. Make re-detection a first-class case. Escalating TTLs and extension while blocked cut a persistent attacker's exposure to about 1/2–1/4; handling the release race keeps a detection from being dropped in a 20 ms window.
  5. Keep release separate from blocking. A reaper with a state store releases on time (0.2 ms lag) and makes every one of these behaviours measurable.

Limitations

  • One lab, one set of versions, small numbers of trials per condition (3–5; L0 and P-AR G2-sat once). P-SH G2-sat was not run; its value is a projection from the measured capacity.
  • The three P-AR R2 runs with escalation were repeated from an empty state store after the first runs inherited the attacker's escalation history from the preceding trial; the first runs are kept separately and not used.
  • R1 did not reproduce the naive race on the lab; the B2 race figures come from the larger G2 bursts.
  • P-SH's baseline (11.3 s) is about twice part 1's Shuffle baseline (5.3 s). The extra time is inside Shuffle; the cause was not isolated.
  • OS security updates (krb5, libexpat, python3-jwt and others) were applied between test days; Wazuh and Shuffle versions did not change.
  • Shuffle 2.3.0's execution listing returned at most 200 entries and no cursor; executions were sampled every 2 s instead.

Reproduce it

Everything is open in ynprgrmmr/oss-soar-e2e-latency (code MIT, data and write-ups CC BY 4.0):

  • experiments/02-block-lifecycle — designs, trial orchestration, samplers, raw data of every trial (including rehearsals and the superseded runs) and the result write-ups with all figures
  • infra/02-block-lifecycle — the blocking service (state store, reaper, policies, reconciliation, API for Shuffle)
  • B3 results and comparison — the numbers behind the B3 section of this post
  • the lab's Terraform and part 1's measurement code are in the same repository; the offline tests run with python3 -m unittest discover -s tests/b1 (and b2, b3)

All bursts were synthetic log lines from non-routable ranges or SSH logins against a VM I own. Only point these tools at systems
you are authorized to test.

Want to run this setup without building it from scratch?

The code, measurement scripts and raw data behind this post are free and open in
ynprgrmmr/oss-soar-e2e-latency (code MIT, data CC BY 4.0).

If you would rather skip the assembly, I also packaged a turnkey version:
Wazuh × Shuffle × MikroTik CHR SOAR Starter Kit on OCI (v1.0.0) — $29.
It contains OCI Terraform modules, an allowlist-aware CHR blocking connector, the Wazuh and Shuffle configuration,
and step-by-step deployment, validation and cleanup guides. It is optional; nothing in this post depends on it.