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

Fix OS capabilities #1131

Merged
merged 2 commits into from
Sep 4, 2024
Merged

Fix OS capabilities #1131

merged 2 commits into from
Sep 4, 2024

Conversation

grcevski
Copy link
Contributor

@grcevski grcevski commented Sep 4, 2024

There were few bugs in the OS capability checking which are being fixed with this PR:

  1. If SYS_ADMIN is present, it effectively means all capabilities.
  2. If we have kernel older than 5.8, SYS_ADMIN is a must, the others weren't split off yet.
  3. If we have NET_ADMIN we also have NET_RAW, so we can relax that check.

Given that I failed to run Beyla with SYS_ADMIN, I don't think we should enforce the capabilities, we should only warn. This is very hard to get right 100% and it shouldn't be a hard check.

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2024

Codecov Report

Attention: Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.97%. Comparing base (4494fae) to head (146b064).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
pkg/beyla/os.go 91.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1131       +/-   ##
===========================================
+ Coverage   68.13%   81.97%   +13.84%     
===========================================
  Files         140      141        +1     
  Lines       11520    11598       +78     
===========================================
+ Hits         7849     9508     +1659     
+ Misses       3156     1563     -1593     
- Partials      515      527       +12     
Flag Coverage Δ
integration-test 57.15% <13.04%> (?)
k8s-integration-test 59.03% <13.04%> (?)
oats-test 36.91% <13.04%> (-0.14%) ⬇️
unittests 52.44% <82.60%> (+0.07%) ⬆️

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.

Copy link
Contributor

@rafaelroquetto rafaelroquetto left a comment

Choose a reason for hiding this comment

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

Neat, thanks for the fix!

@grcevski grcevski merged commit 110543e into grafana:main Sep 4, 2024
6 checks passed
@grcevski grcevski deleted the fix_os_cap branch September 4, 2024 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants