-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest-HuntressAuditPolicy.ps1
More file actions
1175 lines (1033 loc) · 50.7 KB
/
Copy pathTest-HuntressAuditPolicy.ps1
File metadata and controls
1175 lines (1033 loc) · 50.7 KB
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
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<#
.SYNOPSIS
Validates local Advanced Audit Policy settings against the Huntress baseline.
.DESCRIPTION
Compares the output of AuditPol with the Huntress Managed SIEM audit policy
baseline defined in this repository. The script can either run AuditPol
locally or parse previously-saved AuditPol output from a file.
When run live on a Windows host, the script also attempts lightweight
policy source analysis by:
- Comparing effective AuditPol results with the Local Group Policy
advanced audit policy file, if present
- Collecting gpresult computer-scope context to show applied computer GPOs
This helps distinguish likely Local Group Policy drift from settings that
are more likely being delivered by a domain GPO or manual auditpol changes.
Supported input formats:
- Standard table output from: auditpol /get /category:*
- CSV output from: auditpol /get /category:* /r
Conditional settings:
- Process Creation defaults to No Auditing unless -NoHuntressEDR is used
- Certification Services defaults to No Auditing unless -HasADCS is used
.PARAMETER Path
Optional path to a saved AuditPol output file. If omitted, the script runs
"auditpol /get /category:*" locally.
.PARAMETER InputFormat
Explicitly set the input format. Default: Auto
.PARAMETER NoHuntressEDR
Validates against the no-EDR baseline, where Process Creation is Success.
.PARAMETER HasADCS
Validates against the AD CS baseline, where Certification Services is
Success and Failure.
.PARAMETER PassThru
Returns the comparison object in addition to the human-readable summary.
.PARAMETER FailOnExtra
Treat additional parsed AuditPol subcategories not present in the Huntress
baseline as a failure. By default they are reported informationally only.
.EXAMPLE
.\Test-HuntressAuditPolicy.ps1
.EXAMPLE
.\Test-HuntressAuditPolicy.ps1 -Path .\auditpol.txt
.EXAMPLE
auditpol /get /category:* /r > .\auditpol.csv
.\Test-HuntressAuditPolicy.ps1 -Path .\auditpol.csv -InputFormat Csv
.NOTES
Reference:
https://support.huntress.io/hc/en-us/articles/49363914702867
Author: Andrew Yager / RWTS
Version: 1.0
Date: 2026-04-16
#>
[CmdletBinding()]
param(
[string]$Path,
[ValidateSet('Auto', 'Table', 'Csv')]
[string]$InputFormat = 'Auto',
[switch]$NoHuntressEDR,
[switch]$HasADCS,
[switch]$PassThru,
[switch]$FailOnExtra
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$processCreationValue = if ($NoHuntressEDR) { 1 } else { 0 }
$certServicesValue = if ($HasADCS) { 3 } else { 0 }
$auditSettings = @(
@{ Name = "Credential Validation"; Value = 3 }
@{ Name = "Kerberos Authentication Service"; Value = 3 }
@{ Name = "Kerberos Service Ticket Operations"; Value = 3 }
@{ Name = "Other Account Logon Events"; Value = 0 }
@{ Name = "Application Group Management"; Value = 0 }
@{ Name = "Computer Account Management"; Value = 3 }
@{ Name = "Distribution Group Management"; Value = 3 }
@{ Name = "Other Account Management Events"; Value = 1 }
@{ Name = "Security Group Management"; Value = 3 }
@{ Name = "User Account Management"; Value = 3 }
@{ Name = "DPAPI Activity"; Value = 0 }
@{ Name = "Plug and Play Events"; Value = 1 }
@{ Name = "Process Creation"; Value = $processCreationValue }
@{ Name = "Process Termination"; Value = 0 }
@{ Name = "RPC Events"; Value = 0 }
@{ Name = "Token Right Adjusted Events"; Value = 0 }
@{ Name = "Detailed Directory Service Replication"; Value = 0 }
@{ Name = "Directory Service Access"; Value = 3 }
@{ Name = "Directory Service Changes"; Value = 1 }
@{ Name = "Directory Service Replication"; Value = 0 }
@{ Name = "Account Lockout"; Value = 2 }
@{ Name = "User / Device Claims"; Value = 0 }
@{ Name = "Group Membership"; Value = 0 }
@{ Name = "IPsec Extended Mode"; Value = 0 }
@{ Name = "IPsec Main Mode"; Value = 0 }
@{ Name = "IPsec Quick Mode"; Value = 0 }
@{ Name = "Logoff"; Value = 1 }
@{ Name = "Logon"; Value = 3 }
@{ Name = "Network Policy Server"; Value = 3 }
@{ Name = "Other Logon/Logoff Events"; Value = 3 }
@{ Name = "Special Logon"; Value = 1 }
@{ Name = "Application Generated"; Value = 0 }
@{ Name = "Certification Services"; Value = $certServicesValue }
@{ Name = "Detailed File Share"; Value = 3 }
@{ Name = "File Share"; Value = 3 }
@{ Name = "File System"; Value = 0 }
@{ Name = "Filtering Platform Connection"; Value = 2 }
@{ Name = "Filtering Platform Packet Drop"; Value = 0 }
@{ Name = "Handle Manipulation"; Value = 0 }
@{ Name = "Kernel Object"; Value = 3 }
@{ Name = "Other Object Access Events"; Value = 3 }
@{ Name = "Registry"; Value = 0 }
@{ Name = "Removable Storage"; Value = 3 }
@{ Name = "SAM"; Value = 0 }
@{ Name = "Central Policy Staging"; Value = 0 }
@{ Name = "Audit Policy Change"; Value = 1 }
@{ Name = "Authentication Policy Change"; Value = 1 }
@{ Name = "Authorization Policy Change"; Value = 1 }
@{ Name = "Filtering Platform Policy Change"; Value = 1 }
@{ Name = "MPSSVC Rule-Level Policy Change"; Value = 3 }
@{ Name = "Other Policy Change Events"; Value = 3 }
@{ Name = "Non Sensitive Privilege Use"; Value = 0 }
@{ Name = "Other Privilege Use Events"; Value = 0 }
@{ Name = "Sensitive Privilege Use"; Value = 3 }
@{ Name = "IPsec Driver"; Value = 0 }
@{ Name = "Other System Events"; Value = 3 }
@{ Name = "Security State Change"; Value = 1 }
@{ Name = "Security System Extension"; Value = 1 }
@{ Name = "System Integrity"; Value = 3 }
)
function Convert-AuditValueToText {
param([int]$Value)
switch ($Value) {
0 { "No Auditing" }
1 { "Success" }
2 { "Failure" }
3 { "Success and Failure" }
default { throw "Unsupported audit value: $Value" }
}
}
function Convert-AuditTextToValue {
param([string]$Text)
$normalized = if ($null -eq $Text) { '' } else { $Text.Trim() }
switch -Regex ($normalized) {
'^No Auditing$' { return 0 }
'^Success$' { return 1 }
'^Failure$' { return 2 }
'^Success and Failure$' { return 3 }
default { throw "Unsupported audit setting text: '$Text'" }
}
}
function Get-NormalizedSubcategoryName {
param([string]$Subcategory)
if ([string]::IsNullOrWhiteSpace($Subcategory)) {
return ''
}
return (($Subcategory -replace '^Audit\s+', '').Trim())
}
function Get-ExpectedAuditMap {
$map = @{}
foreach ($setting in $script:auditSettings) {
$map[(Get-NormalizedSubcategoryName -Subcategory $setting.Name)] = [pscustomobject]@{
Name = $setting.Name
Value = [int]$setting.Value
ValueText = Convert-AuditValueToText -Value ([int]$setting.Value)
}
}
return $map
}
function Get-AuditDifferenceClassification {
param(
[int]$ExpectedValue,
[int]$ActualValue
)
if ($ExpectedValue -eq $ActualValue) {
return [pscustomobject]@{
Classification = 'Match'
Summary = 'Matches baseline'
}
}
$hasAllExpectedBits = (($ActualValue -band $ExpectedValue) -eq $ExpectedValue)
$hasOnlyExpectedBits = (($ActualValue -band (-bnot $ExpectedValue)) -eq 0)
if ($hasAllExpectedBits -and -not $hasOnlyExpectedBits) {
return [pscustomobject]@{
Classification = 'Over-auditing only'
Summary = 'Logs all expected events plus additional ones'
}
}
if ($hasOnlyExpectedBits -and -not $hasAllExpectedBits) {
return [pscustomobject]@{
Classification = 'Under-auditing'
Summary = 'Missing part or all of the expected audit coverage'
}
}
return [pscustomobject]@{
Classification = 'Different mode'
Summary = 'Misses expected coverage and also logs an unexpected mode'
}
}
function Resolve-InputFormat {
param(
[string]$Content,
[string]$DeclaredFormat
)
if ($DeclaredFormat -ne 'Auto') {
return $DeclaredFormat
}
$trimmed = if ($null -eq $Content) { '' } else { $Content.TrimStart([char[]]@([char]0xFEFF, [char]0xFFFE, [char]32, [char]9, [char]13, [char]10)) }
if ($trimmed -match '^(Machine Name|\"Machine Name\")\s*,') {
return 'Csv'
}
return 'Table'
}
function Get-AuditRowsFromCsv {
param([string]$Content)
$rows = $Content | ConvertFrom-Csv
$parsedRows = [System.Collections.Generic.List[object]]::new()
foreach ($row in $rows) {
$name = Get-NormalizedSubcategoryName -Subcategory $row.Subcategory
if ([string]::IsNullOrWhiteSpace($name)) {
continue
}
$settingText = if (-not [string]::IsNullOrWhiteSpace($row.'Inclusion Setting')) {
$row.'Inclusion Setting'
} elseif (-not [string]::IsNullOrWhiteSpace($row.'Setting Value')) {
Convert-AuditValueToText -Value ([int]$row.'Setting Value')
} else {
throw "Unable to determine audit setting for subcategory '$name' from CSV input."
}
$parsedRows.Add([pscustomobject]@{
Name = $name
Value = Convert-AuditTextToValue -Text $settingText
ValueText = Convert-AuditValueToText -Value (Convert-AuditTextToValue -Text $settingText)
})
}
return @($parsedRows)
}
function Get-AuditRowsFromTable {
param([string]$Content)
$parsedRows = [System.Collections.Generic.List[object]]::new()
$lines = $Content -split "`r?`n"
foreach ($line in $lines) {
$trimmed = $line.Trim()
if ([string]::IsNullOrWhiteSpace($trimmed)) {
continue
}
if ($trimmed -match '^(System audit policy|Category/Subcategory|Machine Name|Policy Target)\b') {
continue
}
if ($trimmed -match '^(Account Logon|Account Management|Detailed Tracking|DS Access|Logon/Logoff|Object Access|Policy Change|Privilege Use|System)$') {
continue
}
if ($trimmed -match '^(No Auditing|Success|Failure|Success and Failure)$') {
continue
}
$match = [regex]::Match(
$line,
'^\s*(?<Subcategory>.+?)\s{2,}(?<Setting>No Auditing|Success and Failure|Success|Failure)\s*$'
)
if (-not $match.Success) {
continue
}
$name = Get-NormalizedSubcategoryName -Subcategory $match.Groups['Subcategory'].Value
$value = Convert-AuditTextToValue -Text $match.Groups['Setting'].Value
$parsedRows.Add([pscustomobject]@{
Name = $name
Value = $value
ValueText = Convert-AuditValueToText -Value $value
})
}
return @($parsedRows)
}
function Get-AuditRows {
param(
[string]$Content,
[string]$Format
)
switch ($Format) {
'Csv' { return @(Get-AuditRowsFromCsv -Content $Content) }
'Table' { return @(Get-AuditRowsFromTable -Content $Content) }
default { throw "Unsupported input format: $Format" }
}
}
function Get-AuditPolContent {
param([string]$InputPath)
if ($InputPath) {
if (-not (Test-Path -LiteralPath $InputPath)) {
throw "Input file not found: $InputPath"
}
return Get-Content -LiteralPath $InputPath -Raw
}
$commandOutput = & auditpol /get /category:*
if ($LASTEXITCODE -ne 0) {
throw "auditpol exited with code $LASTEXITCODE."
}
return ($commandOutput -join [Environment]::NewLine)
}
function Get-LocalAuditPolicyRows {
$localAuditPath = Join-Path $env:SystemRoot 'System32\GroupPolicy\Machine\Microsoft\Windows NT\Audit\audit.csv'
if (-not (Test-Path -LiteralPath $localAuditPath)) {
return [pscustomobject]@{
Available = $false
Path = $localAuditPath
Rows = @()
Error = $null
}
}
try {
$content = Get-Content -LiteralPath $localAuditPath -Raw
return [pscustomobject]@{
Available = $true
Path = $localAuditPath
Rows = @(Get-AuditRows -Content $content -Format 'Csv')
Error = $null
}
}
catch {
return [pscustomobject]@{
Available = $true
Path = $localAuditPath
Rows = @()
Error = $_.Exception.Message
}
}
}
function Get-GpResultComputerSummary {
if ($Path) {
return [pscustomobject]@{
Collected = $false
AppliedGpos = @()
DomainGpos = @()
RawOutput = $null
Error = 'gpresult analysis is only available during live local execution.'
}
}
try {
$output = & gpresult /scope computer /r
if ($LASTEXITCODE -ne 0) {
throw "gpresult exited with code $LASTEXITCODE."
}
$lines = @($output)
$appliedGpos = [System.Collections.Generic.List[string]]::new()
$captureApplied = $false
foreach ($line in $lines) {
$trimmed = $line.Trim()
if ($trimmed -match '^Applied Group Policy Objects\b') {
$captureApplied = $true
continue
}
if ($captureApplied) {
if ([string]::IsNullOrWhiteSpace($trimmed)) {
if ($appliedGpos.Count -gt 0) {
break
}
continue
}
if ($line -notmatch '^\s{2,}') {
break
}
if ($trimmed -ne 'N/A' -and $trimmed -notmatch '^-+$') {
$appliedGpos.Add($trimmed)
}
}
}
$domainGpos = @(
$appliedGpos | Where-Object {
$_ -ne 'Local Group Policy'
}
)
return [pscustomobject]@{
Collected = $true
AppliedGpos = @($appliedGpos)
DomainGpos = @($domainGpos)
RawOutput = ($lines -join [Environment]::NewLine)
Error = $null
}
}
catch {
return [pscustomobject]@{
Collected = $false
AppliedGpos = @()
DomainGpos = @()
RawOutput = $null
Error = $_.Exception.Message
}
}
}
function Get-LdapEscapedValue {
param([string]$Value)
if ($null -eq $Value) {
return ''
}
return ($Value `
-replace '\\', '\5c' `
-replace '\*', '\2a' `
-replace '\(', '\28' `
-replace '\)', '\29' `
-replace [char]0, '\00')
}
function Get-CurrentDomainContext {
try {
$domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetComputerDomain()
$rootDse = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$($domain.Name)/RootDSE")
$domainDn = [string]$rootDse.Properties['defaultNamingContext'][0]
return [pscustomobject]@{
Available = $true
DomainName = $domain.Name
DomainDN = $domainDn
Error = $null
}
}
catch {
return [pscustomobject]@{
Available = $false
DomainName = $null
DomainDN = $null
Error = $_.Exception.Message
}
}
}
function Get-AppliedGpoAuditDefinitions {
param([string[]]$AppliedGpoNames)
$domainContext = Get-CurrentDomainContext
if (-not $domainContext.Available) {
return [pscustomobject]@{
Available = $false
Domain = $domainContext
Gpos = @()
Error = $domainContext.Error
}
}
$gpos = [System.Collections.Generic.List[object]]::new()
$policyBaseDn = "CN=Policies,CN=System,$($domainContext.DomainDN)"
foreach ($gpoName in $AppliedGpoNames) {
$searchRoot = New-Object System.DirectoryServices.DirectoryEntry("LDAP://$($domainContext.DomainName)/$policyBaseDn")
$searcher = New-Object System.DirectoryServices.DirectorySearcher($searchRoot)
$searcher.SearchScope = [System.DirectoryServices.SearchScope]::OneLevel
$searcher.Filter = "(&(objectClass=groupPolicyContainer)(displayName=$(Get-LdapEscapedValue -Value $gpoName)))"
[void]$searcher.PropertiesToLoad.Add('displayName')
[void]$searcher.PropertiesToLoad.Add('name')
$match = $searcher.FindOne()
if ($null -eq $match) {
$gpos.Add([pscustomobject]@{
Name = $gpoName
Guid = $null
AuditFilePath = $null
Available = $false
Definitions = @()
Error = 'Unable to resolve GPO in Active Directory.'
})
continue
}
$guid = [string]$match.Properties['name'][0]
$auditFilePath = "\\$($domainContext.DomainName)\SYSVOL\$($domainContext.DomainName)\Policies\$guid\Machine\Microsoft\Windows NT\Audit\audit.csv"
if (-not (Test-Path -LiteralPath $auditFilePath)) {
$gpos.Add([pscustomobject]@{
Name = $gpoName
Guid = $guid
AuditFilePath = $auditFilePath
Available = $false
Definitions = @()
Error = 'No advanced audit policy file found in SYSVOL for this GPO.'
})
continue
}
try {
$content = Get-Content -LiteralPath $auditFilePath -Raw
$gpos.Add([pscustomobject]@{
Name = $gpoName
Guid = $guid
AuditFilePath = $auditFilePath
Available = $true
Definitions = @(Get-AuditRows -Content $content -Format 'Csv')
Error = $null
})
}
catch {
$gpos.Add([pscustomobject]@{
Name = $gpoName
Guid = $guid
AuditFilePath = $auditFilePath
Available = $false
Definitions = @()
Error = $_.Exception.Message
})
}
}
return [pscustomobject]@{
Available = $true
Domain = $domainContext
Gpos = @($gpos)
Error = $null
}
}
function New-AuditPolicyRowMap {
param([object[]]$Rows)
$map = @{}
foreach ($row in $Rows) {
$map[$row.Name] = $row
}
return $map
}
function Get-PolicySourceAnalysis {
param(
[pscustomobject]$ComparisonResult,
[object[]]$ActualRows
)
if ($Path) {
return [pscustomobject]@{
Available = $false
LocalPolicy = $null
GpResult = $null
Findings = @()
Summary = 'Policy source analysis is skipped when parsing saved AuditPol output from a file.'
}
}
$localPolicy = Get-LocalAuditPolicyRows
$gpResult = Get-GpResultComputerSummary
$domainGpoAuditDefinitions = if ($gpResult.DomainGpos.Count -gt 0) {
Get-AppliedGpoAuditDefinitions -AppliedGpoNames $gpResult.DomainGpos
} else {
[pscustomobject]@{
Available = $false
Domain = $null
Gpos = @()
Error = 'No applied domain computer GPOs were parsed from gpresult output.'
}
}
$actualMap = New-AuditPolicyRowMap -Rows $ActualRows
$localMap = if ($localPolicy.Rows.Count -gt 0) { New-AuditPolicyRowMap -Rows $localPolicy.Rows } else { @{} }
$findings = [System.Collections.Generic.List[object]]::new()
foreach ($item in $ComparisonResult.Mismatches) {
$localRow = if ($localMap.ContainsKey($item.Name)) { $localMap[$item.Name] } else { $null }
$assessment = ''
$definingGpos = [System.Collections.Generic.List[object]]::new()
foreach ($gpo in $domainGpoAuditDefinitions.Gpos) {
if (-not $gpo.Available) {
continue
}
$matchingDefinition = @($gpo.Definitions | Where-Object { $_.Name -eq $item.Name } | Select-Object -First 1)
if ($matchingDefinition.Count -gt 0) {
$definingGpos.Add([pscustomobject]@{
Name = $gpo.Name
Guid = $gpo.Guid
Value = $matchingDefinition[0].Value
ValueText = $matchingDefinition[0].ValueText
Path = $gpo.AuditFilePath
})
}
}
$gposMatchingEffective = @($definingGpos | Where-Object { $_.Value -eq $item.ActualValue })
$gposMatchingExpected = @($definingGpos | Where-Object { $_.Value -eq $item.ExpectedValue })
if ($gposMatchingEffective.Count -eq 1 -and $definingGpos.Count -gt 0) {
$assessment = "The applied GPO '$($gposMatchingEffective[0].Name)' is the only inspected domain GPO defining the effective value, so it is the most likely source of this mismatch."
} elseif ($gposMatchingEffective.Count -gt 1) {
$assessment = "Multiple applied GPOs define the effective value ($($gposMatchingEffective.Name -join ', ')), so precedence between those GPOs is determining the final result."
} elseif ($definingGpos.Count -gt 0 -and $gposMatchingExpected.Count -gt 0) {
$assessment = "Applied GPOs define both the expected and effective values, so a conflicting higher-precedence GPO is likely overriding the Huntress baseline."
} elseif ($null -ne $localRow -and $localRow.Value -eq $item.ActualValue) {
$assessment = 'Local Group Policy matches the effective setting for this subcategory.'
} elseif ($null -ne $localRow -and $localRow.Value -ne $item.ActualValue) {
$assessment = 'Local Group Policy differs from the effective setting, so a higher-precedence domain GPO or manual auditpol change is likely winning.'
} elseif ($definingGpos.Count -eq 0 -and $domainGpoAuditDefinitions.Gpos.Count -gt 0) {
$assessment = 'None of the inspected applied GPO audit.csv files define this subcategory, so the mismatch may come from legacy audit policy, a manual auditpol change, or a GPO that could not be inspected.'
} elseif ($gpResult.DomainGpos.Count -gt 0) {
$assessment = 'Local Group Policy does not define this subcategory; a domain GPO or manual auditpol change is more likely.'
} else {
$assessment = 'No applied domain computer GPOs were detected and Local Group Policy does not define this subcategory, so manual/local configuration is more likely.'
}
$findings.Add([pscustomobject]@{
Name = $item.Name
Expected = $item.Expected
Effective = $item.Actual
LocalPolicy = $(if ($null -ne $localRow) { $localRow.ValueText } else { 'Not defined in Local Group Policy' })
DefiningGpos = @($definingGpos)
Assessment = $assessment
})
}
return [pscustomobject]@{
Available = $true
LocalPolicy = $localPolicy
GpResult = $gpResult
DomainGpoAudit = $domainGpoAuditDefinitions
Findings = @($findings)
Summary = 'Policy source analysis is heuristic: AuditPol shows effective settings, while Local Group Policy plus gpresult helps narrow down whether drift is local or likely domain GPO-driven.'
}
}
function Compare-AuditPolicy {
param([object[]]$ActualRows)
$expectedMap = Get-ExpectedAuditMap
$actualMap = @{}
foreach ($row in $ActualRows) {
$actualMap[$row.Name] = $row
}
$matches = [System.Collections.Generic.List[object]]::new()
$mismatches = [System.Collections.Generic.List[object]]::new()
$missing = [System.Collections.Generic.List[object]]::new()
$extra = [System.Collections.Generic.List[object]]::new()
foreach ($name in ($expectedMap.Keys | Sort-Object)) {
$expected = $expectedMap[$name]
if (-not $actualMap.ContainsKey($name)) {
$missing.Add([pscustomobject]@{
Name = $expected.Name
Expected = $expected.ValueText
ExpectedValue = $expected.Value
})
continue
}
$actual = $actualMap[$name]
if ($actual.Value -eq $expected.Value) {
$matches.Add([pscustomobject]@{
Name = $expected.Name
Expected = $expected.ValueText
Actual = $actual.ValueText
})
} else {
$mismatches.Add([pscustomobject]@{
Name = $expected.Name
Expected = $expected.ValueText
ExpectedValue = $expected.Value
Actual = $actual.ValueText
ActualValue = $actual.Value
Classification = (Get-AuditDifferenceClassification -ExpectedValue $expected.Value -ActualValue $actual.Value).Classification
Impact = (Get-AuditDifferenceClassification -ExpectedValue $expected.Value -ActualValue $actual.Value).Summary
})
}
}
foreach ($name in ($actualMap.Keys | Sort-Object)) {
if (-not $expectedMap.ContainsKey($name)) {
$extra.Add([pscustomobject]@{
Name = $actualMap[$name].Name
Actual = $actualMap[$name].ValueText
ActualValue = $actualMap[$name].Value
})
}
}
return [pscustomobject]@{
Passed = ($mismatches.Count -eq 0 -and $missing.Count -eq 0 -and ((-not $script:FailOnExtra) -or $extra.Count -eq 0))
ExpectedCount = $expectedMap.Count
ActualCount = $actualMap.Count
MatchCount = $matches.Count
MismatchCount = $mismatches.Count
MissingCount = $missing.Count
ExtraCount = $extra.Count
Matches = @($matches)
Mismatches = @($mismatches)
Missing = @($missing)
Extra = @($extra)
}
}
$content = Get-AuditPolContent -InputPath $Path
$resolvedFormat = Resolve-InputFormat -Content $content -DeclaredFormat $InputFormat
$rows = Get-AuditRows -Content $content -Format $resolvedFormat
if ($rows.Count -eq 0) {
throw "No Advanced Audit Policy rows were parsed from the provided AuditPol output."
}
$result = Compare-AuditPolicy -ActualRows $rows
$policySource = Get-PolicySourceAnalysis -ComparisonResult $result -ActualRows $rows
Write-Host ""
Write-Host "===============================================================" -ForegroundColor Cyan
Write-Host " HUNTRESS AUDIT POLICY VALIDATION" -ForegroundColor Cyan
Write-Host "===============================================================" -ForegroundColor Cyan
Write-Host (" Input source: {0}" -f $(if ($Path) { $Path } else { 'Live auditpol /get /category:*' }))
Write-Host (" Input format: {0}" -f $resolvedFormat)
Write-Host (" Expected rows: {0}" -f $result.ExpectedCount)
Write-Host (" Parsed rows: {0}" -f $result.ActualCount)
Write-Host (" Baseline mode: Process Creation={0}; Certification Services={1}" -f `
(Convert-AuditValueToText -Value $processCreationValue),
(Convert-AuditValueToText -Value $certServicesValue))
Write-Host ""
if ($result.Passed) {
Write-Host "Result: PASS - AuditPol output matches the Huntress baseline." -ForegroundColor Green
} else {
Write-Host "Result: FAIL - Differences from the Huntress baseline were found." -ForegroundColor Red
}
if ($result.MismatchCount -gt 0) {
Write-Host ""
Write-Host "Mismatched subcategories:" -ForegroundColor Yellow
foreach ($item in $result.Mismatches) {
Write-Host (" - {0}: expected '{1}', found '{2}' [{3}]" -f $item.Name, $item.Expected, $item.Actual, $item.Classification)
}
$overAuditingOnly = @($result.Mismatches | Where-Object { $_.Classification -eq 'Over-auditing only' })
$underAuditing = @($result.Mismatches | Where-Object { $_.Classification -eq 'Under-auditing' })
$differentMode = @($result.Mismatches | Where-Object { $_.Classification -eq 'Different mode' })
Write-Host ""
Write-Host "Mismatch triage:" -ForegroundColor Yellow
Write-Host (" - Over-auditing only: {0}" -f $overAuditingOnly.Count)
Write-Host (" - Under-auditing: {0}" -f $underAuditing.Count)
Write-Host (" - Different mode: {0}" -f $differentMode.Count)
}
if ($result.MissingCount -gt 0) {
Write-Host ""
Write-Host "Missing subcategories:" -ForegroundColor Yellow
foreach ($item in $result.Missing) {
Write-Host (" - {0}: expected '{1}'" -f $item.Name, $item.Expected)
}
}
if ($result.ExtraCount -gt 0) {
Write-Host ""
Write-Host ("Additional parsed subcategories not in baseline{0}:" -f $(if ($FailOnExtra) { ' (treated as failure)' } else { ' (informational only)' })) -ForegroundColor Yellow
foreach ($item in $result.Extra) {
Write-Host (" - {0}: found '{1}'" -f $item.Name, $item.Actual)
}
}
Write-Host ""
Write-Host ("Summary: {0} matched, {1} mismatched, {2} missing, {3} extra" -f `
$result.MatchCount, $result.MismatchCount, $result.MissingCount, $result.ExtraCount)
Write-Host ""
if ($policySource.Available) {
Write-Host "Policy source analysis:" -ForegroundColor Cyan
Write-Host (" - {0}" -f $policySource.Summary)
if ($null -ne $policySource.LocalPolicy) {
if ($policySource.LocalPolicy.Error) {
Write-Host (" - Local Group Policy audit file: {0} (parse error: {1})" -f $policySource.LocalPolicy.Path, $policySource.LocalPolicy.Error) -ForegroundColor Yellow
} elseif ($policySource.LocalPolicy.Available) {
Write-Host (" - Local Group Policy audit file: {0} ({1} parsed row(s))" -f $policySource.LocalPolicy.Path, $policySource.LocalPolicy.Rows.Count)
} else {
Write-Host (" - Local Group Policy audit file not present: {0}" -f $policySource.LocalPolicy.Path)
}
}
if ($null -ne $policySource.GpResult) {
if ($policySource.GpResult.Error) {
Write-Host (" - gpresult: {0}" -f $policySource.GpResult.Error) -ForegroundColor Yellow
} elseif ($policySource.GpResult.Collected) {
if ($policySource.GpResult.AppliedGpos.Count -gt 0) {
Write-Host (" - Applied computer GPOs: {0}" -f ($policySource.GpResult.AppliedGpos -join ', '))
} else {
Write-Host " - Applied computer GPOs: none parsed from gpresult output"
}
}
}
if ($null -ne $policySource.DomainGpoAudit) {
if ($policySource.DomainGpoAudit.Error) {
Write-Host (" - Applied GPO audit inspection: {0}" -f $policySource.DomainGpoAudit.Error) -ForegroundColor Yellow
} elseif ($policySource.DomainGpoAudit.Gpos.Count -gt 0) {
$inspectableCount = @($policySource.DomainGpoAudit.Gpos | Where-Object { $_.Available }).Count
Write-Host (" - Applied GPO audit files inspected: {0} of {1}" -f $inspectableCount, $policySource.DomainGpoAudit.Gpos.Count)
}
}
if ($policySource.Findings.Count -gt 0) {
Write-Host ""
Write-Host "Likely source of mismatches:" -ForegroundColor Yellow
foreach ($finding in $policySource.Findings) {
Write-Host (" - {0}: effective='{1}', local policy='{2}'. {3}" -f `
$finding.Name, $finding.Effective, $finding.LocalPolicy, $finding.Assessment)
if ($finding.DefiningGpos.Count -gt 0) {
foreach ($gpo in $finding.DefiningGpos) {
Write-Host (" GPO '{0}' defines '{1}'" -f $gpo.Name, $gpo.ValueText)
}
}
}
}
Write-Host ""
} else {
Write-Host "Policy source analysis: skipped for file-based input." -ForegroundColor DarkYellow
Write-Host ""
}
if ($PassThru) {
[pscustomobject]@{
Comparison = $result
PolicySource = $policySource
}
}
if ($result.Passed) {
exit 0
}
exit 1
# SIG # Begin signature block
# MIIyhQYJKoZIhvcNAQcCoIIydjCCMnICAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB9/OJBJ91zsuYN
# BQzgDeQHujdi7grcsQa/l9pc0aeP+KCCK7QwggVvMIIEV6ADAgECAhBI/JO0YFWU
# jTanyYqJ1pQWMA0GCSqGSIb3DQEBDAUAMHsxCzAJBgNVBAYTAkdCMRswGQYDVQQI
# DBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoM
# EUNvbW9kbyBDQSBMaW1pdGVkMSEwHwYDVQQDDBhBQUEgQ2VydGlmaWNhdGUgU2Vy
# dmljZXMwHhcNM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