Skip to content

SMB: audit insecure guest logons; fix swapped SMB event IDs (#72) - #79

Merged
spydisec merged 1 commit into
mainfrom
feat/smb-guest-audit-72
Sep 24, 2026
Merged

spydisec merged 1 commit into
mainfrom
feat/smb-guest-audit-72

Conversation

@spydisec

Copy link
Copy Markdown
Owner

Closes #72. From the review of Yamato WELA #377.

Added: insecure guest logon auditing (client side)

  • New Core SMB audit item AuditInsecureGuestLogon (Set-SmbClientConfiguration -AuditInsecureGuestLogon $true). The SMB client logs event 31997 in SmbClient/Audit (a kit channel) when a share logs it on as Guest. Confirmed on this Windows 11 machine: the cmdlet parameter exists and Get-SmbAuditState reads it (currently False, so Enable would turn it on).
  • Mapped from Microsoft's CSP page: LanmanWorkstation/AuditInsecureGuestLogon, Group Policy Network > Lanman Workstation > Audit insecure guest logon; the GPO pack's registry.txt carries SOFTWARE\Policies\Microsoft\Windows\LanmanWorkstation\AuditInsecureGuestLogon = 1.
  • Server side left out on purpose: Set-SmbServerConfiguration -AuditInsecureGuestLogon writes event 3023 to SMBServer/Operational (per the provider manifest), a log the kit doesn't collect. Adding it would need that channel too; noted for later.

Fixed: swapped SMB event IDs

  • The settings table said encryption = 3021 / 31998 and signing = 3022 / 31999. The SMBServer and SMBClient provider manifests (Get-WinEvent -ListProvider) define 3021 / 31998 = signing and 3022 / 31999 = encryption. Purpose text corrected; the Reference page and Safety FAQ follow.
  • SMB items described as "Windows 11 24H2 / Server 2025 and later" instead of "Server 2025+ only" (Enable/Test/builder headings, builder risk text, Reference label now "SMB audit (24H2+)").

Presets (role presets select the new item; ASD stays faithful), Reference, Settings catalog and Group Policy pages regenerated.

Checks: Pester 62/62 on PowerShell 7 and 5.1; PSScriptAnalyzer clean for the kit; mkdocs build --strict passes.

🤖 Generated with Claude Code

New Core SMB audit item AuditInsecureGuestLogon (client side;
Set-SmbClientConfiguration; event 31997 in SmbClient/Audit), mapped to
LanmanWorkstation/AuditInsecureGuestLogon and Network > Lanman
Workstation > Audit insecure guest logon; the GPO pack's registry.txt
carries it. The server-side switch is left out: its event (3023) goes to
SMBServer/Operational, which the kit doesn't collect.

The settings table had SMB signing and encryption event IDs swapped; per
the SMBServer / SMBClient provider manifests 3021 / 31998 are signing and
3022 / 31999 encryption. SMB items are now described as Windows 11 24H2 /
Server 2025 and later. Presets, Reference and policy pages regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: spydisec/WinLogKit/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 37e7d5ad-3c6e-46ae-9c37-f4f5f6b0342a

📥 Commits

Reviewing files that changed from the base of the PR and between f13e763 and 6585fdf.

⛔ Files ignored due to path filters (4)
  • presets/ASD.csv is excluded by !**/*.csv
  • presets/DomainController.csv is excluded by !**/*.csv
  • presets/MemberServer.csv is excluded by !**/*.csv
  • presets/Workstation.csv is excluded by !**/*.csv
📒 Files selected for processing (13)
  • CHANGELOG.md
  • Enable-LoggingBaseline.ps1
  • New-LoggingBaseline.ps1
  • Test-LoggingBaseline.ps1
  • WinLogKit.Common.ps1
  • WinLogKit.Settings.ps1
  • docs/gpo-paths.md
  • docs/intune-csp.md
  • docs/reference.md
  • docs/safety.md
  • fleet/New-GpoPack.ps1
  • tools/Export-ReferenceTable.ps1
  • tools/policy-map.psd1

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@spydisec
spydisec merged commit b0e1257 into main Sep 24, 2026
6 checks passed
@spydisec
spydisec deleted the feat/smb-guest-audit-72 branch September 24, 2026 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SMB: audit insecure guest logons (client side); fix swapped SMB event IDs

1 participant