Skip to content

Windows: audit coverage true-up, Server profile, per-object audit rules - #4

Merged
SecClay merged 1 commit into
masterfrom
windows-audit-coverage
Oct 16, 2026
Merged

SecClay merged 1 commit into
masterfrom
windows-audit-coverage

Conversation

@SecClay

@SecClay SecClay commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

Summary
Follow-up to the Windows modernization: widen what is audited so the logs are useful for defense and operations work, not only malware analysis.

More audit categories on: SAM, Other Policy Change Events, MPSSVC Rule-Level Policy Change (firewall rule changes), DPAPI Activity, Group Membership. Handle Manipulation, Non Sensitive/Other Privilege Use and Packet Drop stay off because they are very noisy.
Server profile: windows/audit-server.csv adds Kerberos Authentication Service / Service Ticket Operations, Directory Service Access and Replication. Applied automatically on Windows Server SKUs (-AuditProfile Auto|Workstation|Server overrides). Windows 10/11 skip these because they only generate events on a domain controller.
Per-object audit rules (SACLs): the File System and Registry categories log nothing without them. windows/sacls.psd1 (editable) adds success-audit rules on persistence and tamper-prone keys (Run/RunOnce incl. WOW6432Node, Winlogon, IFEO, SilentProcessExit, Services, Session Manager, Lsa, WDigest/SecurityProviders, Defender policy) and folders (all-users StartUp, System32\Tasks, System32\drivers, hosts). -Revert removes exactly what was added; -SkipObjectAuditing opts out. Per-user HKCU hives are not covered.
More channels sized/enabled: NTLM, Security-Mitigations, PrintService, SmbClient Security, AppLocker (4 logs), Diagnosis-Scripted, DriverFrameworks-UserMode, PowerShellCore; plus Directory Service / DNS Server / DFS Replication on Server when the role exists.
windows/WinLogs.Acl.ps1 holds the SACL helpers. Registry SACLs need SeSecurityPrivilege switched on and a key opened with the Win32 API, because Get-Acl -Audit and .NET's OpenSubKey both fail on them (CI found this).
Testing
tests/Test-WinLogs.ps1 now also checks the client/server audit difference, that SACLs are added and removed, and that real events fire (4657 for a Run-key value, 4663 for a file in the StartUp folder). CI passes on windows-2022, windows-2025 and windows-11-arm (a client SKU on ARM64, so this covers the Windows 10/11 profile) under Windows PowerShell 5.1 and PowerShell 7.

Not tested: a real domain controller (the Kerberos/DS categories are applied and verified via auditpol, but no DC events were generated), x64 Windows 10/11 client builds, and the air-gapped path on a machine with no internet.

Notes
This branch edits .github/workflows/windows-test.yml. The Linux PR renames that workflow to test.yml, so whichever merges second needs a trivial conflict fix (keep the windows-11-arm matrix entry).

…rules

- Turn on SAM, Other Policy Change, MPSSVC Rule-Level Policy Change,
  DPAPI Activity and Group Membership auditing.
- Add audit-server.csv (Kerberos, Directory Service) applied
  automatically on Windows Server SKUs; -AuditProfile overrides.
- Add sacls.psd1 and per-object audit rules (SACLs) on persistence and
  tampering registry keys and folders, so the File System and Registry
  categories actually produce events. Recorded in state and removed by
  -Revert; -SkipObjectAuditing opts out. WinLogs.Acl.ps1 holds the
  helpers (registry SACLs need SeSecurityPrivilege and a Win32 key open).
- Size/enable more channels (NTLM, Security-Mitigations, PrintService,
  SmbClient, AppLocker, Diagnosis-Scripted, DriverFrameworks,
  PowerShellCore, and DC/DNS channels on Server).
- Tests assert profile-specific audit settings, SACL add/remove, and
  that 4657 and 4663 events fire; CI adds a windows-11-arm client job.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@SecClay
SecClay merged commit 982b60c into ClaySecAI:master Oct 16, 2026
6 checks passed
ClaySecAI added a commit that referenced this pull request Oct 17, 2026
Windows: audit coverage true-up, Server profile, per-object audit rules
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.

2 participants