Skip to content

Commit be8d63e

Browse files
authored
Merge pull request #39002 from waych/pv_doc
Update RBAC Good Practices for PersistentVolumes
2 parents a10763d + d077988 commit be8d63e

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

content/en/docs/concepts/security/rbac-good-practices.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,20 @@ considered weak.
121121

122122
### Persistent volume creation
123123

124-
As noted in the [PodSecurityPolicy](/docs/concepts/security/pod-security-policy/#volumes-and-file-systems)
125-
documentation, access to create PersistentVolumes can allow for escalation of access to the underlying host.
124+
If someone - or some application - is allowed to create arbitrary PersistentVolumes, that access
125+
includes the creation of `hostPath` volumes, which then means that a Pod would get access
126+
to the underlying host filesystem(s) on the associated node. Granting that ability is a security risk.
127+
128+
There are many ways a container with unrestricted access to the host filesystem can escalate privileges, including
129+
reading data from other containers, and abusing the credentials of system services, such as Kubelet.
130+
131+
You should only allow access to create PersistentVolume objects for:
132+
133+
- users (cluster operators) that need this access for their work, and who you trust,
134+
- the Kubernetes control plane components which creates PersistentVolumes based on PersistentVolumeClaims
135+
that are configured for automatic provisioning.
136+
This is usually setup by the Kubernetes provider or by the operator when installing a CSI driver.
137+
126138
Where access to persistent storage is required trusted administrators should create
127139
PersistentVolumes, and constrained users should use PersistentVolumeClaims to access that storage.
128140

0 commit comments

Comments
 (0)