-
Notifications
You must be signed in to change notification settings - Fork 107
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
BPF Recorder: Exclude Container Initialization from Recorded Profile #2623
Conversation
Hi @mhils. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2623 +/- ##
==========================================
- Coverage 45.50% 41.36% -4.14%
==========================================
Files 79 109 +30
Lines 7782 18231 +10449
==========================================
+ Hits 3541 7541 +4000
- Misses 4099 10192 +6093
- Partials 142 498 +356 |
5c92641
to
44a3190
Compare
d710ac4
to
ed678c9
Compare
It is an impressive reduction in permissions in both apapmror and secocmp. 🤞 that this works! |
22776c3
to
ecd6cb1
Compare
/test pull-security-profiles-operator-test-e2e |
11071b4
to
5406024
Compare
testing has shown that we sometimes get reused mount namespaces that are already tainted. we can avoid these issues by clearing when we detect init.
Co-authored-by: Cosmin Cojocar <[email protected]>
for example, `ARGS='-run "TestSuite/TestSecurityProfilesOperator/namespaced:_Seccomp:_Verify_base_profile_merge"' CONTAINER_RUNTIME=docker make test-e2e` can be used to run a particular e2e test
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ccojocar, mhils 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 |
/test pull-security-profiles-operator-test-e2e |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR makes us 1) detect when containers are (about to be) initialized, and 2) makes sure the permissions exercised before this point are not included in the recorded profile.
Which issue(s) this PR fixes:
Fixes #2576
Does this PR have test?
Covered by existing E2E tests.
Special notes for your reviewer:
99% sure that some kernels won't supportsched_prepare_exec
, but let's see if it works in the first place before we revise.Switched from sched_prepare_exec to an execve tracepoint.Switched from execve to setsid to make sure we capture the last part of runc startup for seccomp.Switched from execve to getppid in an attempt to make things more reliable.Switched to an approach where we detect the initialunshare
and then start suppressing events until runc reachesgetppid
. This avoids data races on the Go side.Switched back to an approach where we clean the mount namespace instead of suppressing events.
Does this PR introduce a user-facing change?