File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
content/en/docs/concepts/storage Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -529,6 +529,15 @@ See the [GlusterFS example](https://github.com/kubernetes/examples/tree/{{< para
529
529
530
530
# ## hostPath {#hostpath}
531
531
532
+ {{< warning >}}
533
+ HostPath volumes present many security risks, and it is a best practice to avoid the use of
534
+ HostPaths when possible. When a HostPath volume must be used, it should be scoped to only the
535
+ required file or directory, and mounted as ReadOnly.
536
+
537
+ If restricting HostPath acccess to specific directories through AdmissionPolicy, `volumeMounts` MUST
538
+ be required to use `readOnly` mounts for the policy to be effective.
539
+ {{< /warning >}}
540
+
532
541
A `hostPath` volume mounts a file or directory from the host node's filesystem
533
542
into your Pod. This is not something that most Pods will need, but it offers a
534
543
powerful escape hatch for some applications.
@@ -558,6 +567,9 @@ The supported values for field `type` are:
558
567
559
568
Watch out when using this type of volume, because :
560
569
570
+ * HostPaths can expose privileged system credentials (such as for the Kubelet) or privileged APIs
571
+ (such as container runtime socket), which can be used for container escape or to attack other
572
+ parts of the cluster.
561
573
* Pods with identical configuration (such as created from a PodTemplate) may
562
574
behave differently on different nodes due to different files on the nodes
563
575
* The files or directories created on the underlying hosts are only writable by root. You
You can’t perform that action at this time.
0 commit comments