-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
new(drivers): add pgid
field
#2077
Conversation
Please double check driver/SCHEMA_VERSION file. See versioning. /hold |
To solve #2076 we shouldn't rely on any virtual ID in our filter checks. So at a certain point, we should also collect the
That's the reason why I avoided adding the new |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2077 +/- ##
==========================================
+ Coverage 73.58% 73.70% +0.11%
==========================================
Files 253 253
Lines 31869 31911 +42
Branches 5649 5605 -44
==========================================
+ Hits 23452 23519 +67
+ Misses 8416 8361 -55
- Partials 1 31 +30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
59072cf
to
44a8106
Compare
// group_leader has been updated to the highest process that has the same process group id. | ||
// group_leader's comm is considered the process group leader. | ||
m_tstr = group_leader->get_comm(); | ||
case TYPE_VPGID_NAME: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this filter-check is unreliable by design as explained here #2076 we could simply call TYPE_PGID_NAME
under the hood and modify the filter check description saying that it is deprecated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same of course for the vsid
when we will add the sid
field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me.
Perf diff from master - unit tests
Heap diff from master - unit tests
Heap diff from master - scap file
Benchmarks diff from master
|
X64 kernel testing matrix
ARM64 kernel testing matrix
|
/milestone next-driver |
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
44a8106
to
e80bc31
Compare
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com>
e80bc31
to
50f3fd7
Compare
This should be ready for review |
@@ -53,7 +53,7 @@ def test_db_program_spawned_process(sinsp, run_containers: dict): | |||
}, | |||
{ | |||
"container.id": generator_id, | |||
"evt.args": SinspField.regex_field(r'^res=0 exe=/bin/ls args=NULL tid=\d+\(ls\) pid=\d+\(ls\) ptid=\d+\(mysqld\) .* tty=0 pgid=1\(systemd\) loginuid=-1\(\<NONE\>\) flags=9\(EXE_WRITABLE\|EXE_LOWER_LAYER\) cap_inheritable=0'), | |||
"evt.args": SinspField.regex_field(r'^res=0 exe=/bin/ls args=NULL tid=\d+\(ls\) pid=\d+\(ls\) ptid=\d+\(mysqld\) .* tty=0 vpgid=1\(systemd\) loginuid=-1\(\<NONE\>\) flags=9\(EXE_WRITABLE\|EXE_LOWER_LAYER\) cap_inheritable=0'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this is already a somewhat breaking change :/ i mean, if anybody was trusting execve
args to have pgid
, and perhaps parsing it somehow, we are now breaking it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
evt.args
is changed this is true, pgid
will be the last rendered field instead of being rendered before loginuid
, but i don't think anybody is relying on the position of this field inside evt.args
to get it... i can imagine a rule with evt. args contains "pgid=..."
but in this case everything should work as before. We have issues if someone rely on the order of these fields to do something, but it seems strange... BTW if there are better ideas i'm happy to change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you, the "breaking change" is very unlikely to be a problem.
Signed-off-by: Andrea Terzolo <andreaterzolo3@gmail.com> Co-authored-by: Federico Di Pierro <nierro92@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Andreagit97, FedeDP The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM label has been added. Git tree hash: 1606217d485790c7186cda19749bdb721ad5843e
|
/unhold |
What type of PR is this?
/kind bug
/kind feature
Any specific area of the project related to this PR?
/area driver-kmod
/area driver-bpf
/area driver-modern-bpf
/area libscap
/area libsinsp
Does this PR require a change in the driver versions?
/version driver-SCHEMA-version-minor
What this PR does / why we need it:
As explained in #2076 this PR introduces the
pgid
field taken directly from the kernel. This ID is referred to the host pid namespace so it should help us writing more reliable rulesWhich issue(s) this PR fixes:
Mitigation for #2076
Today we have an issue
Special notes for your reviewer:
Does this PR introduce a user-facing change?: