Skip to content

Conversation

ExceptionalHandler
Copy link
Contributor

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

@ExceptionalHandler ExceptionalHandler requested a review from a team as a code owner May 30, 2025 21:22
@ExceptionalHandler ExceptionalHandler requested a review from tixxdz May 30, 2025 21:22
@ExceptionalHandler ExceptionalHandler added the release-note/misc This PR makes changes that have no direct user impact. label Jun 2, 2025
This commit modifies the process_monitor.c program to add the uid of the
user launching the process. This uid is available via
bpf_get_current_logon_id() bpf helper api.

Signed-off-by: Anadi Anadi<[email protected]>
Copy link

netlify bot commented Jun 2, 2025

Deploy Preview for tetragon ready!

Name Link
🔨 Latest commit d3b85bf
🔍 Latest deploy log https://app.netlify.com/projects/tetragon/deploys/683e0a9747922e000809f45a
😎 Deploy Preview https://deploy-preview-3785--tetragon.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Member

@tixxdz tixxdz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM , Thank you ;-)

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.

Signed-off-by: Anadi Anadi<[email protected]>
This commit fixes the CI tests to look for non zero uid in event json
for exec events.

Signed-off-by: Anadi Anadi<[email protected]>
@ExceptionalHandler ExceptionalHandler merged commit 2b0f7d7 into cilium:main Jun 3, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants