Shared host IPC namespace This product is not supported for your selected
Datadog site . (
).
Id: kubernetes-shared-host-ipc-namespace
Platform: Kubernetes
Severity: Medium
Category: Resource Management
Learn More Description Containers should not share the host IPC namespace. The ‘hostIPC’ field in the pod spec should be set to false or left undefined. ‘hostIPC: true’ grants containers access to the host IPC namespace, increasing the risk of privilege escalation and information exposure.
Compliant Code Examples apiVersion : v1
kind : Pod
metadata :
name : security-context-demo
spec :
hostIPC : false
securityContext :
runAsUser : 1000
runAsGroup : 3000
fsGroup : 2000
volumes :
- name : sec-ctx-vol
emptyDir : { }
containers :
- name : sec-ctx-demo
image : busybox
command : [ "sh" , "-c" , "sleep 1h" ]
volumeMounts :
- name : sec-ctx-vol
mountPath : /data/demo
securityContext :
allowPrivilegeEscalation : false
apiVersion : serving.knative.dev/v1
kind : Configuration
metadata :
name : dummy-config
namespace : knative-sequence
spec :
template :
spec :
hostIPC : false
securityContext :
runAsUser : 1000
runAsGroup : 3000
fsGroup : 2000
volumes :
- name : sec-ctx-vol
emptyDir : { }
containers :
- name : sec-ctx-demo
image : busybox
command : [ "sh" , "-c" , "sleep 1h" ]
volumeMounts :
- name : sec-ctx-vol
mountPath : /data/demo
securityContext :
allowPrivilegeEscalation : false
Non-Compliant Code Examples apiVersion : v1
kind : Pod
metadata :
name : security-context-demo
spec :
hostIPC : true
securityContext :
runAsUser : 1000
runAsGroup : 3000
fsGroup : 2000
volumes :
- name : sec-ctx-vol
emptyDir : { }
containers :
- name : sec-ctx-demo
image : busybox
command : [ "sh" , "-c" , "sleep 1h" ]
volumeMounts :
- name : sec-ctx-vol
mountPath : /data/demo
securityContext :
allowPrivilegeEscalation : false
apiVersion : serving.knative.dev/v1
kind : Configuration
metadata :
name : dummy-config
namespace : knative-sequence
spec :
template :
spec :
hostIPC : true
securityContext :
runAsUser : 1000
runAsGroup : 3000
fsGroup : 2000
volumes :
- name : sec-ctx-vol
emptyDir : { }
containers :
- name : sec-ctx-demo
image : busybox
command : [ "sh" , "-c" , "sleep 1h" ]
volumeMounts :
- name : sec-ctx-vol
mountPath : /data/demo
securityContext :
allowPrivilegeEscalation : false