[WP] Add is_session_leader field to process events#48307
Open
loresuso wants to merge 2 commits intoDataDog:mainfrom
Open
[WP] Add is_session_leader field to process events#48307loresuso wants to merge 2 commits intoDataDog:mainfrom
loresuso wants to merge 2 commits intoDataDog:mainfrom
Conversation
5705414 to
d93f625
Compare
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5705414150
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
d93f625 to
71464db
Compare
safchain
reviewed
Mar 25, 2026
safchain
reviewed
Mar 25, 2026
6c88473 to
d56a9f8
Compare
domalessi
approved these changes
Mar 25, 2026
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
Contributor
Author
|
recheck |
2fdc306 to
43addd7
Compare
Add a new boolean field `is_session_leader` to CWS process events that indicates whether a process is a session leader (PID == SID). The session ID is read from the kernel via: task->signal->pids[PIDTYPE_SID]->numbers[0].nr and compared against the process tgid. Two new kernel offset constants are introduced (task_struct_signal_offset, signal_struct_pids_offset) resolved via BTF at runtime. The field is exposed in SECL as process.is_session_leader and propagates to all process-related event types (exec, exit, signal, ptrace, etc.). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use bitfield for is_kworker and is_session_leader in process_context_t, keeping the struct at 40 bytes instead of growing to 48 - Restore the original if/else in exec handler cookie update Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
43addd7 to
b704d29
Compare
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.
Add a new boolean field
is_session_leaderto CWS process events that indicates whether a process is a session leader (PID == SID).The session ID is read from the kernel via:
and compared against the process tgid. Two new kernel offset constants are introduced (task_struct_signal_offset, signal_struct_pids_offset) resolved via BTF at runtime.
The field is exposed in SECL as process.is_session_leader and propagates to all process-related event types (exec, exit, signal, ptrace, etc.).
Example of condition where this could be useful: spawning of a session leader shell from a not known binary (e.g. a shell given by the
shellcommand of a sliver C2 implant