Skip to content

Commit c451346

Browse files
committed
Add test for conversion of correlation rule with reference to rule with deferred query expressions.
1 parent a0afbd1 commit c451346

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

tests/test_conversion_deferred.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,42 @@ def test_deferred_only_conversion(test_backend: TextQueryTestBackend):
180180
)
181181
== ['* | mappedA="foo.*bar"']
182182
)
183+
184+
185+
def test_deferred_conversion_correlation_rule_references(test_backend: TextQueryTestBackend):
186+
assert (
187+
test_backend.convert(
188+
SigmaCollection.from_yaml(
189+
"""
190+
title: Referenced Rule with Deferred
191+
name: rule_with_deferred
192+
status: test
193+
logsource:
194+
category: test_category
195+
product: test_product
196+
detection:
197+
sel:
198+
fieldA|re: foo.*bar
199+
fieldB: normalvalue
200+
condition: sel
201+
---
202+
title: Correlation Rule
203+
status: test
204+
correlation:
205+
type: event_count
206+
rules:
207+
- rule_with_deferred
208+
group-by:
209+
- fieldC
210+
timespan: 5m
211+
condition:
212+
gte: 10
213+
"""
214+
)
215+
)
216+
== [
217+
"""fieldB="normalvalue" | mappedA="foo.*bar"
218+
| aggregate window=5min count() as event_count by fieldC
219+
| where event_count >= 10"""
220+
]
221+
)

0 commit comments

Comments
 (0)