-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathConfigureWindowsEventLogs.ps1
902 lines (812 loc) · 40.6 KB
/
ConfigureWindowsEventLogs.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2023 v5.8.223
Created on: 2023-06-15 23:04
Created by: Andrew Rathbun
===========================================================================
.DESCRIPTION
This is a PowerShell 5 adaptation of Yamamoto Security's YamatoSecurityConfigureWinEventLogs.bat which can be found below
.LINK
https://github.com/Yamato-Security/EnableWindowsLogSettings/blob/main/YamatoSecurityConfigureWinEventLogs.bat
.FEATURES
Logging to a file on disk
Confirmation that values set were actually set before telling the end user they were set.
Messages that indicate values weren't set successfully
Sections of the original batch file have been organized into PowerShell functions for ease of readability and maintainability
.CHANGELOG
v1.0 - June 16, 2023 - Initial release/adapation to PowerShell 5
#>
# This script requires admin privileges to run properly
# Checking if the current user is an admin, if not, it will request elevation
$currentUser = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
$isAdmin = $currentUser.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
if ($isAdmin -eq $false)
{
# Relaunch script with admin privileges
$scriptPath = $MyInvocation.MyCommand.Path
Start-Process powershell.exe -Verb RunAs -ArgumentList "-File `"$scriptPath`""
exit
}
# Set the location for the log file in a variable
$logFile = "$PSScriptRoot\ConfigureWindowsEventLogs.log"
function Get-TimeStamp
{
<#
.SYNOPSIS
This function returns the current time in the format of YYYY/MM/dd HH:mm:ss
#>
return "[{0:yyyy/MM/dd} {0:HH:mm:ss}]" -f (Get-Date)
}
function Log
{
param
(
[Parameter(Mandatory = $true,
Position = 1,
HelpMessage = 'Please specify the log file to append to')]
[string]$logFile,
[Parameter(Mandatory = $true,
Position = 2,
HelpMessage = 'Please specify the message to write to host and the specified log file')]
[string]$msg,
[Parameter(Mandatory = $false,
Position = 3,
HelpMessage = 'Please specify the level of the log message')]
[ValidateSet("Info", "Warning", "Error")]
[string]$level = "Info"
)
$timestamp = Get-TimeStamp
$logMessage = "$timestamp | $level | $msg"
# Write message to log file
Add-Content -Path $logFile -Value $logMessage -Encoding ASCII
# Display message based on log level
switch ($level)
{
'Info' { Write-Host $logMessage -ForegroundColor Cyan }
'Warning' { Write-Host $logMessage -ForegroundColor Yellow }
'Error' { Write-Host $logMessage -ForegroundColor Red }
}
# Log -logFile $logFile -msg "----- Beginning of Session -----" -level "Info"
# Log -logFile $logFile -msg "FYI: no CSVs were located in the specified folder path" -level "Warning"
# Log -logFile $logFile -msg "Something went wrong" -level "Error"
}
Log -logFile $logFile -msg "----- Beginning of Session -----" -level "Info"
# Increase or decrease the log sizes as you see fit (in bytes of 64kb blocks):
# Using technical terms here: 1 mebibyte = 1024 kibibytes | 1 megabyte = 1000 kilobytes
$2GB = '2147483648' # 2147483648 bytes = 2048 mebibytes = 2 gibibytes
$1GB = '1073741824' # 1073741824 bytes = 1024 mebibytes = 1 gibibyte
$512MB = '536870912' # 536870912 bytes = 512 mebibytes = .5 gibibyte
$256MB = '268435456' # 268435456 bytes = 256 mebibytes = .25 gibibyte
$128MB = '134217728' # 134217728 bytes = 128 mebibytes = .125 gibibyte
$2GBCommand = '/ms:' + $2GB
$1GBCommand = '/ms:' + $1GB
$512MBCommand = '/ms:' + $512MB
$256MBCommand = '/ms:' + $256MB
$128MBCommand = '/ms:' + $128MB
function Expand-EventLogSize
{
[CmdletBinding()]
param ()
Log -logFile $logFile -msg "------- Increase Event Log MaxSize Values -------" -level "Info"
# Set Security, Sysmon, and PowerShell-related logs' maximum file size to 1 GB
$1gbLogNames = "Security", "Microsoft-Windows-PowerShell/Operational", "Windows PowerShell", "PowerShellCore/Operational", "Microsoft-Windows-Sysmon/Operational"
# Get a list of all log names
$allLogNames = (Get-WinEvent -ListLog *).LogName
# List to store names of non-existent logs
$nonExistent1GBLogs = @()
foreach ($1gbLogName in $1gbLogNames)
{
# Check if the log exists
if ($allLogNames -contains $1gbLogName)
{
Log -logFile $logFile -msg "Modifying the maximum size for the ${1gbLogName} event log"
# Fetch the current maximum size
$currentMaxSizeBytes = ((wevtutil gl $1gbLogName) -like "*maxSize:*").Split(':')[1].Trim()
# Convert to KB and MB
$currentMaxSizeKB = [math]::Round(($currentMaxSizeBytes / 1KB), 2)
$currentMaxSizeMB = [math]::Round(($currentMaxSizeBytes / 1MB), 2)
# Inform the user about the current maximum size
Log -logFile $logFile -msg "Current maximum size of ${1gbLogName}: $currentMaxSizeBytes bytes | $currentMaxSizeKB KB | $currentMaxSizeMB MB"
# Define the command string
$commandString = "wevtutil sl `"$1gbLogName`" $1GBCommand"
# Inform the user about the command that will be executed
Log -logFile $logFile -msg "Running command: $commandString"
# Execute the command
Invoke-Expression -Command $commandString
# Fetch the updated maximum size
$updatedMaxSizeBytes = ((wevtutil gl $1gbLogName) -like "*maxSize:*").Split(':')[1].Trim()
# Convert to KB and MB
$updatedMaxSizeKB = [math]::Round(($updatedMaxSizeBytes / 1KB), 2)
$updatedMaxSizeMB = [math]::Round(($updatedMaxSizeBytes / 1MB), 2)
# Inform the user about the updated maximum size
Log -logFile $logFile -msg "Updated maximum size of ${1gbLogName}: $updatedMaxSizeBytes bytes | $updatedMaxSizeKB KB | $updatedMaxSizeMB MB"
}
else
{
# Add to non-existent logs list
$nonExistent1GBLogs += $1gbLogName
}
}
# Output non-existent logs
if ($nonExistent1GBLogs.Count -gt 0)
{
$nonExistent1GBLogsString = $nonExistent1GBLogs -join ', '
Log -logFile $logFile -msg "The following logs were attempted but do not currently exist: $nonExistent1GBLogsString"
}
# Define the 128 MB log names
$128mblogNames = "System", "Application", "Microsoft-Windows-Windows Defender/Operational", "Microsoft-Windows-Bits-Client/Operational",
"Microsoft-Windows-Windows Firewall With Advanced Security/Firewall", "Microsoft-Windows-NTLM/Operational",
"Microsoft-Windows-Security-Mitigations/KernelMode", "Microsoft-Windows-Security-Mitigations/UserMode",
"Microsoft-Windows-PrintService/Admin", "Microsoft-Windows-Security-Mitigations/UserMode",
"Microsoft-Windows-PrintService/Operational", "Microsoft-Windows-SmbClient/Security",
"Microsoft-Windows-AppLocker/MSI and Script", "Microsoft-Windows-AppLocker/EXE and DLL",
"Microsoft-Windows-AppLocker/Packaged app-Deployment", "Microsoft-Windows-AppLocker/Packaged app-Execution",
"Microsoft-Windows-CodeIntegrity/Operational", "Microsoft-Windows-Diagnosis-Scripted/Operational",
"Microsoft-Windows-DriverFrameworks-UserMode/Operational", "Microsoft-Windows-WMI-Activity/Operational",
"Microsoft-Windows-TerminalServices-LocalSessionManager/Operational", "Microsoft-Windows-TaskScheduler/Operational"
# Define the list for non-existent logs
$nonExistent128MBLogs = @()
foreach ($128mblogName in $128mblogNames)
{
# Check if the log exists
if ($allLogNames -contains $128mblogName)
{
# Fetch the current maximum size
$currentMaxSizeBytes = ((wevtutil gl $128mblogName) -like "*maxSize:*").Split(':')[1].Trim()
# Convert to KB and MB
$currentMaxSizeKB = [math]::Round(($currentMaxSizeBytes / 1KB), 2)
$currentMaxSizeMB = [math]::Round(($currentMaxSizeBytes / 1MB), 2)
# Inform the user about the current maximum size
Log -logFile $logFile -msg "Current maximum size of ${128mblogName}: $currentMaxSizeBytes bytes | $currentMaxSizeKB KB | $currentMaxSizeMB MB"
# Define the command string
$commandString = "wevtutil sl `"$128mblogName`" $128MBCommand"
# Inform the user about the command that will be executed
Log -logFile $logFile -msg "Running command: $commandString"
# Execute the command
Invoke-Expression -Command $commandString
# Fetch the updated maximum size
$updatedMaxSizeBytes = ((wevtutil gl $128mblogName) -like "*maxSize:*").Split(':')[1].Trim()
# Convert to KB and MB
$updatedMaxSizeKB = [math]::Round(($updatedMaxSizeBytes / 1KB), 2)
$updatedMaxSizeMB = [math]::Round(($updatedMaxSizeBytes / 1MB), 2)
# Inform the user about the updated maximum size
Log -logFile $logFile -msg "Updated maximum size of ${128mblogName}: $updatedMaxSizeBytes bytes | $updatedMaxSizeKB KB | $updatedMaxSizeMB MB"
}
else
{
# Add the log name to the non-existent logs list
$nonExistent128MBLogs += $128mblogName
}
}
# Inform the user if any logs did not exist
if ($nonExistent128MBLogs.Count -gt 0)
{
$nonExistent128MBLogsString = $nonExistent128MBLogs -join ', '
Log -logFile $logFile -msg "The following logs were attempted but do not currently exist: $nonExistent128MBLogsString"
}
}
function Expand-PowerShellLogging
{
[CmdletBinding()]
param ()
Log -logFile $logFile -msg "------- Enable PowerShell Logging -------" -level "Info"
try
{
$powerShellModuleLoggingPath = 'HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ModuleLogging'
$powerShellModuleLoggingValueName = 'EnableModuleLogging'
# Check if the path exists before trying to modify it
if (Test-Path $powerShellModuleLoggingPath)
{
# Check if ModuleLogging is enabled
if ((Get-ItemProperty -Path $powerShellModuleLoggingPath -Name $powerShellModuleLoggingValueName).$powerShellModuleLoggingValueName -eq 1)
{
Log -logFile $logFile -msg "PowerShell Module logging ($powerShellModuleLoggingValueName) is already enabled"
}
else
{
# Enable PowerShell Module logging
Set-ItemProperty -Path $powerShellModuleLoggingPath -Name $powerShellModuleLoggingValueName -Value 1 -ErrorAction Stop
Log -logFile $logFile -msg "PowerShell Module logging enabled"
}
}
else
{
Log -logFile $logFile -msg "Registry path $powerShellModuleLoggingPath does not currently exist"
# Check the state of MicrosoftWindowsPowerShellV2Root feature
$featureState = (Get-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root).State
if ($featureState -eq "Disabled")
{
Log -logFile $logFile -msg "MicrosoftWindowsPowerShellV2Root feature is currently disabled"
# Enable MicrosoftWindowsPowerShellV2Root feature
Enable-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root -ErrorAction Stop
# Verify the state of MicrosoftWindowsPowerShellV2Root feature after enabling
$newFeatureState = (Get-WindowsOptionalFeature -Online -FeatureName MicrosoftWindowsPowerShellV2Root).State
if ($newFeatureState -eq "Enabled")
{
Log -logFile $logFile -msg "MicrosoftWindowsPowerShellV2Root feature has been enabled"
# Check if the path exists again and enable PowerShell Module logging
if (Test-Path $powerShellModuleLoggingPath)
{
Set-ItemProperty -Path $powerShellModuleLoggingPath -Name $powerShellModuleLoggingValueName -Value 1 -ErrorAction Stop
Log -logFile $logFile -msg "PowerShell Module logging enabled"
}
else
{
Log -logFile $logFile -msg "Registry path $powerShellModuleLoggingPath still does not exist even after enabling the feature"
}
}
else
{
Log -logFile $logFile -msg "Failed to enable MicrosoftWindowsPowerShellV2Root feature"
}
}
else
{
Log -logFile $logFile -msg "MicrosoftWindowsPowerShellV2Root feature is already enabled"
# Check if the path exists again and enable PowerShell Module logging
if (Test-Path $powerShellModuleLoggingPath)
{
Set-ItemProperty -Path $powerShellModuleLoggingPath -Name $powerShellModuleLoggingValueName -Value 1 -ErrorAction Stop
Log -logFile $logFile -msg "PowerShell Module logging enabled"
}
else
{
Log -logFile $logFile -msg "Registry path $powerShellModuleLoggingPath still does not exist even though the feature is enabled"
}
}
}
}
catch
{
$errorMessage = $_.Exception.Message
Log -logFile $logFile -msg "Error occurred: $errorMessage" -level "Error"
}
try
{
$powerShellModuleLoggingModuleNamesPath = 'HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ModuleLogging\ModuleNames'
# Check if the path exists before trying to modify it
if (Test-Path $powerShellModuleLoggingModuleNamesPath)
{
# Check if all modules are now logged
if ((Get-ItemProperty -Path $powerShellModuleLoggingModuleNamesPath -Name '*').'*' -eq "*")
{
Log -logFile $logFile -msg "All modules are now logged in PowerShell Module logging"
}
else
{
Log -logFile $logFile -msg "Failed to log all modules in PowerShell Module logging"
}
}
else
{
Log -logFile $logFile -msg "Registry path $powerShellModuleLoggingModuleNamesPath does not currently exist"
New-Item -Path $powerShellModuleLoggingModuleNamesPath -Force | Out-Null
Set-ItemProperty -Path $powerShellModuleLoggingModuleNamesPath -Name "*" -Value "*" -ErrorAction Stop
Log -logFile $logFile -msg "All modules are now logged in PowerShell Module logging"
# Check if the path exists again and validate if all modules are logged
if (Test-Path $powerShellModuleLoggingModuleNamesPath)
{
$loggedModules = (Get-ItemProperty -Path $powerShellModuleLoggingModuleNamesPath -Name '*').'*'
if ($loggedModules -eq "*")
{
Log -logFile $logFile -msg "All modules are now logged in PowerShell Module logging"
}
else
{
Log -logFile $logFile -msg "Failed to log all modules in PowerShell Module logging"
}
}
else
{
Log -logFile $logFile -msg "Registry path $powerShellModuleLoggingModuleNamesPath still does not exist even after attempting to create it"
}
}
}
catch
{
$errorMessage = $_.Exception.Message
Log -logFile $logFile -msg "Error occurred: $errorMessage" -level "Error"
}
try
{
$powerShellScriptBlockLoggingPath = 'HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\PowerShell\ScriptBlockLogging'
$powerShellScriptBlockLoggingValueName = 'EnableScriptBlockLogging'
# Check if the path exists before trying to modify it
if (Test-Path $powerShellScriptBlockLoggingPath)
{
# Enable PowerShell Script Block logging
Set-ItemProperty -Path $powerShellScriptBlockLoggingPath -Name $powerShellScriptBlockLoggingValueName -Value 1 -ErrorAction Stop
# Check if ScriptBlockLogging is enabled
if ((Get-ItemProperty -Path $powerShellScriptBlockLoggingPath -Name $powerShellScriptBlockLoggingValueName).$powerShellScriptBlockLoggingValueName -eq 1)
{
Log -logFile $logFile -msg "PowerShell Script Block logging enabled"
}
else
{
Log -logFile $logFile -msg "Failed to enable PowerShell Script Block logging"
}
}
else
{
Log -logFile $logFile -msg "Registry path $powerShellScriptBlockLoggingPath does not exist"
}
}
catch
{
$errorMessage = $_.Exception.Message
Log -logFile $logFile -msg "Error occurred: $errorMessage" -level "Error"
}
}
function Enable-EventLogs
{
[CmdletBinding()]
param ()
Log -logFile $logFile -msg "------- Enable Event Logs -------" -level "Info"
try
{
# Define an array with the log names
$logs = @("Microsoft-Windows-TaskScheduler/Operational", "Microsoft-Windows-DriverFrameworks-UserMode/Operational")
# Loop over each log name
foreach ($log in $logs)
{
try
{
# Enable the log
& wevtutil sl $log /e:true
# Check if the log was enabled
$isEnabled = & wevtutil gl $log | Select-String -Pattern "enabled:"
if ($isEnabled -match "true")
{
Log -logFile $logFile -msg "$log has been enabled"
}
else
{
Log -logFile $logFile -msg "Failed to enable $log"
}
}
catch
{
# Handle the error appropriately, for example, log the error message
$errorMessage = $_.Exception.Message
Log -logFile $logFile -msg "Error occurred while enabling $([string]$log): $errorMessage" -level "Error"
}
}
}
catch
{
# Handle the error appropriately, for example, log the error message
$errorMessage = $_.Exception.Message
Log -logFile $logFile -msg "Error occurred: $errorMessage" -level "Error"
}
}
function Enable-CommandLineAuditing
{
[CmdletBinding()]
param ()
Log -logFile $logFile -msg "------- Enable Command Line Auditing -------" -level "Info"
$commandLineAuditingPath = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\Audit'
$commandLineAuditingValueName = 'ProcessCreationIncludeCmdLine_Enabled'
# Enable command line auditing
Set-ItemProperty -Path "$commandLineAuditingPath" -Name "$commandLineAuditingValueName" -Value 1 -Type DWord -Force
# Check if command line auditing was enabled
if ((Get-ItemProperty -Path "$commandLineAuditingPath").$commandLineAuditingValueName -eq 1)
{
Log -logFile $logFile -msg "Command line auditing enabled successfully"
}
else
{
Log -logFile $logFile -msg "Failed to enable command line auditing"
}
}
function Enable-AuditPolicies
{
[CmdletBinding()]
param ()
Log -logFile $logFile -msg "------- Enable Audit Policies -------" -level "Info"
# Define a hashtable for each category, with the GUIDs as the keys and the category names as the values
$AccountLogon = @{
"0CCE923F-69AE-11D9-BED3-505054503030" = "Credential Validation"
"0CCE9242-69AE-11D9-BED3-505054503030" = "Kerberos Authentication Service"
"0CCE9240-69AE-11D9-BED3-505054503030" = "Kerberos Service Ticket Operations"
}
$AccountManagement = @{
"0CCE9236-69AE-11D9-BED3-505054503030" = "Computer Account Management"
"0CCE923A-69AE-11D9-BED3-505054503030" = "Other Account Management Events"
"0CCE9237-69AE-11D9-BED3-505054503030" = "Security Group Management"
"0CCE9235-69AE-11D9-BED3-505054503030" = "User Account Management"
}
$DetailedTracking = @{
'0cce9248-69ae-11d9-bed3-505054503030' = 'Plug and Play';
'0CCE922B-69AE-11D9-BED3-505054503030' = 'Process Creation';
# '0CCE922C-69AE-11D9-BED3-505054503030' = 'Process Termination'; # disabled by default
'0CCE922E-69AE-11D9-BED3-505054503030' = 'RPC Events';
# '0CCE924A-69AE-11D9-BED3-505054503030' = 'Audit Token Right Adjustments'; # disabled by default
}
$DSAccess = @{
'0CCE923B-69AE-11D9-BED3-505054503030' = 'Directory Service Access';
'0CCE923C-69AE-11D9-BED3-505054503030' = 'Directory Service Changes';
}
$LogonLogoff = @{
'0CCE9217-69AE-11D9-BED3-505054503030' = 'Account Lockout';
# '0CCE9249-69AE-11D9-BED3-505054503030' = 'Group Membership'; # disabled by default
'0CCE9216-69AE-11D9-BED3-505054503030' = 'Logoff';
'0CCE9215-69AE-11D9-BED3-505054503030' = 'Logon';
# '0CCE9243-69AE-11D9-BED3-505054503030' = 'Network Policy Server'; # disabled by default
'0CCE921C-69AE-11D9-BED3-505054503030' = 'Other Logon/Logoff Events';
'0CCE921B-69AE-11D9-BED3-505054503030' = 'Special Logon';
}
$ObjectAccess = @{
# '0CCE9222-69AE-11D9-BED3-505054503030' = 'Application Generated'; # currently disabled while testing
'0CCE9221-69AE-11D9-BED3-505054503030' = 'Certification Services'; # disable for client OSes
# '0CCE9244-69AE-11D9-BED3-505054503030' = 'Detailed File Share'; # disabled by default
'0CCE9224-69AE-11D9-BED3-505054503030' = 'File Share'; # disable if too noisy
# '0CCE921D-69AE-11D9-BED3-505054503030' = 'File System'; # disabled by default
'0CCE9226-69AE-11D9-BED3-505054503030' = 'Filtering Platform Connection'; # disable if too noisy
# '0CCE9225-69AE-11D9-BED3-505054503030' = 'Filtering Platform Packet Drop'; # disabled due to noise
# '0CCE921F-69AE-11D9-BED3-505054503030' = 'Kernel Object'; # disabled due to noise
'0CCE9227-69AE-11D9-BED3-505054503030' = 'Other Object Access Events';
# '0CCE921E-69AE-11D9-BED3-505054503030' = 'Registry'; # disabled due to noise
'0CCE9245-69AE-11D9-BED3-505054503030' = 'Removable Storage';
'0CCE9220-69AE-11D9-BED3-505054503030' = 'SAM';
}
$PolicyChange = @{
'0CCE922F-69AE-11D9-BED3-505054503030' = 'Audit Policy Change';
'0CCE9230-69AE-11D9-BED3-505054503030' = 'Authentication Policy Change';
# '0CCE9231-69AE-11D9-BED3-505054503030' = 'Authorization Policy Change'; # currently disabled while testing
# '0CCE9233-69AE-11D9-BED3-505054503030' = 'Filtering Platform Policy Change'; # currently disabled while testing
# '0CCE9232-69AE-11D9-BED3-505054503030' = 'MPSSVC Rule-Level Policy Change'; # currently disabled while testing
'0CCE9234-69AE-11D9-BED3-505054503030' = 'Other Policy Change Events';
}
$PrivilegeUse = @{
'0CCE9228-69AE-11D9-BED3-505054503030' = 'Sensitive Privilege Use'; # disable if too noisy
}
$System = @{
'0CCE9214-69AE-11D9-BED3-505054503030' = 'Other System Events'; # needs testing
'0CCE9210-69AE-11D9-BED3-505054503030' = 'Security State Change';
'0CCE9211-69AE-11D9-BED3-505054503030' = 'Security System Extension';
'0CCE9212-69AE-11D9-BED3-505054503030' = 'System Integrity';
}
# Combine all categories into one array
$allCategories = @{
'AccountLogon' = $AccountLogon
'AccountManagement' = $AccountManagement
'DetailedTracking' = $DetailedTracking
'DSAccess' = $DSAccess
'LogonLogoff' = $LogonLogoff
'ObjectAccess' = $ObjectAccess
'PolicyChange' = $PolicyChange
'PrivilegeUse' = $PrivilegeUse
'System' = $System
}
foreach ($categoryName in $allCategories.Keys)
{
$category = $allCategories[$categoryName]
Log -logFile $logFile -msg "Category: $categoryName"
foreach ($subcategory in $category.Keys)
{
$subcategoryName = $category[$subcategory]
Log -logFile $logFile -msg "Subcategory: $subcategory"
Log -logFile $logFile -msg "Subcategory Name: $subcategoryName"
try
{
# Prepare auditpol set command
$auditpolCommand = "/c auditpol /set /subcategory:`"{${subcategory}}`" /success:enable /failure:enable"
# Output the command to be run
Log -logFile $logFile -msg "Running command: cmd $auditpolCommand"
# Run the command
cmd $auditpolCommand
# Prepare auditpol get command for validation
$validationCommand = "/c auditpol /get /subcategory:`"{${subcategory}}`" /r"
# Output the command to be run
Log -logFile $logFile -msg "Running validation command: cmd $validationCommand"
# Run validation command
$validationResult = cmd $validationCommand
# Ensure the command output is an array, even if it only contains one line
if ($validationResult -isnot [array]) { $validationResult = @($validationResult) }
# Check if there are at least three lines
if ($validationResult.Count -gt 2)
{
# Extract the "Inclusion Setting" from the third line of the output
$thirdLine = $validationResult[2]
$inclusionSetting = ($thirdLine -split ',')[4].Trim()
Log -logFile $logFile -msg "Inclusion Setting for $($subcategoryName): $inclusionSetting"
if ($inclusionSetting -eq "Success and Failure")
{
Log -logFile $logFile -msg "Both successful and failure events are now being audited for the $($subcategoryName) subcategory"
}
else
{
Log -logFile $logFile -msg "Failed to enable auditing for the $($subcategoryName) subcategory"
}
}
else
{
Log -logFile $logFile -msg "Failed to retrieve auditing settings for the $($subcategoryName) subcategory"
}
}
catch
{
Log -logFile $logFile -msg "An error occurred while enabling auditing for the $($subcategoryName) subcategory: $_"
}
}
}
}
try
{
# Code block to be executed within the try block
Expand-EventLogSize
Expand-PowerShellLogging
Enable-EventLogs
Enable-CommandLineAuditing
Enable-AuditPolicies
}
catch [System.IO.IOException] {
# Handle specific IOException related to file operations
Log -logFile $logFile -msg "IOException occurred: $($_.Message)" -level "Error"
}
catch [System.Exception] {
# Handle any other exception that may have occurred
Log -logFile $logFile -msg "Exception occurred: $($_.Exception.Message)" -level "Error"
}
finally
{
# This block will always run, even if there was an exception
Log -logFile $logFile -msg "------- End of Session -------" -level "Info"
}
# SIG # Begin signature block
# MIIviwYJKoZIhvcNAQcCoIIvfDCCL3gCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCC8iQszcaaiQENc
# I8g6Ip4wWwriG6gICvzyfbU1HBn11aCCKJAwggQyMIIDGqADAgECAgEBMA0GCSqG
# SIb3DQEBBQUAMHsxCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNo
# ZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1p
# dGVkMSEwHwYDVQQDDBhBQUEgQ2VydGlmaWNhdGUgU2VydmljZXMwHhcNMDQwMTAx
# MDAwMDAwWhcNMjgxMjMxMjM1OTU5WjB7MQswCQY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