tetragon/windows: add uid to exec events in Windows #3785
Merged
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.
Description
This commit consumes the changes made in process_monitor.c program to send the user's login id as a part of exec event.
This id is also enumerated for existing processes during enumeration when tetragon starts.
This uid is a unique Login Identifier extracted from user's token, and is same as Token AuthenticationId field of TOKEN_STATISTICS structure, available when token is queried with TokenStatistics information class.
This Authetication Id can be used to retrieve back the token, sid, user name etc. fields using the win32 API LsaGetLogonSessionData()
Since the Login ID as a uint64 is unique per user, and is different between privileged and non-privileged sessions of the same user, it seems to be a good proxy for uid field in exec event.
Changelog