Skip to content

Commit 6bbed16

Browse files
liggittMisty Linville
authored and
Misty Linville
committed
PSP readOnly hostPath (#8898)
1 parent 903d714 commit 6bbed16

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

content/en/docs/concepts/policy/pod-security-policy.md

+11-3
Original file line numberDiff line numberDiff line change
@@ -421,19 +421,27 @@ minimum value of the first range as the default. Validates against all ranges.
421421
to be used by hostPath volumes. An empty list means there is no restriction on
422422
host paths used. This is defined as a list of objects with a single `pathPrefix`
423423
field, which allows hostPath volumes to mount a path that begins with an
424-
allowed prefix. For example:
424+
allowed prefix, and a `readOnly` field indicating it must be mounted read-only.
425+
For example:
425426

426427
```yaml
427428
allowedHostPaths:
428429
# This allows "/foo", "/foo/", "/foo/bar" etc., but
429430
# disallows "/fool", "/etc/foo" etc.
430431
# "/foo/../" is never valid.
431432
- pathPrefix: "/foo"
433+
readOnly: true # only allow read-only mounts
432434
```
433435

434-
_Note: There are many ways a container with unrestricted access to the host
436+
{{< warning >}}**Warning:** There are many ways a container with unrestricted access to the host
435437
filesystem can escalate privileges, including reading data from other
436-
containers, and abusing the credentials of system services, such as Kubelet._
438+
containers, and abusing the credentials of system services, such as Kubelet.
439+
440+
Writeable hostPath directory volumes allow containers to write
441+
to the filesystem in ways that let them traverse the host filesystem outside the `pathPrefix`.
442+
`readOnly: true`, available in Kubernetes 1.11+, must be used on **all** `allowedHostPaths`
443+
to effectively limit access to the specified `pathPrefix`.
444+
{{< /warning >}}
437445

438446
**ReadOnlyRootFilesystem** - Requires that containers must run with a read-only
439447
root filesystem (i.e. no writable layer).

0 commit comments

Comments
 (0)