Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
scudette committed Oct 26, 2024
1 parent 018efe2 commit 77829a2
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 7 deletions.
6 changes: 2 additions & 4 deletions vql/sigma/evaluator/correlation.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,8 @@ func (self *timespanManager) addTime(
}

new_event := &TimedEvent{
ts: ts,
Event: &Event{
Dict: event.Copy(),
},
ts: ts,
Event: event,
}
self.correlator.addEvent(ctx, scope, new_event, rule)

Expand Down
109 changes: 108 additions & 1 deletion vql/sigma/fixtures/TestSigmaCorrelation.golden
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,114 @@
}
}
],
"Correlation Test VALUE_COUNT": [],
"Correlation Test VALUE_COUNT": [
{
"Timestamp": "2024-10-10T12:25:00+10",
"EventID": 4799,
"SubjectUserName": "admin",
"TargetUserName": "Distributed COM Users",
"Details": null,
"_Correlations": [
{
"Timestamp": "2024-10-10T12:22:00+10",
"EventID": 4799,
"SubjectUserName": "admin",
"TargetUserName": "Administrators"
},
{
"Timestamp": "2024-10-10T12:23:00+10",
"EventID": 4799,
"SubjectUserName": "admin",
"TargetUserName": "Remote Desktop Users"
},
{
"Timestamp": "2024-10-10T12:24:00+10",
"EventID": 4799,
"SubjectUserName": "admin",
"TargetUserName": "Remote Management Users"
},
{
"Timestamp": "2024-10-10T12:25:00+10",
"EventID": 4799,
"SubjectUserName": "admin",
"TargetUserName": "Distributed COM Users"
}
],
"_Rule": {
"Title": "High-privilege group enumeration",
"Name": "privileged_group_enumeration",
"Logsource": {
"Product": "windows",
"Service": "security"
},
"Detection": {
"Searches": {
"selection": {
"event_matchers": [
[
{
"field": "EventID",
"values": [
4799
]
},
{
"field": "TargetUserName",
"values": [
"Administrators",
"Remote Desktop Users",
"Remote Management Users",
"Distributed COM Users"
]
}
]
]
}
},
"Condition": [
{
"Search": {
"Name": "selection"
}
}
]
},
"status": "stable",
"Level": "informational",
"AdditionalFields": {
"falsepositives": [
"Administrative activity",
"Directory assessment tools"
]
},
"correlator": {
"Title": "Enumeration of multiple high-privilege groups by tools like BloodHound",
"Correlation": {
"type": "value_count",
"rules": [
"privileged_group_enumeration"
],
"group-by": [
"SubjectUserName"
],
"timespan": "15m",
"condition": {
"field": "TargetUserName",
"gte": 4
}
},
"status": "stable",
"Level": "high",
"AdditionalFields": {
"falsepositives": [
"Administrative activity",
"Directory assessment tools"
]
}
}
}
}
],
"Correlation Test TEMPORAL": [
{
"Timestamp": "2024-10-10T12:23:00+10",
Expand Down
3 changes: 1 addition & 2 deletions vql/sigma/sigma_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,6 @@ logsource:
detection:
selection:
EventID: 4799
CallerProcessId: 0x0
TargetUserName:
- Administrators
- Remote Desktop Users
Expand Down Expand Up @@ -894,7 +893,7 @@ func (self *SigmaTestSuite) TestSigmaCorrelations() {
for idx, test_case := range sigmaCorrelationTestCases {
fmt.Printf("Running case: %v: %v\n", idx, test_case.description)

if false && idx != 3 {
if false && idx != 2 {
continue
}

Expand Down

0 comments on commit 77829a2

Please sign in to comment.