PodSecurityPolicy permits sharing host IPC

A policy permitting host IPC sharing can weaken isolation of interprocess communication between workloads and the node.

Description

In a legacy PodSecurityPolicy (PSP), hostIPC: true permits a Pod to request the node’s IPC namespace. A Pod that uses it can see host IPC objects such as shared memory, semaphores and message queues.

Potential impact

If the object permissions allow it, a container may read or change data used by other processes.

Remediation

Set hostIPC: false in the legacy PSP and remove host IPC requests from ordinary Pods. Limit exceptions to essential system tools. Review hostPID, hostNetwork and privileged mode as separate controls.

Examples

These excerpts show only the IPC setting. Kubernetes deprecated PSP in 1.21 and removed it in 1.25. With Pod Security Admission or another policy, test that new host IPC requests are rejected and ordinary workloads still work.

Before

yaml
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  name: example
spec:
  hostIPC: true

After

yaml
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  name: example
spec:
  hostIPC: false

References