Skip to content

SEP: Allow Negation In Correlation RulesΒ #198

@nasbench

Description

@nasbench

SEP: Negation in Correlation Rules

Author(s)

Nasreddine Bencherchali - @nasbench
Ryan Stillions - @rstillio

SEP Type

New Detection Logic (correlation types, aggregation functions)

Abstract

Allow the expression of negation in correlation rules through a condition attribute, maintaining consistency with standard Sigma rule syntax.

Problem Statement

Currently correlations allow only for the expression of positive matches with a logical AND linking.

In cases where we want to express the absence of events, the specification and by extension pySigma does not define a clear syntax on how we should do that.

The proposal is for the specification to allow the usage of negation when referencing rules in correlations through a familiar condition attribute that mirrors the approach used in standard Sigma rules.

Use Cases

The main gain is the ability to express detections where the condition requires the absence of specific events while maintaining a familiar Sigma syntax pattern that doesn't require rule authors to context switch between standard rules and correlation rules.

Detailed Specification

This change will affect the Related rules section and introduce a new condition attribute to the correlation specification.


Condition

Attribute: condition

Use: optional

Supported Correlation Types:

The condition attribute is supported for the following correlation types:

  • temporal
  • temporal_ordered

The condition attribute defines the logical relationship between referenced rules using string-based rule identifiers (names or IDs from the rules attribute).

The condition attribute supports:

  • Rule identifiers: References to rules defined in the rules attribute by their name or id.
  • Logical operators: and, or, not.
  • Parentheses for grouping: () to define operator precedence.
condition: rule_A and not rule_B and rule_C

Important: Conditions reference rule identifiers (strings) defined in the rules section, unlike standard Sigma rules where conditions reference map keys (selections) defined in the detection section.

Negation Behavior for Temporal Correlations:

  • For temporal: Rules prefixed with a not keyword in the condition attribute, must NOT produce any matching events within the timespan for the same group-by values. The presence of any negated rule match will exclude that group from the results.

  • For temporal_ordered: Rules prefixed with a not keyword in the condition attribute, must NOT produce any matching events within the timespan for the same group-by values. Negated rules do not affect the ordering requirement of positively referenced rules; only the non-negated rules must appear in the specified order.

Examples

Example 1: Temporal Correlation with Negation
title: Correlation - Successful Login Without MFA Verification
id: 7f8e9d6c-5b4a-3c2d-1e0f-9a8b7c6d5e4f
status: experimental
description: Detects successful authentication events that are not followed by MFA verification
author: Nasreddine Bencherchali
date: 2025-12-04
correlation:
    type: temporal
    rules:
        - successful_login
        - mfa_verification
    group-by:
        - User
        - ComputerName
    timespan: 5m
    condition: successful_login and not mfa_verification
falsepositives:
    - Service accounts without MFA
    - Legacy systems
level: medium

Example 2: Temporal Ordered with Multiple Filters

title: Correlation - Process Chain Without Expected Parent
id: 8a9b0c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d
status: experimental
description: Detects suspicious process execution chain without legitimate parent spawn
author: Nasreddine Bencherchali
date: 2025-12-04
correlation:
    type: temporal_ordered
    rules:
        - high_privilege_process
        - legitimate_parent_spawn
    group-by:
        - ComputerName
        - ProcessId
    timespan: 30s
    condition: high_privilege_process and not legitimate_parent_spawn
falsepositives:
    - Administrative tools
    - Software installers
level: high

Backward Compatibility Impact

As @thomaspatzke suggested.

Regarding backend support I think that this should be supported by most backends that already support the current temporal correlations. To maintain backwards compatibility I would add this internally as separate correlation subtype to pySigma, such that existing backends with temporal correlation support continue to work.

Implementation Areas

  • YAML structure changes
  • Sigma conversion tools (pySigma)
  • Backend updates
  • Documentation

Implementation Notes

N/A

Submitter Checklist

  • I have searched existing issues and SEPs to avoid duplicates
  • I have provided concrete examples and use cases
  • I have considered backward compatibility implications
  • I have thought about implementation complexity
  • I have aligned syntax with existing Sigma conventions

Implementation Assistance

Yes, I can help with the review of the implementation and documentation.

Additional Context

N/A

Metadata

Metadata

Type

No type

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions