Description
In a legacy PSP, allowedCapabilities lists the extra Linux capabilities a container may request. A wildcard (*) allows requests for any capability.
Potential impact
A container that actually receives an extra capability may gain control over processes or network settings, depending on the capability.
Remediation
Allow only the capabilities a workload needs. Review default capability drops, privileged mode and privilege escalation separately. Kubernetes deprecated PSP in 1.21 and removed it in 1.25. On current clusters, enforce limits with Pod Security Admission or a policy engine. Verify that normal workloads work and unapproved additions are rejected.
Examples
The second excerpt omits the additional allow-list. Runtime defaults may still remain. Its volumes: ["*"] allows every volume type, so narrow that list separately.
Before
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: privileged
spec:
allowedCapabilities:
- "*"
After
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: privileged
spec:
volumes:
- "*"