@@ -413,20 +413,29 @@ minimum value of the first range as the default. Validates against all ranges.
413
413
to be used by hostPath volumes. An empty list means there is no restriction on
414
414
host paths used. This is defined as a list of objects with a single `pathPrefix`
415
415
field, which allows hostPath volumes to mount a path that begins with an
416
- allowed prefix. For example :
416
+ allowed prefix, and a `readOnly` field indicating it must be mounted read-only.
417
+ For example :
417
418
418
419
` ` ` yaml
419
420
allowedHostPaths:
420
421
# This allows "/foo", "/foo/", "/foo/bar" etc., but
421
422
# disallows "/fool", "/etc/foo" etc.
422
423
# "/foo/../" is never valid.
423
424
- pathPrefix: "/foo"
425
+ # This only allows read-only mounts
426
+ - readOnly: true
424
427
` ` `
425
428
426
429
_Note : There are many ways a container with unrestricted access to the host
427
430
filesystem can escalate privileges, including reading data from other
428
431
containers, and abusing the credentials of system services, such as Kubelet._
429
432
433
+ {{< warning >}}**WARNING:** writeable hostPath directory volumes allow containers to write
434
+ to the filesystem in ways that let them traverse the host filesystem outside the `pathPrefix`.
435
+ `readOnly : true`, available in Kubernetes 1.11+, must be used to effectively limit access
436
+ to the specified `pathPrefix`.
437
+ {{< /warning >}}
438
+
430
439
**ReadOnlyRootFilesystem** - Requires that containers must run with a read-only
431
440
root filesystem (i.e. no writable layer).
432
441
0 commit comments