Fix Authentication suppression dropping UAC elevation logons (fixes #28) - #67
Open
ZayanKhan-12 wants to merge 1 commit into
Open
ZayanKhan-12 wants to merge 1 commit into
ZayanKhan-12 wants to merge 1 commit into
Conversation
The suppress rule matched EventData field 1 against S-1-5-18. On 4624 that field is SubjectUserSid, the account that requested the logon, not the account that was logged on. UAC elevation produces a 4624 where SYSTEM is the subject and a real user is the target, so every UAC logon was silently dropped. An analyst searching 4624 to find where an account had been used would not see them. Switches both rules to named fields. Field ordering is not consistent across the event IDs this query selects, so no positional index means the same thing throughout: 4624/4625 Data[1]=SubjectUserSid Data[5]=TargetUserSid 4634 Data[1]=TargetUserSid Data[5]=LogonType 4647 Data[1]=TargetUserSid (4 fields, no Data[5]) 4672 Data[1]=SubjectUserSid Data[5]=PrivilegeList Suppressing on TargetUserSid keeps UAC logons while still dropping genuine SYSTEM logons, and stays correct on 4634/4647 where the target fields come first. 4672 has no TargetUserSid, so it gets its own rule matching SubjectUserSid scoped to that event ID. Also expands the inline comment, which palantir#28 noted was hard to find, to record why the rule is written this way. Fixes palantir#28 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
|
Thanks for your interest in palantir/windows-event-forwarding, @ZayanKhan-12! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request. |
ZayanKhan-12
pushed a commit
to ZayanKhan-12/windows-event-forwarding
that referenced
this pull request
Sep 16, 2026
…uppress-uac-logons Fix Authentication suppression dropping UAC elevation logons (fixes palantir#28) Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
Fixes #28.
Authentication.xmlsuppressed on EventData field position 1:On 4624,
Data[1]isSubjectUserSid— the account that requested the logon — notTargetUserSid, the account that was logged on. UAC elevation produces a 4624 where SYSTEM is the subject and a real user is the target, so @uplateandonline is correct that every UAC logon was silently dropped.Why not the
Data[5]fix from the thread@Beercow suggested changing
Data[1]toData[5]. That does fix 4624, but the<Suppress>applies to every<Select>in the query, and EventData ordering is not consistent across the event IDs this subscription collects:Data[1]Data[5]Data[5])On 4634
Data[5]isLogonTypeand on 4672 it isPrivilegeList, so neither can ever equal a SID.Data[5]silently stops suppressing SYSTEM logoffs (4634) and SYSTEM special-privilege assignments (4672) — the two highest-volume SYSTEM event types in this query. It would increase forwarded volume substantially rather than cutting it.I mention this only because the suggestion reads as a drop-in fix and the failure mode is silent in the noisy direction.
The fix
Match on named fields, which removes the positional fragility entirely:
TargetUserSidkeeps UAC logons (target is a real user) while still dropping genuine SYSTEM logons, and stays correct on 4634/4647 where the target fields come first.TargetUserSid— the account receiving the privileges is the subject — so it gets its own rule scoped to that event ID. Without theEventID=4672scope, matchingSubjectUserSidglobally would re-break UAC 4624s.This is consistent with existing practice in the repo:
Data[@Name=...]onPath="Security"is already used inExplicit-Credentials.xmlandRegistry.xml, and inside a<Suppress>inDNS.xml.Per the issue's second request, the inline comment now records the field-ordering table and why the rule is shaped this way, so the next person doesn't have to rediscover it.
Verification
Rather than reason about field offsets from memory, I built synthetic Security events using the documented
Microsoft-Windows-Security-Auditingschema and evaluated all three candidate rules with a real XPath engine. Windows evaluates*[...]with the document as context, so*matches<Event>; that maps to/*[...]in standard XPath, which is the only transformation applied.Rule A reproduces exactly the reported bug, which confirms the harness models the real semantics. The final run extracts the
<Suppress>expressions from the committed file rather than from a copy, and also checks that the subscription XML parses, that the CDATAQueryListis itself well-formed, and that all 6Selectand 2Suppressexpressions compile as valid XPath.What I could not verify
I'm on macOS, so I could not run
wecutil csto confirm the collector accepts the subscription, nor capture live events. Two things worth a reviewer's eye on Windows:andinside<Suppress>.<Select>uses this form throughout the repo, andSelect/Suppressshare the same XPath grammar, but I could not confirm it against a live collector. If it is rejected, the alternative is moving 4672 into its own<Query Id="1">with a self-contained suppress.Data[5]change.Note on scope
Single-file change; no other subscription touched. I have a separate PR (#66, for #50) that adds a
CLAUDE.mdand a subscription validator — deliberately not duplicated here so the two don't conflict on merge. This PR stands alone.