Skip to content

Commit fdf9237

Browse files
fix: use Microsoft-Event stream with audit keyword xPath filter
Address PR review: keep the Windows Security event DCR but use the always-available 'Microsoft-Event' stream (Event table) instead of 'Microsoft-SecurityEvent' (which requires Sentinel). Apply the reviewer-suggested xPathQueries filter 'Security!*[System[(band(Keywords,13510798882111488)) and (EventID != 4624)]]' in both main.bicep and main_custom.bicep, and add the matching dataflow.
1 parent 4503d5b commit fdf9237

3 files changed

Lines changed: 57 additions & 5 deletions

File tree

infra/main.bicep

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,17 @@ module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-
586586
name: 'perfCounterDataSource60'
587587
}
588588
]
589+
windowsEventLogs: [
590+
{
591+
name: 'SecurityAuditEvents'
592+
streams: [
593+
'Microsoft-Event'
594+
]
595+
xPathQueries: [
596+
'Security!*[System[(band(Keywords,13510798882111488)) and (EventID != 4624)]]'
597+
]
598+
}
599+
]
589600
}
590601
destinations: {
591602
logAnalytics: [
@@ -604,6 +615,16 @@ module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-
604615
'la-${dataCollectionRulesResourceName}'
605616
]
606617
}
618+
{
619+
streams: [
620+
'Microsoft-Event'
621+
]
622+
destinations: [
623+
'la-${dataCollectionRulesResourceName}'
624+
]
625+
transformKql: 'source'
626+
outputStream: 'Microsoft-Event'
627+
}
607628
]
608629
}
609630
}

infra/main.json

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"_generator": {
77
"name": "bicep",
88
"version": "0.42.1.51946",
9-
"templateHash": "17498808897015217801"
9+
"templateHash": "16719390237009495333"
1010
},
1111
"name": "Modernize Your Code Solution Accelerator",
1212
"description": "CSA CTO Gold Standard Solution Accelerator for Modernize Your Code. \r\n"
@@ -13101,11 +13101,11 @@
1310113101
},
1310213102
"dependsOn": [
1310313103
"applicationInsights",
13104-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').monitor)]",
1310513104
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').oms)]",
1310613105
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
1310713106
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').ods)]",
1310813107
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').agentSvc)]",
13108+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').monitor)]",
1310913109
"dataCollectionEndpoint",
1311013110
"logAnalyticsWorkspace",
1311113111
"virtualNetwork"
@@ -15351,6 +15351,17 @@
1535115351
],
1535215352
"name": "perfCounterDataSource60"
1535315353
}
15354+
],
15355+
"windowsEventLogs": [
15356+
{
15357+
"name": "SecurityAuditEvents",
15358+
"streams": [
15359+
"Microsoft-Event"
15360+
],
15361+
"xPathQueries": [
15362+
"Security!*[System[(band(Keywords,13510798882111488)) and (EventID != 4624)]]"
15363+
]
15364+
}
1535415365
]
1535515366
},
1535615367
"destinations": {
@@ -15369,6 +15380,16 @@
1536915380
"destinations": [
1537015381
"[format('la-{0}', variables('dataCollectionRulesResourceName'))]"
1537115382
]
15383+
},
15384+
{
15385+
"streams": [
15386+
"Microsoft-Event"
15387+
],
15388+
"destinations": [
15389+
"[format('la-{0}', variables('dataCollectionRulesResourceName'))]"
15390+
],
15391+
"transformKql": "source",
15392+
"outputStream": "Microsoft-Event"
1537215393
}
1537315394
]
1537415395
}
@@ -40484,8 +40505,8 @@
4048440505
},
4048540506
"dependsOn": [
4048640507
"appIdentity",
40487-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageFile)]",
4048840508
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
40509+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageFile)]",
4048940510
"logAnalyticsWorkspace",
4049040511
"virtualNetwork"
4049140512
]

infra/main_custom.bicep

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,10 @@ module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-
497497
{
498498
name: 'SecurityAuditEvents'
499499
streams: [
500-
'Microsoft-WindowsEvent'
500+
'Microsoft-Event'
501501
]
502502
xPathQueries: [
503-
'Security!*[System[(EventID=4624 or EventID=4625)]]'
503+
'Security!*[System[(band(Keywords,13510798882111488)) and (EventID != 4624)]]'
504504
]
505505
}
506506
]
@@ -524,6 +524,16 @@ module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-
524524
transformKql: 'source'
525525
outputStream: 'Microsoft-Perf'
526526
}
527+
{
528+
streams: [
529+
'Microsoft-Event'
530+
]
531+
destinations: [
532+
'la-${dataCollectionRulesResourceName}'
533+
]
534+
transformKql: 'source'
535+
outputStream: 'Microsoft-Event'
536+
}
527537
]
528538
}
529539
}

0 commit comments

Comments
 (0)