More Info:
Creating PersistentVolumes can enable privilege escalation via hostPath volumes. This permission should be limited to trusted administrators only.Risk Level
HighAddress
SecurityCompliance Standards
- CIS AKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
On any machine with kubectl access, list all ClusterRoles and Roles that can create PersistentVolumes:
-
For each identified ClusterRole/Role, list the subjects bound to it to understand who can create PersistentVolumes:
-
For each Role/ClusterRole and its bound subjects, classify whether they are trusted administrators (e.g., dedicated admin groups, platform SRE service accounts) or non‑administrative users/workloads by reviewing your access model and group mappings (for example via your IdP or
kubectl describeon ServiceAccounts): -
For any non‑administrative subject that should not create PersistentVolumes, edit the associated Role/ClusterRole to remove the
createverb onpersistentvolumeswhile preserving other needed permissions:In the editor, locate rules whereresourcesincludespersistentvolumes(orpersistentvolume) and removecreate(and*if overly broad) fromverbsfor that resource, or split the rule so PersistentVolumes no longer havecreategranted. -
Where a Role/ClusterRole exists solely to grant PV creation to non‑admins and is no longer required, remove the bindings or the role itself (after confirming no legitimate dependency):
-
Verify that PV creation is now limited to the intended admin roles only by re-running the evidence collection and confirming that only trusted admin roles retain
createon PersistentVolumes:
Using kubectl
Using kubectl
- Any listed ClusterRole or Role is capable of creating PersistentVolumes.
- Pay particular attention to:
- Broadly named roles such as
edit,developer,default, or app-specific roles not intended for cluster administration. - Roles in application namespaces (e.g.,
team-a/*,prod-app/*) that includecreateor*onpersistentvolumes.
- Broadly named roles such as
- Under
rules:you see entries like:resources: ["persistentvolumes"]withverbs:containingcreateor*.
- If the role name/purpose suggests non-admin usage, this is likely excessive.
- Same as for ClusterRole: any rule granting
createor*onpersistentvolumesto non-admin roles is suspect.
subjects:includes:- Broad groups (e.g.,
system:authenticated,developers,ci-users). - Service accounts used by applications rather than administrators.
- Broad groups (e.g.,
- If such subjects are bound to a role that can create PersistentVolumes, this is a likely violation.
- Same as for ClusterRoleBinding: if non-admin users, groups, or service accounts are subjects, and the role grants
createonpersistentvolumes, this needs review.
- Output
yesfor identities that are not trusted administrators suggests privileges that should be reviewed and likely reduced.
Automation
Automation
- Any
CLUSTERROLE:orROLE:entry listed by this script that includes:RESOURCES: persistentvolumes(or includespersistentvolumesin a list), andVERBS:containingcreate
- These roles grant the ability to create
PersistentVolumeobjects. - For each such role, review who receives it using the
clusterrolebindingandrolebindinglistings:- If bound to non-administrative users, groups, or service accounts, this is a potential problem per CISAKS 4.1.8 and should be reviewed and likely removed or restricted.

