Back to Custom Threat Models

Custom Threat Models Overview

Understand how Enterprise custom threat models let you define detection rules tailored to your application's threat surface.

Last updated: 2026-03-11

Custom Threat Models (Enterprise)

Custom Threat Models are Enterprise-only detection rules that let you go beyond LiteSOC's built-in detectors. You define exactly what constitutes a threat for your application — LiteSOC evaluates every incoming event against your rules in real time.

What Makes a Custom Threat Model?

Every rule has five parts:

FieldDescriptionExample
Event TypeThe primary event to watch. Supports wildcards.auth.login_failed or auth.*
ConditionJSONB filter applied to matching eventsSee Condition Reference
ThresholdHow many matching events trigger a detection5
Time WindowRolling window in minutes to count events10
SeverityAlert severity when triggeredcritical, high, medium, low

Optional: FOLLOWED BY (Chained Events)

For multi-step attack patterns, you can add a second event type that must be observed after the first threshold is crossed:

FieldDescriptionExample
Chained Event TypeThe event that must followauth.login_success
Chain Time WindowMax minutes between primary and chained event15

When both conditions are met — e.g. 5 failed logins followed by a successful login within 15 minutes — LiteSOC fires a CRITICAL "Account Compromise Detected" alert, regardless of the configured severity. The detection correlates the chained event to the same actor or IP that triggered the primary threshold.

How Rules Are Evaluated

Rules are evaluated in-memory on every worker batch (runs every 30 seconds). LiteSOC never performs database-side JSON filtering for evaluation — the entire condition tree is resolved in Node.js against the live event batch, making evaluation extremely fast even for complex nested logic.

Redis counters track rolling counts per (orgId, modelId) key, automatically expiring after the configured time window. Sentinel keys for chained rules carry a TTL equal to the chain time window, ensuring no state ever persists beyond 24 hours.

Plan Requirements

Custom Threat Models are available on the Enterprise plan only. All rules you define are scoped to your organisation — other tenants cannot see or be affected by your rules.


Next: Metadata Filtering →

Related Articles

Was this article helpful? Need more assistance?