-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add runtime handler seccomp profile #9424
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
Add runtime handler seccomp profile #9424
Conversation
Hi @gavinkflam. Thanks for your PR. I'm waiting for a cri-o 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. |
82aa88e
to
5e9e8c0
Compare
/cc saschagrunert haircommander Please take a look if you get a chance. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #9424 +/- ##
==========================================
+ Coverage 65.96% 66.53% +0.56%
==========================================
Files 202 202
Lines 27761 27994 +233
==========================================
+ Hits 18312 18625 +313
+ Misses 7904 7790 -114
- Partials 1545 1579 +34 🚀 New features to boost your workflow:
|
/ok-to-test |
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.
Thanks! I just have a few suggestions, otherwise LGTM
c9e819c
to
d0b95a8
Compare
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.
@cri-o/cri-o-maintainers PTAL, LGTM
d0b95a8
to
417b30e
Compare
@saschagrunert @bitoku Please take another look. I realized that I should only apply the profile when the profile type is I've corrected that and added two tests to verify the profile type behavior and fallback logic. |
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.
Thanks! overall lgtm, just one comment about validation
c683f7e
to
8d11afc
Compare
8d11afc
to
929c5dd
Compare
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.
seccomp Setup()
should be closed to the receiver and shouldn't accept other Config
.
Instead, how about returning the right seccomp in Runtime.Seccomp()
?
I think this will make the code simpler.
Also this is nit, but it seems we can create a new function to validate seccomp. They look almost same.
929c5dd
to
1c7208a
Compare
@bitoku To use Instead, I’ve updated the config and Let me know what do you think. |
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.
To use RuntimeHandler.seccompConfig directly, we’d need to set up its notifierPath correctly. That requires APIConfig.Listen, which would mean passing the root Config struct deep into validateRuntimeSeccompProfile() - not ideal.
I don't think that using rootConfig is not ideal.
Cascading the value deep into validateRuntimeSeccompProfile()
may look messy, but we can do just like this instead.
Lines 1063 to 1065 in 51ce3dd
c.seccompConfig.SetNotifierPath( | |
filepath.Join(filepath.Dir(c.Listen), "seccomp"), | |
) |
Ideally, now that runtimeHandler has seccomp profile, everything should rely on runtimeHandler seccomp profile.
But this is more style suggestion, and if there's a reason not to do that, it's not a blocker of this PR.
We could also follow up when we find a better way.
Thank you for working on it!
/lgtm
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.
/lgtm cancel
sorry there's one thing I missed.
1c7208a
to
71d5047
Compare
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
71d5047
to
a0a44b5
Compare
@bitoku Please take another look. I've added pod support, and implemented your suggestion of having |
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.
/lgtm
@saschagrunert Can you PTAL? |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gavinkflam, saschagrunert 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Allow configuration of a default seccomp profile per runtime.
Which issue(s) this PR fixes:
Fixes #5715
Special notes for your reviewer:
Does this PR introduce a user-facing change?