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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ 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)

### Fixed

- 🔢 **SMB audit event numbers corrected.** The settings table had signing and encryption swapped: per the SMB providers' own event definitions, 3021 / 31998 are signing and 3022 / 31999 encryption. The Reference page and the Safety FAQ now match, and the SMB settings are described as Windows 11 24H2 / Server 2025 and later rather than Server 2025 only. [#72](https://github.com/spydisec/WinLogKit/issues/72)
- 🧯 **Failed log changes are reported as failures.** Enable sent `wevtutil` output to nowhere and never checked its exit code, so a log resize or enable that failed was reported as Changed (and `-Rollback` had the same gap). It now reports an Error with `wevtutil`'s own message and exits non-zero. [#70](https://github.com/spydisec/WinLogKit/issues/70)

## [2.1.0] - 2026-09-24
Expand Down
4 changes: 2 additions & 2 deletions Enable-LoggingBaseline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,9 @@ try {
}
}

# --------------------- SMB signing/encryption auditing (Server 2025+) ---
# ------------------- SMB auditing (Windows 11 24H2 / Server 2025+) ---
Write-Host ''
Write-Host '=== SMB signing/encryption auditing (Windows Server 2025+) ===' -ForegroundColor White
Write-Host '=== SMB auditing (Windows 11 24H2 / Server 2025+) ===' -ForegroundColor White
$smbState = Get-SmbAuditState
foreach ($sa in $script:BaselineSmbAuditSettings) {
$decision = Get-ItemDecision $sa.Tier 'SmbAudit' $sa.Id
Expand Down
6 changes: 3 additions & 3 deletions New-LoggingBaseline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,14 @@ foreach ($rs in $script:BaselineRegistrySettings) {
}
foreach ($sa in $script:BaselineSmbAuditSettings) {
$items.Add([pscustomobject]@{
Section = 'SMB audit settings (Windows Server 2025+)'
Section = 'SMB audit settings (Windows 11 24H2 / Server 2025+)'
ItemType = 'SmbAudit'
Id = $sa.Id
Name = "$($sa.Side): $($sa.Id) = $($sa.Value)"
Tier = $sa.Tier
Scope = $sa.Scope
Purpose = $sa.Purpose
Risk = 'No effect on OSes before Windows Server 2025 / Windows 11 24H2 (reported NOT APPLICABLE there). Audit-only; nothing is blocked.'
Risk = 'No effect before Windows 11 24H2 / Windows Server 2025 (reported NOT APPLICABLE there). Audit-only; nothing is blocked.'
Categories = ($sa.Categories -join '; ')
})
}
Expand Down Expand Up @@ -258,7 +258,7 @@ if ($AcceptRecommended) {
Write-Host 'Keys: [Enter]=default [y]=include [n]=exclude [a]=defaults for rest of section [t]=show tree [q]=abort'
Write-Host ''

foreach ($section in @('Event log channels', 'Advanced audit policy subcategories', 'Registry settings', 'SMB audit settings (Windows Server 2025+)')) {
foreach ($section in @('Event log channels', 'Advanced audit policy subcategories', 'Registry settings', 'SMB audit settings (Windows 11 24H2 / Server 2025+)')) {
$sectionItems = @($items | Where-Object { $_.Section -eq $section })
Write-Host "=== $section ($($sectionItems.Count) items) ===" -ForegroundColor White
$acceptRest = $false
Expand Down
2 changes: 1 addition & 1 deletion Test-LoggingBaseline.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ if ($null -eq $crash -or "$crash" -eq '0') {
Add-Row @('Logging tampered with') 'Safety' $crashLabel '0 or absent' "$crash" 'FAIL' 'CrashOnAuditFail is on: the host halts when the Security log fills. Set by another policy; the kit never changes it. See Safety (never-do list).'
}

# ------------------- SMB signing/encryption auditing (Server 2025+) ---------
# ----------------------- SMB auditing (Windows 11 24H2 / Server 2025+) ------

$smbState = Get-SmbAuditState
foreach ($sa in $script:BaselineSmbAuditSettings) {
Expand Down
2 changes: 1 addition & 1 deletion WinLogKit.Common.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function Format-AuditSetting {

# ------------------------------------------------------------ SMB auditing ---

# Current state of the Server 2025+ SMB signing/encryption audit settings.
# Current state of the SMB audit settings (Windows 11 24H2 / Server 2025+).
# Returns a hashtable Id -> current bool; items missing from the hashtable are
# unsupported on this OS (the properties only exist on Server 2025 / Win11 24H2+).
function Get-SmbAuditState {
Expand Down
27 changes: 17 additions & 10 deletions WinLogKit.Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ $script:BaselineChannels = @(

@{ Name = 'Microsoft-Windows-SMBServer/Audit'; TargetBytes = $mb128; MustEnable = $false; Tier = 'Core'; DefaultSize = '8 MB'; MayBeAbsent = $true
Categories = @('Remote access','Network flow and sessions')
Purpose = 'SMB server audit events, including Windows Server 2025 signing/encryption capability auditing (3021/3022) - identifies clients that cannot do SMB signing or encryption before you enforce it.' }
Purpose = 'SMB server audit events, including signing/encryption capability auditing on Windows 11 24H2 / Server 2025 and later (3021/3022) - identifies clients that cannot do SMB signing or encryption before you enforce it.' }

@{ Name = 'Microsoft-Windows-SmbClient/Audit'; TargetBytes = $mb128; MustEnable = $false; Tier = 'Core'; DefaultSize = '8 MB'; MayBeAbsent = $true
Categories = @('Remote access','Network flow and sessions')
Purpose = 'SMB client audit events, including Windows Server 2025 signing/encryption capability auditing (31998/31999) and NTLM-blocking diagnostics.' }
Purpose = 'SMB client audit events, including signing/encryption capability auditing (31998/31999) and insecure guest logons (31997) on Windows 11 24H2 / Server 2025 and later, and NTLM-blocking diagnostics.' }

@{ Name = 'Microsoft-Windows-Crypto-DPAPI/Debug'; TargetBytes = $mb128; MustEnable = $true; Tier = 'HighVolume'; DefaultSize = '1 MB'; MayBeAbsent = $true; Situational = $true
Categories = @('Certificates and keys')
Expand Down Expand Up @@ -499,11 +499,12 @@ $script:BaselineRegistrySettings = @(
)

# -----------------------------------------------------------------------------
# 3b. SMB SIGNING/ENCRYPTION AUDITING (Windows Server 2025 / Win 11 24H2+)
# 3b. SMB AUDITING (Windows 11 24H2 / Windows Server 2025 and later)
#
# New in Windows Server 2025: audit which peers cannot do SMB signing or
# encryption, so enforcement can be planned on evidence instead of breaking
# file shares. Configured via Set-SmbServerConfiguration /
# Audit which peers cannot do SMB signing or encryption, so enforcement can
# be planned on evidence instead of breaking file shares, and when the SMB
# client logs on as Guest (insecure guest logons, #72). Event IDs as the
# SMBServer / SMBClient providers define them. Configured via Set-SmbServerConfiguration /
# Set-SmbClientConfiguration (documented by Microsoft in "What's new in
# Windows Server 2025"), not registry or auditpol, so these have their own
# item type. On older OSes the properties do not exist and the scripts report
Expand All @@ -513,19 +514,25 @@ $script:BaselineRegistrySettings = @(
$script:BaselineSmbAuditSettings = @(
@{ Id = 'AuditClientDoesNotSupportEncryption'; Side = 'Server'; Value = $true; Tier = 'Core'; Scope = 'All'
Categories = @('Remote access','Network flow and sessions')
Purpose = 'SMB server logs clients that cannot do SMB encryption (event 3021 in SMBServer/Audit). Windows Server 2025+ only.' }
Purpose = 'SMB server logs clients that cannot do SMB encryption (event 3022 in SMBServer/Audit). Windows 11 24H2 / Server 2025 and later.' }

@{ Id = 'AuditClientDoesNotSupportSigning'; Side = 'Server'; Value = $true; Tier = 'Core'; Scope = 'All'
Categories = @('Remote access','Network flow and sessions')
Purpose = 'SMB server logs clients that cannot do SMB signing (event 3022 in SMBServer/Audit). Windows Server 2025+ only.' }
Purpose = 'SMB server logs clients that cannot do SMB signing (event 3021 in SMBServer/Audit). Windows 11 24H2 / Server 2025 and later.' }

@{ Id = 'AuditServerDoesNotSupportEncryption'; Side = 'Client'; Value = $true; Tier = 'Core'; Scope = 'All'
Categories = @('Remote access','Network flow and sessions')
Purpose = 'SMB client logs servers that cannot do SMB encryption (event 31998 in SmbClient/Audit). Windows Server 2025+ only.' }
Purpose = 'SMB client logs servers that cannot do SMB encryption (event 31999 in SmbClient/Audit). Windows 11 24H2 / Server 2025 and later.' }

@{ Id = 'AuditServerDoesNotSupportSigning'; Side = 'Client'; Value = $true; Tier = 'Core'; Scope = 'All'
Categories = @('Remote access','Network flow and sessions')
Purpose = 'SMB client logs servers that cannot do SMB signing (event 31999 in SmbClient/Audit). Windows Server 2025+ only.' }
Purpose = 'SMB client logs servers that cannot do SMB signing (event 31998 in SmbClient/Audit). Windows 11 24H2 / Server 2025 and later.' }

# Client side only: the server-side switch writes its event (3023) to
# SMBServer/Operational, a log the kit doesn't collect.
@{ Id = 'AuditInsecureGuestLogon'; Side = 'Client'; Value = $true; Tier = 'Core'; Scope = 'All'
Categories = @('Remote access','Authentication')
Purpose = 'SMB client logs when a share logs it on as the Guest account, an unauthenticated insecure guest logon (event 31997 in SmbClient/Audit). Windows 11 24H2 / Server 2025 and later.' }
)

# -----------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions docs/gpo-paths.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Things to know before you start:
| AuditClientDoesNotSupportSigning | SMB audit | Core | Administrative Templates > Network > Lanman Server > Audit client does not support signing | Enabled |
| AuditServerDoesNotSupportEncryption | SMB audit | Core | Administrative Templates > Network > Lanman Workstation > Audit server does not support encryption | Enabled |
| AuditServerDoesNotSupportSigning | SMB audit | Core | Administrative Templates > Network > Lanman Workstation > Audit server does not support signing | Enabled |
| AuditInsecureGuestLogon | SMB audit | Core | Administrative Templates > Network > Lanman Workstation > Audit insecure guest logon | Enabled |
| Security | Log size | Core | Administrative Templates > Windows Components > Event Log Service > Security > Specify the maximum log file size (KB) | Enabled, 1048576 KB |
| System | Log size | Core | Administrative Templates > Windows Components > Event Log Service > System > Specify the maximum log file size (KB) | Enabled, 131072 KB |
| Application | Log size | Core | Administrative Templates > Windows Components > Event Log Service > Application > Specify the maximum log file size (KB) | Enabled, 131072 KB |
Expand Down
1 change: 1 addition & 0 deletions docs/intune-csp.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Things to know before you start:
| AuditClientDoesNotSupportSigning | SMB audit | Core | `LanmanServer/AuditClientDoesNotSupportSigning` | 1 (Enabled) | [LanmanServer](https://learn.microsoft.com/windows/client-management/mdm/policy-csp-lanmanserver) |
| AuditServerDoesNotSupportEncryption | SMB audit | Core | `LanmanWorkstation/AuditServerDoesNotSupportEncryption` | 1 (Enabled) | [LanmanWorkstation](https://learn.microsoft.com/windows/client-management/mdm/policy-csp-lanmanworkstation) |
| AuditServerDoesNotSupportSigning | SMB audit | Core | `LanmanWorkstation/AuditServerDoesNotSupportSigning` | 1 (Enabled) | [LanmanWorkstation](https://learn.microsoft.com/windows/client-management/mdm/policy-csp-lanmanworkstation) |
| AuditInsecureGuestLogon | SMB audit | Core | `LanmanWorkstation/AuditInsecureGuestLogon` | 1 (Enabled) | [LanmanWorkstation](https://learn.microsoft.com/windows/client-management/mdm/policy-csp-lanmanworkstation) |
| Security | Log size | Core | `EventLogService/SpecifyMaximumFileSizeSecurityLog` | Enabled, 1048576 KB | [EventLogService](https://learn.microsoft.com/windows/client-management/mdm/policy-csp-eventlogservice) |
| System | Log size | Core | `EventLogService/SpecifyMaximumFileSizeSystemLog` | Enabled, 131072 KB | [EventLogService](https://learn.microsoft.com/windows/client-management/mdm/policy-csp-eventlogservice) |
| Application | Log size | Core | `EventLogService/SpecifyMaximumFileSizeApplicationLog` | Enabled, 131072 KB | [EventLogService](https://learn.microsoft.com/windows/client-management/mdm/policy-csp-eventlogservice) |
Expand Down
11 changes: 6 additions & 5 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Reading the columns:
| Microsoft-Windows-TerminalServices-LocalSessionManager/Operational | Channel | - | 1 MB -> 128 MB | Low | Y | :material-check: | :material-check: | :material-check: |
| Microsoft-Windows-TaskScheduler/Operational | Channel | - | 1 MB -> 128 MB | Low | Y | :material-check: | :material-check: | :material-check: |
| Microsoft-Windows-SMBServer/Audit | Channel | 3021, 3022 | 8 MB -> 128 MB | Low | - | :material-check: | :material-check: | :material-check: |
| Microsoft-Windows-SmbClient/Audit | Channel | 31998, 31999 | 8 MB -> 128 MB | Low | - | :material-check: | :material-check: | :material-check: |
| Microsoft-Windows-SmbClient/Audit | Channel | 31998, 31999, 31997 | 8 MB -> 128 MB | Low | - | :material-check: | :material-check: | :material-check: |
| Microsoft-Windows-Crypto-DPAPI/Debug | Channel | - | 1 MB -> 128 MB | Watch | - | - | - | - |
| Credential Validation | Audit subcategory | 4776 | - | Low | C S Y | :material-check: | :material-check: | :material-check: |
| Kerberos Authentication Service (DC) | Audit subcategory | 4768, 4771 | - | Low | Y | - | - | :material-check: |
Expand Down Expand Up @@ -107,7 +107,8 @@ Reading the columns:
| `CurrentControlSet\Services\Netlogon\Parameters\AuditNTLMInDomain (DC)` | Registry | - | - | Low | - | - | - | :material-check: |
| `CurrentControlSet\Control\Lsa\SCENoApplyLegacyAuditPolicy` | Registry | - | - | Low | - | :material-check: | :material-check: | :material-check: |
| AD CS AuditFilter (needs CertSvc restart) | Registry | 4886-4899 | - | Low | Y | :material-check: | :material-check: | :material-check: |
| Server: AuditClientDoesNotSupportEncryption | SMB audit (2025+) | 3021 | - | Low | - | :material-check: | :material-check: | :material-check: |
| Server: AuditClientDoesNotSupportSigning | SMB audit (2025+) | 3022 | - | Low | - | :material-check: | :material-check: | :material-check: |
| Client: AuditServerDoesNotSupportEncryption | SMB audit (2025+) | 31998 | - | Low | - | :material-check: | :material-check: | :material-check: |
| Client: AuditServerDoesNotSupportSigning | SMB audit (2025+) | 31999 | - | Low | - | :material-check: | :material-check: | :material-check: |
| Server: AuditClientDoesNotSupportEncryption | SMB audit (24H2+) | 3022 | - | Low | - | :material-check: | :material-check: | :material-check: |
| Server: AuditClientDoesNotSupportSigning | SMB audit (24H2+) | 3021 | - | Low | - | :material-check: | :material-check: | :material-check: |
| Client: AuditServerDoesNotSupportEncryption | SMB audit (24H2+) | 31999 | - | Low | - | :material-check: | :material-check: | :material-check: |
| Client: AuditServerDoesNotSupportSigning | SMB audit (24H2+) | 31998 | - | Low | - | :material-check: | :material-check: | :material-check: |
| Client: AuditInsecureGuestLogon | SMB audit (24H2+) | 31997 | - | Low | - | :material-check: | :material-check: | :material-check: |
4 changes: 3 additions & 1 deletion docs/safety.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ categories PASS) and rollback.
### What's special on Server 2025 and Windows 11 24H2?

Both can audit which SMB peers cannot do signing or encryption (events
3021/3022 server-side, 31998/31999 client-side; availability per
3021 signing / 3022 encryption server-side, 31998 signing / 31999
encryption client-side) and when the SMB client logs on as Guest (31997);
availability per
Microsoft's
[SMB feature descriptions](https://learn.microsoft.com/windows-server/storage/file-server/smb-feature-descriptions)).
The kit enables these audit-only settings and sizes both Audit channels;
Expand Down
6 changes: 3 additions & 3 deletions fleet/New-GpoPack.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
GUIDs; the name column is informational.
registry.txt LGPO.exe text format for the policy-key registry values
(PowerShell logging, process command line capture, and
SMB signing/encryption auditing through its Lanman
Server / Lanman Workstation policies).
SMB auditing through its Lanman Server / Lanman
Workstation policies).

Applying:
Local / image builds (LGPO.exe from Microsoft's Security Compliance
Expand Down Expand Up @@ -117,7 +117,7 @@ foreach ($rs in $script:BaselineRegistrySettings) {
$regEntries.Add("Computer`r`n$keyPath`r`n$($rs.Name)`r`n$typeData")
$regCount++
}
# SMB signing/encryption auditing has Group Policy (Network > Lanman Server
# SMB auditing has Group Policy (Network > Lanman Server
# / Lanman Workstation, Windows 11 24H2 and Server 2025 onwards; older
# versions ignore the values). Same value names as the Set-Smb*Configuration
# parameters.
Expand Down
Loading
Loading