Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Releases are tagged `vX.Y.Z` and published with a zip and a SHA256 checksum.
- 🛡️ **Advanced audit policy can't be silently overridden.** A new Core setting turns on "Audit: Force audit policy subcategory settings to override audit policy category settings" (`SCENoApplyLegacyAuditPolicy`). It's Windows' default, but a policy that turns it off lets legacy category-level audit policy override every subcategory the kit applies; now Enable sets it, Test verifies it, and the Settings catalog and Group Policy pages map it. The role presets include it; ASD stays faithful to its script. [#71](https://github.com/spydisec/WinLogKit/issues/71)
- 🚨 **Test checks that CrashOnAuditFail is off.** It's on the never-do list and the kit never sets it, but another policy might; Test now fails if it's on, since a full Security log would then halt the host. [#75](https://github.com/spydisec/WinLogKit/issues/75)
- 👤 **Insecure SMB guest logons are audited.** A new Core SMB setting makes the SMB client log when a share logs it on as the Guest account, an unauthenticated logon (event 31997 in SmbClient/Audit, Windows 11 24H2 / Server 2025 and later). Mapped on the Settings catalog and Group Policy pages and carried in the GPO pack. The server-side switch isn't included: it writes to SMBServer/Operational, a log the kit doesn't collect. [#72](https://github.com/spydisec/WinLogKit/issues/72)
- 🔒 **Test says when the AppLocker logs can't record anything.** Those logs pass as enabled, but only record while an AppLocker policy is in effect. When they're selected, Test now notes if no AppLocker policy is in effect, or if AppLocker isn't available on the Windows edition, so empty logs aren't mistaken for coverage. Read-only: the kit never creates an AppLocker policy. [#74](https://github.com/spydisec/WinLogKit/issues/74)

### Fixed

Expand Down
21 changes: 21 additions & 0 deletions Test-LoggingBaseline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,27 @@ Write-Host ''
Write-Host '=== Log storage (assessed channels at their maximum size) ===' -ForegroundColor White
Write-LogStorageCheck (@(Get-LogStorageCheck -Logs $storageLogs))

# Informational (#74): the AppLocker logs pass as enabled, but only record
# anything while an AppLocker policy is in effect. The kit never creates one.
$appLockerLogs = @($script:BaselineChannels | Where-Object { $_.Name -like 'Microsoft-Windows-AppLocker/*' -and $null -eq (Get-SkipReason $_.Tier 'Channel' $_.Name) })
if ($appLockerLogs.Count -gt 0) {
Write-Host ''
Write-Host '=== AppLocker ===' -ForegroundColor White
if (-not (Get-Command Get-AppLockerPolicy -ErrorAction SilentlyContinue)) {
Write-Host '[NOTE] AppLocker isn''t available on this edition of Windows, so the AppLocker logs will stay empty.' -ForegroundColor Yellow
} else {
$ruleCount = $null
try { $ruleCount = @((Get-AppLockerPolicy -Effective -ErrorAction Stop).RuleCollections | ForEach-Object { $_ }).Count } catch { $ruleCount = $null }
if ($null -eq $ruleCount) {
Write-Host '[NOTE] Could not read the effective AppLocker policy; the AppLocker logs only record while one is in effect.' -ForegroundColor Yellow
} elseif ($ruleCount -eq 0) {
Write-Host '[NOTE] No AppLocker policy is in effect, so the AppLocker logs will stay empty. To get these events, deploy an AppLocker policy in audit-only mode (the kit doesn''t create one).' -ForegroundColor Yellow
} else {
Write-Host "[OK ] $ruleCount AppLocker rule(s) in effect; the AppLocker logs will record their decisions." -ForegroundColor DarkGray
}
}
}

# ---------------------------------------------------------------- output ----

if (-not (Test-Path $OutputDir)) { New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null }
Expand Down
6 changes: 4 additions & 2 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ audit subcategories (superset-aware - more auditing than required passes),
registry values, SMB audit settings, and that `CrashOnAuditFail` is off
(the kit never sets it; the test fails if something else has). Per-behaviour-category PASS/FAIL/NOT
APPLICABLE, detail + summary CSVs, non-zero exit on any failure. Ends
with the same [disk space](safety.md#disk-space) check as Enable, for
information only.
with the same [disk space](safety.md#disk-space) check as Enable and, when
the AppLocker logs are selected, a note if no AppLocker policy is in effect
(those logs stay empty without one; the kit never creates one). Both are
for information only.

```powershell
.\Test-LoggingBaseline.ps1 [-IncludeHighVolume]
Expand Down
9 changes: 9 additions & 0 deletions tests/Kit.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,15 @@ Describe 'Audit integrity' {
Select-String -Path (Join-Path $KitRoot 'Test-LoggingBaseline.ps1') -Pattern "-Name 'CrashOnAuditFail'" -Quiet | Should -BeTrue
}
}
# #74: Test tells you when the AppLocker logs can't record anything.
Describe 'AppLocker readiness note' {
It 'checks for an effective AppLocker policy, read-only, and never fails on it' {
$src = Get-Content (Join-Path $KitRoot 'Test-LoggingBaseline.ps1') -Raw
$src | Should -Match 'Get-AppLockerPolicy -Effective'
$src | Should -Not -Match 'Set-AppLockerPolicy'
$src | Should -Match "Get-Command Get-AppLockerPolicy -ErrorAction SilentlyContinue"
}
}
Describe 'Rollback baseline' {
BeforeAll {
$enableAst = [System.Management.Automation.Language.Parser]::ParseFile((Join-Path $KitRoot 'Enable-LoggingBaseline.ps1'), [ref]$null, [ref]$null)
Expand Down
Loading