liveBook · Manning

Inter-process communication namespace

As explained in Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more

An IPC namespace is a Linux namespace that isolates System V IPC objects, POSIX message queues, and the /dev/shm shared-memory filesystem.

An IPC namespace isolates System V IPC objects, POSIX message queues, and the /dev/shm tmpfs from the host and other containers. Containers can therefore reuse IPC names without conflicts. section 10.6

Podman can connect containers to one IPC namespace with --ipc=container:NAME or by running them in a pod. They can communicate through IPC while remaining isolated from the host. The --ipc=host option instead exposes the host IPC namespace and disables that separation. section 10.6

Listing 10.8 IPC namespace keeping /dev/shm private to each container
$ podman run -d --rm --name ipc1 ubi8 bash 
 -c "touch /dev/shm/ipc1; sleep 1000"                              #1
93df44264dd4b87d24f59dfffb92a6a0b6359bc5bcf94213d5e38499a10d3f3e
$ podman run --rm ubi8 ls /dev/shm                                   #2
$ podman run --rm --ipc=container:ipc1 ubi8 ls /dev/shm              #3
ipc1

A command sequence demonstrates that /dev/shm is private by default, then visible to a container joining ipc1's namespace. section 10.6

Account for these security boundaries:

  • Treat --ipc=host as a deliberate security exception because it permits access to host IPC resources. section 10.6
  • On SELinux systems, containers sharing an IPC namespace receive a common SELinux label so their IPC communication is permitted. section 10.6

How Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more covers it

How deep it goes
Explains isolated resources, sharing modes, /dev/shm behavior, and SELinux consequences with Podman commands.
Examples
Demonstrates private /dev/shm storage and shared visibility through --ipc=container:ipc1.
What you can do after
Operate/configure Podman containers with private, shared, or host IPC namespaces and recognize the security trade-offs.
How it connects
Connects Linux namespaces with System V IPC, POSIX message queues, shared memory, pods, Podman, and SELinux.

Also explained in

Compare how 2 books explain inter-process communication namespace →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Podman in Action: Secure, rootless containers for Kubernetes, microservices, and more. The section links point to the parts of the book it draws on.