Skip to main content
The EventCorrelator implements real-time, pattern-based multi-step attack detection. Rather than evaluating events in isolation, it maintains a sliding window buffer and applies 7 pattern detectors to identify attack chains that span multiple events.

Architecture

Events ──> [Sliding Window Buffer] ──> [Pattern Detectors] ──> CorrelationResult
                Max 1000 events              7 patterns
                5-minute window
The correlator runs inside the DetectAgent and produces CorrelationPattern objects that boost the confidence score in the AnalyzeAgent.

Sliding Window Buffer

ParameterValue
Maximum events1,000
Time window5 minutes
Eviction policyEvents older than 5 minutes are discarded
GroupingEvents are grouped by source IP for pattern matching

7 Correlation Patterns

1. Brute Force Detection

FieldValue
MITRE ATT&CKT1110
Detection logicAuthentication failures from the same source IP
Window60 seconds
Threshold5 events
Confidence60 base + 8 per additional event (max 100)
Example15 failed SSH login attempts from 203.0.113.50 in 30 seconds

2. Port Scan Detection

FieldValue
MITRE ATT&CKT1046
Detection logicConnections to distinct destination ports from the same IP
Window60 seconds
Threshold10 distinct ports
Confidence65 base + 3 per additional port (max 100)
ExampleSingle IP probing ports 22, 80, 443, 3306, 5432, 6379, 8080, 8443, 9200, 27017

3. Lateral Movement

FieldValue
MITRE ATT&CKT1021
Detection logicConnections to distinct internal (RFC 1918) IP addresses
Window5 minutes
Threshold3 distinct internal IPs
Confidence55 base + 10 per additional IP (max 100)
ExampleCompromised host connecting to 192.168.1.10, 192.168.1.20, 192.168.1.30

4. Data Exfiltration

FieldValue
MITRE ATT&CKT1041
Detection logicLarge outbound data transfer to an external IP
WindowSingle event evaluation
Threshold10 MB
Confidence50 base + 15 per additional 10 MB (max 100)
Example45 MB upload to an external IP via curl

5. Backdoor Installation

FieldValue
MITRE ATT&CKT1059
Detection logicCombination of file write + process creation + outbound network connection
Window5 minutes
ThresholdAll 3 event types present
Confidence55 base, increases with additional correlated events (max 100)
ExampleFile written to /tmp/payload, new process spawned, outbound connection to C2 server

6. Privilege Escalation

FieldValue
MITRE ATT&CKT1548
Detection logicsetuid/setgid/sudo/pkexec events
Window5 minutes
Threshold1 or more events
Confidence50 base + 15 per additional event (max 100)
ExampleMultiple sudo invocations followed by setuid system call

7. Severity Escalation

FieldValue
MITRE ATT&CK— (compound pattern)
Detection logicAccumulation of low or medium severity events from the same source
Window5 minutes
Threshold3 events at the same severity level
Confidence40 base + 10 per additional event (max 100)
Promotion rules3+ low events promote to medium; 3+ medium events promote to high

Correlation Result

When a pattern matches, the correlator produces a CorrelationResult containing:
interface CorrelationResult {
  pattern: string;          // e.g., "brute_force"
  mitreId: string;          // e.g., "T1110"
  confidence: number;       // 0-100
  relatedEvents: string[];  // event IDs in the chain
  sourceIp: string;         // common source IP
  description: string;      // human-readable summary
}
The AnalyzeAgent applies a correlation boost of +5 per correlated event, up to a maximum of +25 added to the final confidence score.
The correlation engine operates in memory. Restarting the Guard engine clears the sliding window buffer. Persistent cross-session correlation is available when a Manager server is connected.