-
Notifications
You must be signed in to change notification settings - Fork 203
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
Sentinel-command without nsenter by default #813
Conversation
@ckotzbauer Great! The kube-api-access projected volume is also read-only BTW, but indeed overlapping volumeMounts would not be good. Fortunately I think there is a relatively easy way to allow the hostPath to be read-only as a security improvement. Moreover I think this can be done entirely in Helm, without further go changes. I can put together a PR to the Helm chart illustrating the idea. It would not require any changes to kured-ds.yaml; is that just an example or for people who want to manually apply static YAML? |
Yeah, you are absolutely right, I thought about the same approach today. We could leave the default sentinel-path in go as is and just map in the helm-chart to an arbitrary path which does not overlap. This would be absolutely feasible, but it would make kustomize-based installations a bit more complicated, as you have to configure the deployment properly. But however, maybe this would be a good improvement and we should just take the risk of making the kustomize-setups a bit more complicated. We would just need to adjust my PR kubereboot/charts#49 |
Actually I noticed the chart already allows arbitrary volume(Mounts) to be defined, so it could be done without any further modifications to the chart at all. This is what I would do in my Helm values:
Then I place a sentinel file in /opt/whatever/reboot-required, and kured will look for the hostPath-mapped location /kured/reboot-required. If the Helm chart is expanded via something like kubereboot/charts#49, it could help make the configuration easier, but IMHO it should be done in a way that makes the hostPath read-only by default, since the goal is to improve security. That would require using some Helm path helpers as I mentioned here which would be a bit more complicated: #526 (comment) |
The |
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 pending consensus on concerns about renaming the container mount path
@rptaylor Yes, this is ready to merge. I will hold it back until we know when we do the next minor release (around Kubernetes 1.29.0). Until that we can do patch releases from main without separate branching. |
This PR was automatically considered stale due to lack of activity. Please refresh it and/or join our slack channels to highlight it, before it automatically closes (in 7 days). |
This will be superseded by #814 right? |
@rptaylor No, they are both needed. This PR is "only" needed to make the check if a reboot is required more secure. |
Okay I wasn't sure because the commit descriptions in this PR are a subset of those in https://github.com/kubereboot/kured/pull/814/commits. Maybe once that is merged and this is rebased it will be more clear. Thanks! |
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
Signed-off-by: Christian Kotzbauer <[email protected]>
Signed-off-by: Christian Kotzbauer <[email protected]>
9711ec0
to
74ebb28
Compare
Superseded by #814 |
As long as there's no custom sentinel-command kured expects that the sentinel file (
/var/run/reboot-required
by default) to be mounted into the container. This would cause the sentinel-command to be executed without nsenter.close #526