Use the workload's timing and state requirements. If the decision must evaluate every event, maintain per-entity state, or act within milliseconds or seconds, run logic close to the source. If the work is retrospective and can tolerate slower execution, centralized storage is usually the better fit.
How to decide where detection logic belongs
The placement decision is mostly about latency, state, and the cost of missing an event. Source-side logic is best when the control has to inspect each event as it happens, correlate against local context, or react before downstream systems can safely catch up. Centralized storage is better when the same logic can run after the fact without changing the security outcome.
Think of the data source as the right place for enforcement-adjacent or time-sensitive detection, while centralized storage is the right place for analysis that benefits from broader history, richer joins, or easier tuning. The key test is whether delaying the decision changes what the detection can still prove or prevent.
For teams building detection pipelines, the most useful distinction is not “edge versus central” in the abstract. It is whether the logic depends on fresh local context, such as per-entity counters, session state, sequence order, or burst behavior, and whether the detection output must be available fast enough to drive an immediate response.
What changes the answer in practice
Stateful detections are the strongest reason to run logic close to the source. If a rule needs to remember the last event, track a short-term window, or suppress noise based on immediate prior activity, the source often has the cleanest access to that state. That reduces round trips, avoids blind spots during transport, and makes the signal less dependent on downstream ingestion delay.
Retrospective detections usually belong in centralized storage because the value comes from aggregation across time, sources, or entities. If the logic is looking for slow abuse, longitudinal anomalies, or correlation across multiple datasets, storage gives analysts better joins, reprocessing options, and the ability to refine the rule without pushing changes back to every producer.
Security teams should also account for operational coupling. The more a detection rule needs to be uniformly deployed, versioned, and audited across many producers, the more governance burden it creates at the source. The more the logic depends on large historical context, the more it benefits from a central detection layer that can be tuned and replayed without disrupting production systems.
Choosing based on response speed and observability
If the detection feeds an immediate block, quarantine, throttle, or high-priority alert, placing it near the source usually improves reliability because the action can happen before the event is normalized or aggregated elsewhere. That matters when the security objective is to stop a harmful sequence while it is still in progress.
If the detection is primarily for investigation, reporting, or trend analysis, centralized storage usually gives better observability. It is easier to compare events across tenants, systems, or time periods, and easier to validate whether the logic is producing stable results before turning it into a higher-cost runtime control.
The practical tradeoff is that source-side logic is typically more constrained by performance, consistency, and deployment complexity, while centralized logic is more constrained by latency and dependence on pipeline quality. Teams should choose the location that best matches the detection’s failure tolerance, not the location that is easiest to standardize.
Risk and Threat Considerations
Detection logic placed too far from the source can miss fast abuse, lose sequence context, or arrive after the relevant event has already been acted on by an attacker. Detection logic placed too close to the source can be harder to manage consistently and may create gaps when producers are overloaded, misconfigured, or bypassed.
Failure mechanism: Delayed ingestion, state loss, or inconsistent deployment weakens the detection path, either by hiding short-lived malicious activity or by allowing local configuration drift to reduce coverage.
Impact: The result can be missed alerts, slower containment, or a false sense of coverage when the control exists in design but not in practice.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK addresses the attack surface, NIST CSF 2.0 sets the technical controls, and ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | T1078 — Valid Accounts | Detecting live misuse of access often depends on fast, stateful signals. |
| Recommendation — Map rapid abuse patterns to ATT&CK and tune detections for immediate credential misuse. | ||
| NIST CSF 2.0 | DE.CM-01 — The network is monitored to detect potential cybersecurity events | Placement of detection logic directly affects monitoring timeliness and coverage. |
| DE.CM-09 — Computing hardware and software, data, and events are monitored to find anomalies | The question is about where anomaly detection should execute for reliable coverage. | |
| Recommendation — Place time-sensitive detections where monitoring can see events before response windows close. Choose the detection layer that can observe anomalies with the least delay and loss. | ||
| ISO/IEC 27001:2022 | A.8.15 — Logging | Centralized versus source-side detection depends on how events are captured and retained. |
| A.8.16 — Monitoring activities | This is fundamentally a monitoring architecture decision for security events. | |
| Recommendation — Ensure logging design preserves the state and timing needed by the chosen detection layer. Align monitoring placement with the response speed and context the detection requires. | ||
Practitioner Guidance
What to prioritize: Start with the detection's timing budget. If the decision must happen before the event ages out of usefulness, place the logic as close to the source as the platform can support; otherwise centralize it and optimize for analysis quality.
What to verify: Confirm where the required state actually lives, whether the source can retain it reliably, and whether pipeline delay would change the meaning of the signal. If you cannot verify those points, the placement decision is not mature yet.
Practitioner takeaway: Put logic where the security value is preserved, not where the architecture is merely convenient. Source-side for immediate, stateful decisions; centralized storage for slower, correlation-heavy detection.
Related resources from NHI Mgmt Group
- How should security teams decide whether to build authorization logic inside applications or externalize it to a centralized policy layer?
- How should security teams decide whether to ingest alerts directly from source tools, through a SIEM, or from a data fabric when building an AI SOC?
- How should security teams decide whether bot detection belongs in the auth stack?
- How do security teams decide whether an AI agent should keep access to regulated data?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 11, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org