Control: Minimize the admission of containers wishing to share the host IPC namespace
Description
A container running in the host's IPC namespace can use IPC to interact with processes outside the container. There should be at least one PodSecurityPolicy (PSP) defined which does not permit containers to share the host IPC namespace.
Usage
Run the control in your terminal:
powerpipe control run kubernetes_compliance.control.pod_security_policy_hostipc_sharing_disabled
Snapshot and share results via Turbot Pipes:
powerpipe loginpowerpipe control run kubernetes_compliance.control.pod_security_policy_hostipc_sharing_disabled --share
SQL
This control uses a named query:
select coalesce(uid, concat(path, ':', start_line)) as resource, case when host_ipc then 'alarm' else 'ok' end as status, case when host_ipc then 'Pod security policy ' || name || ' pods can share host IPC namespaces.' else 'Pod security policy ' || name || ' pods cannot share host IPC namespaces.' end as reason , coalesce(context_name, '') as context_name, source_type, coalesce(path || ':' || start_line || '-' || end_line, '') as pathfrom kubernetes_pod_security_policy;