Description
A privileged Linux container receives all capabilities and can bypass restrictions such as seccomp and AppArmor.
Potential impact
A compromised application can reach node devices and kernel functions, putting other workloads on the node at risk.
Remediation
Remove securityContext.privileged or set it to false in the workload template. Grant only the device access and capabilities the application needs. Review hostPath, hostNetwork, and the runtime user, then test the workload. Isolate system tasks that truly require privileged mode and restrict who can run them.
Examples
Before
yaml
apiVersion: v1
kind: Pod
metadata:
name: privileged-pod
spec:
containers:
- name: app
image: gcr.io/google-samples/node-hello:1.0
securityContext:
privileged: true
After
yaml
apiVersion: v1
kind: Pod
metadata:
name: standard-pod
spec:
containers:
- name: app
image: gcr.io/google-samples/node-hello:1.0
securityContext:
privileged: false