Skip to content
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

feat: add gid field support for exec* family #2161

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ekoops
Copy link

@ekoops ekoops commented Nov 15, 2024

What type of PR is this?

Uncomment one (or more) /kind <> lines:

/kind bug

/kind cleanup

/kind design

/kind documentation

/kind failing-test

/kind feature

Any specific area of the project related to this PR?

Uncomment one (or more) /area <> lines:

/area API-version

/area build

/area CI

/area driver-kmod

/area driver-bpf

/area driver-modern-bpf

/area libscap-engine-bpf

/area libscap-engine-gvisor

/area libscap-engine-kmod

/area libscap-engine-modern-bpf

/area libscap-engine-nodriver

/area libscap-engine-noop

/area libscap-engine-source-plugin

/area libscap-engine-savefile

/area libscap

/area libpman

/area libsinsp

/area tests

/area proposals

Does this PR require a change in the driver versions?

/version driver-API-version-major

/version driver-API-version-minor

/version driver-API-version-patch

/version driver-SCHEMA-version-major

/version driver-SCHEMA-version-minor

/version driver-SCHEMA-version-patch

What this PR does / why we need it:
This PR adds the effective group ID to the set of fields exported by the execve and execveat system calls. In this way, it is possible to detect an effective group ID change upon set-group-ID programs execution.
Which issue(s) this PR fixes:

Fixes #2144

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

feat(drivers): add `gid` field for exec* family

@poiana poiana added release-note kind/bug Something isn't working dco-signoff: yes kind/feature New feature or request labels Nov 15, 2024
@poiana
Copy link
Contributor

poiana commented Nov 15, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ekoops
Once this PR has been reviewed and has the lgtm label, please assign molter73 for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana
Copy link
Contributor

poiana commented Nov 15, 2024

Welcome @ekoops! It looks like this is your first PR to falcosecurity/libs 🎉

@poiana poiana added the size/L label Nov 15, 2024
@FedeDP
Copy link
Contributor

FedeDP commented Nov 15, 2024

/milestone next-driver

@poiana poiana added this to the next-driver milestone Nov 15, 2024
Copy link

Perf diff from master - unit tests

     9.84%     -1.44%  [.] sinsp_parser::reset
     1.80%     -0.92%  [.] libsinsp::sinsp_suppress::process_event
     3.20%     +0.66%  [.] sinsp_parser::process_event
     0.67%     +0.45%  [.] sinsp_evt::get_syscall_return_value
     1.43%     -0.44%  [.] 0x00000000000ea364
     1.59%     +0.43%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>
     1.12%     -0.39%  [.] sinsp_evt::get_param
     0.66%     +0.36%  [.] scap_event_encode_params_v
     0.52%     +0.30%  [.] sinsp_utils::find_longest_matching_evt_param
     2.00%     -0.29%  [.] std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release

Heap diff from master - unit tests

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Benchmarks diff from master

Comparing gbench_data.json to /root/actions-runner/_work/libs/libs/build/gbench_data.json
Benchmark                                                         Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------
BM_sinsp_split_mean                                            -0.0426         -0.0426           146           140           146           140
BM_sinsp_split_median                                          -0.0425         -0.0425           146           140           146           140
BM_sinsp_split_stddev                                          +0.1945         +0.1968             1             1             1             1
BM_sinsp_split_cv                                              +0.2476         +0.2500             0             0             0             0
BM_sinsp_concatenate_paths_relative_path_mean                  -0.0455         -0.0455            60            57            60            57
BM_sinsp_concatenate_paths_relative_path_median                -0.0424         -0.0424            60            57            60            57
BM_sinsp_concatenate_paths_relative_path_stddev                +2.5831         +2.5848             0             1             0             1
BM_sinsp_concatenate_paths_relative_path_cv                    +2.7540         +2.7558             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_mean                     -0.0453         -0.0453            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_median                   -0.0425         -0.0425            25            24            25            24
BM_sinsp_concatenate_paths_empty_path_stddev                   -0.7560         -0.7561             0             0             0             0
BM_sinsp_concatenate_paths_empty_path_cv                       -0.7445         -0.7445             0             0             0             0
BM_sinsp_concatenate_paths_absolute_path_mean                  -0.0858         -0.0858            62            56            62            56
BM_sinsp_concatenate_paths_absolute_path_median                -0.0958         -0.0958            62            56            62            56
BM_sinsp_concatenate_paths_absolute_path_stddev                -0.7319         -0.7317             1             0             1             0
BM_sinsp_concatenate_paths_absolute_path_cv                    -0.7067         -0.7066             0             0             0             0
BM_sinsp_split_container_image_mean                            +0.0555         +0.0555           373           393           373           393
BM_sinsp_split_container_image_median                          +0.0548         +0.0548           372           393           372           393
BM_sinsp_split_container_image_stddev                          +0.6594         +0.6592             3             5             3             5
BM_sinsp_split_container_image_cv                              +0.5721         +0.5720             0             0             0             0

Copy link

codecov bot commented Nov 15, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.77%. Comparing base (facfcc3) to head (1ae65de).

Files with missing lines Patch % Lines
userspace/libsinsp/parsers.cpp 66.66% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2161   +/-   ##
=======================================
  Coverage   74.77%   74.77%           
=======================================
  Files         254      254           
  Lines       33505    33507    +2     
  Branches     5748     5749    +1     
=======================================
+ Hits        25053    25055    +2     
  Misses       8452     8452           
Flag Coverage Δ
libsinsp 74.77% <66.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Probes don't export updated gid information for execve system call
3 participants