Conversation
|
Hi @mmirecki It seems to be good feature for tuning/sysctl, especially Kubernetes with multus.
|
a1a1cf9 to
87b11d0
Compare
/etc/cni/tuning/whitelist.conf is not the default
I've set this as the default one. I'll add an override when suggestions appear.
Done |
f28219d to
330db60
Compare
330db60 to
274984f
Compare
s1061123
left a comment
There was a problem hiding this comment.
As far as I looked, the code seems good to me. I recommend unit-test for the code, in https://github.com/containernetworking/plugins/blob/master/plugins/meta/tuning/tuning_test.go
7ef6b59 to
05cfe66
Compare
@s1061123 , added tests, replied to other comments |
|
Instead of whitelist, consider allow list, permit list or other variations. |
|
@mmirecki I agree with @cgoncalves ; would you mind whitelist -> allowlist? |
05cfe66 to
a45a457
Compare
-> allowlist |
a45a457 to
8820efb
Compare
Signed-off-by: mmirecki <[email protected]>
8820efb to
96c3af8
Compare
s1061123
left a comment
There was a problem hiding this comment.
It looks good to me. Thank you for the changes!
|
/lgtm |
|
Looks good to me. When you have a moment, can you file a PR in https://github.com/containernetworking/cni.dev/ documenting this? Thanks |
@squeed Here's the doc pr: containernetworking/cni.dev#99 |
The tuning-cni allows to set any sysctl on the created container. The admin might however want to restrict the user to a predefined whitelist of sysctls.
This PR is a POC with a proposal on how this could be implemented.
Tuning-cni would try to read a whitelist file from /tuningwhitelist/sysctlwhitelist (NOTE: temporary location only), and check the incoming sysctls agains it. Cni would return error if an unathorized sysctl is detected.
The tuning-cni would behaves as before is the file is missing.
The POC is meant to only show the concept, the actual implementation will probably differ.