Skip to main content

One post tagged with "streaming"

View All Tags

The case for continuous detection

· 9 min read
The IceGuard team
IceGuard

There is no shortage of content advocating for "Detection at Machine Speed". Unfortunately, far fewer are willing to define what that means, or describe how to do it.

This is our attempt at remedying that.

Machine speed detection is not what you think​

First, to avoid any confusion, let's be clear about what "Detecting at Machine Speed" is not:

  1. Running your detections on a 15 minute schedule.
  2. Running stateless detections1 during ingestion.

The first is obvious: If you run your detections in 15 minute batches, that's too slow to catch fast-moving attacks. In fact, attackers who know you detect and respond slowly (e.g., because they know your detections run on legacy infrastructure) can be as noisy as they like, as long as they believe they will achieve their objective before your predicted response time.

Scheduledevery 15 minContinuousevery 20 sAttack stepOther activityScheduled run

The second, on the other hand, requires a bit more explanation: The problem here isn't that the stateless detection isn't fast enough (or important!), but rather that the correlation between findings is too slow. Each of these stateless detections will land in a queue, and be triaged independently by an analyst or AI. If they are low severity, they might be ignored or delayed. And even if they are high severity, they will still require data gathering and analysis of the full investigation context before they can be acted upon.

Stateless detections also miss any activity that is suspicious based on sequences of events. For example, an abnormal volume of failed API calls, or enumeration against systems an actor usually doesn't interact with, cannot be detected using stateless detections. As a result, you must wait until the attacker escalates and triggers single-event detections, or your scheduled rules catch the behavior.

In a real incident, both these cases waste time you don't have.

What does "Detection at Machine Speed" look like?​

Before we talk about solutions, it's worth clarifying what the goal is. In our opinion, an ideal "Machine Speed" detection system should give you:

  • an accurate assessment of risk…
  • …of every identity and asset
  • …across every system
  • …incorporating all relevant information
  • …within 1-2 minutes of event time2

This is no panacea; if you have telemetry gaps or the attacker is indistinguishable from normal behavior, you won't catch them. But it pushes your detection layer as far as it can go, and as defenders this is all we can offer.

Now contrast this ideal state with the detection tactics we mentioned initially, and it's clear where the gaps are: batched detections are too slow, and stateless detections don't incorporate all relevant information.

So what do we do?

Getting the right building blocks​

There are two missing pieces in this puzzle:

  1. The ability to run stateful detections continuously…
  2. …across all relevant data.

The second is easy to explain: If you don't have low-latency, efficient access to all relevant data (e.g., because you're running a decoupled SIEM), you can't detect continuously.

The first, however, is worth breaking down further. By "stateful detection", we mean that the detection looks across a period of time, not just a single event. And by "continuously", we mean that the detection logic runs so frequently that the interval carries limited operational significance (e.g., 10-20 seconds).

Said differently, you can create rules that aggregate across time and sources (just like a scheduled detection), but that execute frequently (just like stateless detections running during ingestion).

Once you have both capabilities, interesting opportunities open up.

The case for continuous detection​

Imagine a hypothetical attack: An attacker phishes an administrator and steals their session token, gaining access without triggering a new login. They use the compromised session to access the identity provider and assign themselves access to a cloud DevOps role. From there, they create a new service account with persistent credentials and enumerate cloud resources. Finally, they access a production database and copy customer data to an external destination. All of this is done over 15 minutes.

Each of these steps is legitimate on its own, but highly suspicious when combined. Stateless detections would miss some of them (e.g., enumeration), while underplaying the significance of others (e.g., creating new credentials, copying data). Scheduled detections would be too slow.

Now imagine a detection system built upon stateful detections running continuously: Each low-level signal could be correlated as it arises, and attributed back to the original actor (i.e., the admin). Enumeration and lateral movement would be visible as well, since the detections run across systems.

Statelesseach event judged aloneContinuous statefulrisk for the adminInvestigation thresholdStolen sessionRole grantNew accountEnumerationData copiedAttack stepMissed

With that detection timeline, defenders have a shot. The risk associated with the actor starts climbing within minutes, triggering an AI investigation. The AI recognizes the risk responds directly - or escalates to a human - to immediately revoke the session and newly created credentials.

Happy ending.

Necessary, but not sufficient​

Of course, rapid detection is no guarantee that the organization is able to respond in time. And critics will argue that detection latency doesn't matter for most organizations, as they aren't set up for rapid response.

We disagree.

To defend effectively at machine speed, you need both machine speed detection and machine speed response. And you're highly unlikely to develop the latter unless you've established the former. So start by building the capability of detecting rapidly. Once you achieve that, it will be far easier to make the case for accelerating response.

Why is this so hard to do?​

At this point, we suspect few will disagree with the value of detecting threats faster. So why don't most SecOps tools support this today?

Because it's hard to do efficiently!

Continuous stateful detection requires running a query over the same period of time repeatedly. For example, let's say you want to detect if an actor has a high volume of failed API calls over the last 10 minutes. To do this, you would query across the 10 minute time period. You could run that query every 20 seconds, but that means you're re-reading the same data again and again every time (as only the first and last 20-second period of the 10 minutes change with each query).

This is very expensive to do in most systems, which is why most teams don't do it.

However, there is an obvious optimization possible. Instead of recomputing the entire time period, you can just process the difference between the current and the last run. In our previous example, that means computing over the latest 20 seconds of the current query scope and removing the impact of the earliest 20 seconds of the previous query scope. This means reading and computing over far less data, which makes it far more efficient.

Recompute the windowre-reads 10 min every runProcess the differencereads 40 s every runEach cell is 20 s of dataReadAddedDropped

If your system supports this optimization, you can stack up a lot of high-frequency stateful detections without exhausting your compute capacity. This is what enables continuous detection.

When constraints change, so should our strategy​

Defenders must live within the constraints that their tools impose. If you're struggling with your current detection capacity, moving to continuous stateful detection is unlikely to be the right choice.

However, as more systems support this capability, continuous detection should evolve to be a key part of your strategy.

AI-powered attackers are moving faster than ever. Your detections should run more frequently in response.

FAQ​

How is this different from near real-time rules?​

Many SIEMs offer near real-time (NRT) rules that run every minute or so. On the surface, that sounds like continuous detection. In practice, these rules are usually heavily constrained: they look back over a very short window (often just the last minute of data), can only use a subset of the query language, and are capped in how many you can run.

The reason for these constraints is the efficiency problem described above. Without processing only what changed, every run re-reads the data, so vendors keep the window short and the rule count low to protect the system.

The result is closer to a stateless detection than a stateful one. You can catch a single suspicious event quickly, but not an actor who slowly accumulates risk over 10 minutes across several systems. Continuous detection gives you the long, cross-source window of a scheduled rule, with the frequency of an NRT rule.

My response is slow. Why should I care about fast detection?​

Three reasons:

  1. Better detection, not just faster detection. Stateful detections that run continuously correlate signals per actor as they arrive. Instead of a queue of disconnected, low-severity findings, you get fewer alerts with more context, which speeds up triage regardless of how fast your response team is.
  2. Your response will get faster. AI-assisted investigation and automated containment are shrinking response times quickly. When they arrive, the bottleneck shifts to detection. As argued above, it's far easier to make the case for faster response once you can detect rapidly.
  3. Attackers calibrate to you. If an attacker knows your detections are slow, they can afford to be noisy. Closing the detection gap raises the bar, even before your response catches up.

Can I do this myself?​

Yes, but it's hard and inefficient.

The brute-force option is to run your scheduled detections every 20 seconds. As explained above, that means re-reading the full window on every run, which quickly exhausts your compute budget (or your SIEM's query limits).

The efficient option is to build a separate streaming pipeline (e.g., using a stream processing engine) that maintains state incrementally. This works, but introduces a new set of problems:

  • Two systems, two languages. Your streaming rules live outside your SIEM, often written in a different language. Detection engineers now maintain, test, and backtest logic in two places.
  • State management is tricky. Long windows, high-cardinality keys (e.g., every identity and asset), and late-arriving data all need to be handled correctly. Mistakes show up as missed detections, not error messages.
  • Context lives elsewhere. Many useful detections need historical or reference data (e.g., "has this actor ever touched this system before?"). Joining a stream against that data is either slow, expensive, or requires yet another copy of the data.
  • Operational overhead. It's another piece of critical infrastructure to deploy, monitor, scale, and keep in sync with your ingestion pipeline.

In other words, it's the DIY dilemma all over again. Unless you have a team that wants to build and operate streaming infrastructure, you're better off with a platform that supports continuous stateful detection natively.

Footnotes​

  1. Stateless detections are defined as rules that run against a single independent event at a time. They are not able to detect trends and correlations across events, or incorporate information from other recent findings. ↩

  2. Why not immediately at event time, you might ask? Two reasons: 1) Events are usually delayed from the source by at least 10-60 seconds, often longer. Correlating across sources means waiting for the most-delayed source. 2) To process the data efficiently, some degree of batching is required. If you push the batch sizes too low, the system becomes too expensive to maintain and operate for most organizations at the scales we're talking about. ↩

IceGuard

iceguard.io

Publication details

Loading publication details…