AllowPrivilegeEscalation — prevent process from gaining more privileges.
1apiVersion: v12kind: Pod3metadata:4 name: no-escalation-pod5spec:6 securityContext:7 runAsNonRoot: true8 containers:9 - name: app10 image: nginx:latest11 securityContext:12 allowPrivilegeEscalation: false13 capabilities:14 drop:15 - ALL
1kubectl get pod no-escalation-pod -o jsonpath='{.spec.containers[0].securityContext.allowPrivilegeEscalation}'2kubectl exec no-escalation-pod -- cat /proc/1/status | grep CapEff
Default: true. Best Practice: set to false for all containers.