Skip to content

Commit 06df144

Browse files
fix: address SFI security compliance issues
- Enable infrastructure encryption (double encryption) for storage account - Add Security solution to Log Analytics workspace for SecurityEvent table - Add Windows Security Audit Event Logs (EventID 4624/4625) to data collection rules - Route Microsoft-SecurityEvent stream to Log Analytics in both main.bicep and main_custom.bicep Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e62acf2 commit 06df144

4 files changed

Lines changed: 105 additions & 9 deletions

File tree

infra/main.bicep

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,12 +514,27 @@ module maintenanceConfiguration 'br/public:avm/res/maintenance/maintenance-confi
514514
}
515515
}
516516

517+
resource securitySolution 'Microsoft.OperationsManagement/solutions@2015-11-01-preview' = if (enablePrivateNetworking && enableMonitoring) {
518+
name: 'Security(log-${solutionSuffix})'
519+
location: location
520+
plan: {
521+
name: 'Security(log-${solutionSuffix})'
522+
publisher: 'Microsoft'
523+
product: 'OMSGallery/Security'
524+
promotionCode: ''
525+
}
526+
properties: {
527+
workspaceResourceId: logAnalyticsWorkspaceResourceId
528+
}
529+
}
530+
517531
var dataCollectionRulesResourceName = 'dcr-${solutionSuffix}'
518532
var dataCollectionRulesLocation = useExistingLogAnalytics
519533
? existingLogAnalyticsWorkspace!.location
520534
: logAnalyticsWorkspace!.outputs.location
521535
module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-rule:0.11.0' = if (enablePrivateNetworking && enableMonitoring) {
522536
name: take('avm.res.insights.data-collection-rule.${dataCollectionRulesResourceName}', 64)
537+
dependsOn: [securitySolution]
523538
params: {
524539
name: dataCollectionRulesResourceName
525540
tags: tags
@@ -586,6 +601,17 @@ module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-
586601
name: 'perfCounterDataSource60'
587602
}
588603
]
604+
windowsEventLogs: [
605+
{
606+
name: 'SecurityAuditEvents'
607+
streams: [
608+
'Microsoft-SecurityEvent'
609+
]
610+
xPathQueries: [
611+
'Security!*[System[(EventID=4624 or EventID=4625)]]'
612+
]
613+
}
614+
]
589615
}
590616
destinations: {
591617
logAnalytics: [
@@ -604,6 +630,14 @@ module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-
604630
'la-${dataCollectionRulesResourceName}'
605631
]
606632
}
633+
{
634+
streams: [
635+
'Microsoft-SecurityEvent'
636+
]
637+
destinations: [
638+
'la-${dataCollectionRulesResourceName}'
639+
]
640+
}
607641
]
608642
}
609643
}

infra/main.json

Lines changed: 46 additions & 7 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": "1333265003476738511"
9+
"templateHash": "16804124823752948659"
1010
},
1111
"name": "Modernize Your Code Solution Accelerator",
1212
"description": "CSA CTO Gold Standard Solution Accelerator for Modernize Your Code. \r\n"
@@ -308,6 +308,25 @@
308308
"resourceGroup": "[variables('existingLawResourceGroup')]",
309309
"name": "[variables('existingLawName')]"
310310
},
311+
"securitySolution": {
312+
"condition": "[and(parameters('enablePrivateNetworking'), parameters('enableMonitoring'))]",
313+
"type": "Microsoft.OperationsManagement/solutions",
314+
"apiVersion": "2015-11-01-preview",
315+
"name": "[format('Security(log-{0})', variables('solutionSuffix'))]",
316+
"location": "[parameters('location')]",
317+
"plan": {
318+
"name": "[format('Security(log-{0})', variables('solutionSuffix'))]",
319+
"publisher": "Microsoft",
320+
"product": "OMSGallery/Security",
321+
"promotionCode": ""
322+
},
323+
"properties": {
324+
"workspaceResourceId": "[if(variables('useExistingLogAnalytics'), parameters('existingLogAnalyticsWorkspaceId'), reference('logAnalyticsWorkspace').outputs.resourceId.value)]"
325+
},
326+
"dependsOn": [
327+
"logAnalyticsWorkspace"
328+
]
329+
},
311330
"appIdentity": {
312331
"type": "Microsoft.Resources/deployments",
313332
"apiVersion": "2025-04-01",
@@ -13101,11 +13120,11 @@
1310113120
},
1310213121
"dependsOn": [
1310313122
"applicationInsights",
13104-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').ods)]",
1310513123
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').agentSvc)]",
13106-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').oms)]",
1310713124
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').monitor)]",
13125+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').oms)]",
1310813126
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').storageBlob)]",
13127+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').ods)]",
1310913128
"dataCollectionEndpoint",
1311013129
"logAnalyticsWorkspace",
1311113130
"virtualNetwork"
@@ -15351,6 +15370,17 @@
1535115370
],
1535215371
"name": "perfCounterDataSource60"
1535315372
}
15373+
],
15374+
"windowsEventLogs": [
15375+
{
15376+
"name": "SecurityAuditEvents",
15377+
"streams": [
15378+
"Microsoft-SecurityEvent"
15379+
],
15380+
"xPathQueries": [
15381+
"Security!*[System[(EventID=4624 or EventID=4625)]]"
15382+
]
15383+
}
1535415384
]
1535515385
},
1535615386
"destinations": {
@@ -15369,6 +15399,14 @@
1536915399
"destinations": [
1537015400
"[format('la-{0}', variables('dataCollectionRulesResourceName'))]"
1537115401
]
15402+
},
15403+
{
15404+
"streams": [
15405+
"Microsoft-SecurityEvent"
15406+
],
15407+
"destinations": [
15408+
"[format('la-{0}', variables('dataCollectionRulesResourceName'))]"
15409+
]
1537215410
}
1537315411
]
1537415412
}
@@ -16578,7 +16616,8 @@
1657816616
"dependsOn": [
1657916617
"dataCollectionEndpoint",
1658016618
"existingLogAnalyticsWorkspace",
16581-
"logAnalyticsWorkspace"
16619+
"logAnalyticsWorkspace",
16620+
"securitySolution"
1658216621
]
1658316622
},
1658416623
"proximityPlacementGroup": {
@@ -32018,8 +32057,8 @@
3201832057
"dependsOn": [
3201932058
"aiServices",
3202032059
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').openAI)]",
32021-
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
3202232060
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').aiServices)]",
32061+
"[format('avmPrivateDnsZones[{0}]', variables('dnsZoneIndex').cognitiveServices)]",
3202332062
"virtualNetwork"
3202432063
]
3202532064
},
@@ -32076,7 +32115,7 @@
3207632115
"_generator": {
3207732116
"name": "bicep",
3207832117
"version": "0.42.1.51946",
32079-
"templateHash": "3598447245043879538"
32118+
"templateHash": "15460841004653840446"
3208032119
}
3208132120
},
3208232121
"definitions": {
@@ -32314,7 +32353,7 @@
3231432353
"value": "TLS1_2"
3231532354
},
3231632355
"requireInfrastructureEncryption": {
32317-
"value": false
32356+
"value": true
3231832357
},
3231932358
"keyType": {
3232032359
"value": "Service"

infra/main_custom.bicep

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,12 +422,27 @@ module maintenanceConfiguration 'br/public:avm/res/maintenance/maintenance-confi
422422
}
423423
}
424424

425+
resource securitySolution 'Microsoft.OperationsManagement/solutions@2015-11-01-preview' = if (enablePrivateNetworking && enableMonitoring) {
426+
name: 'Security(log-${solutionSuffix})'
427+
location: location
428+
plan: {
429+
name: 'Security(log-${solutionSuffix})'
430+
publisher: 'Microsoft'
431+
product: 'OMSGallery/Security'
432+
promotionCode: ''
433+
}
434+
properties: {
435+
workspaceResourceId: logAnalyticsWorkspaceResourceId
436+
}
437+
}
438+
425439
var dataCollectionRulesResourceName = 'dcr-${solutionSuffix}'
426440
var dataCollectionRulesLocation = useExistingLogAnalytics
427441
? existingLogAnalyticsWorkspace!.location
428442
: logAnalyticsWorkspace!.outputs.location
429443
module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-rule:0.11.0' = if (enablePrivateNetworking && enableMonitoring) {
430444
name: take('avm.res.insights.data-collection-rule.${dataCollectionRulesResourceName}', 64)
445+
dependsOn: [securitySolution]
431446
params: {
432447
name: dataCollectionRulesResourceName
433448
tags: tags
@@ -497,7 +512,7 @@ module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-
497512
{
498513
name: 'SecurityAuditEvents'
499514
streams: [
500-
'Microsoft-WindowsEvent'
515+
'Microsoft-SecurityEvent'
501516
]
502517
xPathQueries: [
503518
'Security!*[System[(EventID=4624 or EventID=4625)]]'
@@ -524,6 +539,14 @@ module windowsVmDataCollectionRules 'br/public:avm/res/insights/data-collection-
524539
transformKql: 'source'
525540
outputStream: 'Microsoft-Perf'
526541
}
542+
{
543+
streams: [
544+
'Microsoft-SecurityEvent'
545+
]
546+
destinations: [
547+
'la-${dataCollectionRulesResourceName}'
548+
]
549+
}
527550
]
528551
}
529552
}

infra/modules/storageAccount.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module storageAccount 'br/public:avm/res/storage/storage-account:0.32.0' = {
5858
allowSharedKeyAccess: false
5959
allowCrossTenantReplication: false
6060
minimumTlsVersion: 'TLS1_2'
61-
requireInfrastructureEncryption: false
61+
requireInfrastructureEncryption: true
6262
keyType: 'Service'
6363
enableHierarchicalNamespace: false
6464
enableNfsV3: false

0 commit comments

Comments
 (0)