-
Notifications
You must be signed in to change notification settings - Fork 516
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
release: Add several security-related sysctls #435
Conversation
Add recommended settings from the Kernel Self Protection Project[0] wiki. Most of these are straightforward, some notes on the others: - kernel.perf_event_paranoid: Omitted since the Thar kernel does not include the required patch for '3' and the default is '2'. - kernel.yama.ptrace_scope: Omitted since Thar doesn't build the Yama LSM. - user.max_user_namespaces: Included since Kubernetes doesn't yet support user namespaces[1], but could be something to review later on. [0]: https://kernsec.org/wiki/index.php/Kernel_Self_Protection_Project/Recommended_Settings#sysctls [1]: kubernetes/enhancements#127 Signed-off-by: Samuel Mendoza-Jonas <[email protected]>
Enable the Yama LSM and set kernel.yama.ptrace_scope to 1; restricting how processes can use ptrace. For more information see https://www.kernel.org/doc/Documentation/security/Yama.txt Signed-off-by: Samuel Mendoza-Jonas <[email protected]>
Updated to point to the KSPP wiki in the sysctl settings and added a new commit which enables the Yama LSM.
|
kernel.yama.ptrace_scope = 1 | ||
|
||
# Disable User Namespaces, as it opens up a large attack surface to unprivileged users. | ||
user.max_user_namespaces = 0 |
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.
This feels like something we're going to need to change eventually given the use of user namespaces in containers...
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.
Right, it sounds like this isn't used too thoroughly yet but could be in the future - should we exclude it or wait until it's explicitly supported?
Issue #, if available:
N/A
Description of changes:
Add recommended settings from the Kernel Self Protection Project
wiki. Most of these are straightforward, some notes on the others:
include the required patch for '3' and the default is '2'.
support user namespaces, but could be something to review later on.
Tested by building and launching an instance and confirming the values were correct under
/proc/sys/...
Signed-off-by: Samuel Mendoza-Jonas [email protected]
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.