sig-storage-local-static-provisioner
sig-storage-local-static-provisioner copied to clipboard
The local provisioner use hostPath behind the scene. Is it secure ?
When looking closely at the code, I noticed that "hostPath" volume type was used (for example in this manifest : https://raw.githubusercontent.com/Azure/kubernetes-volume-drivers/master/local/local-pv-provisioner-nvmedisk.yaml).
The official Kubernetes documentation discourages the usage of the hostPath volume type because of the security risk. See the big Warning. Do you know if the security warning and risks only applies for direct "hostPath" from the pod or if it also applies when we use the local provisioner and a PVC ? If yes, would it be possible to modify the provided yaml to use the "local" volume type instead of hostPath ? Thanks for your feedback !
this driver is based on hostPath and finally generates local type volume:
https://github.com/kubernetes-sigs/sig-storage-local-static-provisioner/blob/b5987962ca8c6f53415c4ad683ddea4cb274fec6/deployment/kubernetes/example/default_example_provisioner_generated.yaml#L60-L62
Thank you Andy for your answer. So it means that when using this local-pv-provisioner project code we are not exposed to the direct "hostPath" security risks mentioned in the Kubernetes official documentation, right? thank you
@raphaelpoumarede local-pv-provisioner project are using hostPath to discover all disks and finally generate local PV.
@raphaelpoumarede I took some notes after discussing this item with our team:
- These volumes are the important ones, /dev might be marked as read only but /mnt/disks might need write permissions because we need to support cleaning the data behind these volumes (2 ways of cleaning up data, rm -rf all the data in the filesystem or provide a custom cleanup job) you could try setting these as read only but we haven't tested that.
- The container is already privileged (we did a blame but couldn't find if this was set for block volumes only) and therefore even after setting the volume mounts as read only we're not sure if the attack surface is reduced.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Reopen this issue with
/reopen - Mark this issue as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou can:
- Reopen this issue with
/reopen- Mark this issue as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
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/test-infra repository.