Lesson 9 of 13 · 15m
Single Events Lie; Sequences Tell the Truth
event_count vs value_count, temporal joins, window sizing against attacker pacing, and the memory cost of stateful detection.
A single 4625 means a user mistyped a password. Ten thousand 4625s against distinct usernames from one IP mean password spraying. The same event ID, the same failure code — the difference exists only in the aggregate, and capturing it requires state.
The correlation types
Sigma's correlation spec (the correlation: section, a newer layer on top of selection rules) names four:
- event_count — N events matching a rule, grouped by a field, inside
timespan. "≥10 failed logons on one account in 5 minutes" is event_count overTargetUserName. - value_count — N distinct values of a field. "≥20 distinct usernames failed from one SourceIp" — the spray signature — is value_count over
TargetUserNamegrouped byIpAddress. This is the type juniors get backwards: spray detection counts distinct users; brute force counts repeated failures on one user. - temporal — two or more rules' events on the same entity within a window. "4624 type 3 from IP X then 4688 launching
powershell.exewithin 5 minutes on the same host" — the sequence, not either event alone. - temporal_ordered — temporal with strict ordering required.
Where the state lives
Correlation needs per-key counters inside sliding windows. In Splunk that's scheduled searches over lookback windows; in Sentinel it's scheduled analytics rules where queryFrequency and queryPeriod define how often the window is evaluated and how far back it looks; in Sigma-correlation backends it compiles to whatever the target's aggregation syntax is. The mechanics differ; the resource cost is the same shape: window length × cardinality of the group-by key = memory. group-by: IpAddress over a 5-minute window is small; group-by: UserName over 24 hours on a 10k-seat estate is not.
Join-based correlation has a second cost: the join explodes combinatorially before it filters. "Every 4624 joined to every 4688 on the same host within 5m" on a busy estate is millions of candidate pairs per evaluation. Correlations keyed on specific field values — the same IpAddress, the same SubjectLogonId — prune before joining; correlations on broad entity fields multiply first.
Windows and lookbacks
The temporal window has to outlast the attacker's pacing and your pipeline lag. Spray campaigns run slowly on purpose — 30 attempts per hour to stay under naive thresholds — so a 5-minute window misses a slow spray and a 24-hour window catches it at 10× memory cost. Layered windows answer this: a tight event_count for fast bursts, a slow value_count over a longer lookback for deliberate pacing. The password-spray detection Microsoft published for ADFS estates in the 2020 era worked exactly this way: distinct-user counting over hours, not failed-logon counting over minutes.
The late-events problem compounds it: an event buffered through a Kafka stall and indexed 40 minutes late belongs in a window that already closed. Correlations evaluated on event.created with lookback longer than measured worst-case ingest lag survive; correlations on arrival time do not.
Dedup is correlation's twin
The same incident producing 400 events shouldn't produce 400 alerts. Aggregation keys — (rule, entity, time bucket) — turn a spray into one alert naming the source and the affected account count. Splunk Enterprise Security's risk-based alerting (RBA, shipped with ES 6.4 in 2020) goes further: risk scores accumulate on entities, and the alert fires when aggregate risk crosses a threshold rather than when any single rule fires. The sequence of small anomalies becomes the signal — a spray, a successful logon, and a new MFA enrollment on the same account in one shift is one alert at 90 risk, not three alerts at 30.
The correct practice: start single-event rules to validate signal, then express multi-event hypotheses as temporal correlations on the entity fields — host, user, source ip — and measure the memory cost of each window before you multiply them.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
Immich Had Fourteen Advisories and One Bug It Fixed Three Times
Immich's 2026 security record runs to fourteen advisories, and they cluster hard: the sharing features, the OAuth plumbing, and one login redirect parameter that took three separate fixes across eighty-three days. Plus the 3.0 migration traps still waiting for anyone who hasn't jumped yet.
Jellyfin's Threat Model Is Your Brother-in-Law
Four Jellyfin CVEs landed in 2026 and not one of them needs an admin account. One needs only the ability to name a file. Meanwhile Jellyfin 12 shipped in September, the version numbers stopped starting with 10, and every "am I patched" check you wrote is now wrong.
Node.js Fixed 16 Flaws in One Release. Most of Them Live in HTTP/2 and TLS.
The November 11 Node.js security releases fix 16 CVEs across the 26, 24 and 22 lines, seven of them rated high. Nearly all sit in HTTP/2 and TLS, where a remote client can crash a server, leak memory, or get past per-host client-certificate checks.
Next.js Shipped Seven Advisories and Six of Them Are the Cache
The November 2026 Next.js security release patches seven issues, and six live in the new Cache Components layer, the feature meant to make your app faster by remembering more. Three hit self-hosted next start specifically: the ones Vercel's own platform quietly absorbs.