Risk-Based Alerting¶
Risk-Based Alerting (RBA) is an entity-centric detection approach. Instead of alerting on every rule match, rules contribute risk scores to entities (users, devices, IPs, etc.). When an entity's accumulated score crosses a threshold, a risk alert is generated.
How It Works¶
- A rule with
riskentries matches an incoming event - Each risk entry extracts an entity identifier from the event and contributes a score
- Scores accumulate per entity, subject to scaling, decay, and TTL
- When an entity's total score crosses a configured threshold, a risk alert is emitted
Rules can both alert normally and contribute risk, or contribute risk only by setting alert: false.
Risk entries are defined per rule (see Rules: Risk) and global settings like thresholds and defaults are configured in the main config file (see Config: Risk).
Risk Alerts vs Risk Events¶
RBA produces two distinct types of output. Understanding the difference is important for setting up your outputs correctly.
Risk Alerts¶
Risk alerts are generated when an entity's accumulated score crosses a threshold. They are emitted to the regular alert outputs, alongside normal rule alerts.
A risk alert has rule type risk and includes the full breakdown of contributing rules:
{
"timestamp": "2026-05-14T12:00:00Z",
"rule": {
"id": 0,
"title": "Risk threshold crossed: user jsmith",
"type": "risk",
"level": "medium",
"status": "stable",
"description": "Entity user:jsmith crossed medium risk threshold with score 52.3"
},
"event": {
"entity_type": "user",
"entity_value": "jsmith",
"level": "medium",
"total_score": 52.3,
"contributing_rules": [
{
"rule_id": 200,
"rule_title": "Risk - Failed login attempt",
"count": 8,
"effective_score": 32.3
},
{
"rule_id": 201,
"rule_title": "Privilege Escalation Attempt",
"count": 1,
"effective_score": 20.0
}
]
}
}
contributing_rules groups contributions by rule. count is the number of active contributions from that rule, and effective_score is their combined score after scaling and decay.
Risk alerting is enabled by default when thresholds are defined. It can be disabled with the alerts setting (see Config: Risk), in which case scores are still tracked and regular alerts are still enriched, but no risk threshold alerts are generated.
Risk Events¶
Risk events are records of individual risk contributions. They are routed to any output that includes risk_events in its events field (see Config: Outputs).
{
"timestamp": "2026-05-14T11:55:00Z",
"type": "risk_contribution",
"rule_id": 200,
"rule_title": "Risk - Failed login attempt",
"entity_type": "user",
"entity_value": "jsmith",
"score": 5,
"scaling": 0.1,
"ttl": "1h0m0s",
"decay": "linear"
}
Risk events can be used for:
- Forwarding contributions to an external risk aggregation system
- Auditing which rules contributed to an entity's score
- Building dashboards and visualizations
- Sending risk data to long-term storage
Alert Enrichment¶
When a rule has both alerting and risk enabled, the resulting alert includes a top-level risk field with the entity's current risk context:
{
"timestamp": "...",
"rule": {"..."},
"event": {
"user": {"name": "jsmith"}
},
"risk": [
{
"entity_type": "user",
"entity_value": "jsmith",
"total_score": 45.0,
"level": "low",
"contributing_rules": ["Failed Login", "Privilege Escalation Attempt"]
}
]
}
This enrichment happens regardless of whether risk alerting is enabled. Even with alerts: false, regular alerts still carry risk context.
Note
The risk feature operates on processing time and does not support event time semantics at the moment. Risk scores and decay are calculated based on when events are processed, not when they originally occurred. Historical data processing is currently not supported.
Risk Helpers in Extended Match¶
Risk state can be queried inside extended_match expressions using dedicated helper functions. This enables rules that react to an entity's accumulated risk, for example escalating a low-severity event into an alert only when the entity is already under elevated risk.
See Expressions: Extended Match for the full function reference.