CL-0010: pid: host / ipc: host — host namespace sharing¶
Severity: HIGH (how it is derived)
The service shares the host's process table (pid: host) or its shared-memory
namespace (ipc: host), so it can see and signal every process on the machine
or read other workloads' shared memory. Remove the line, or share with the one
service that needs it.
Fix¶
Remove the namespace sharing directive:
# Before
services:
monitor:
image: myapp:1.0
pid: host
ipc: host
# After
services:
monitor:
image: myapp:1.0
If your application requires cross-container PID visibility (e.g., sidecar patterns), use pid: "service:other-container" instead of pid: host to limit the scope.
- Share with one service instead of the host. A sidecar that inspects one service can join that service's namespace and nothing else:
services:
sidecar:
image: mysidecar:1.0
pid: "service:app" # sees app's processes, not the host's
owner:
image: myapp:1.0
ipc: shareable # lets one named service join its IPC namespace
worker:
image: myapp:1.0
ipc: "service:owner"
- Recreate the service and check what it sees. A container in its own PID namespace sees a handful of processes; one sharing the host's sees them all:
docker compose up -d monitor
docker compose exec monitor sh -c 'ls /proc | grep -c "^[0-9]"'
# 5 (521 on the test host under pid: host)
# The IPC namespace should differ from the host's
docker compose exec monitor readlink /proc/self/ns/ipc
readlink /proc/self/ns/ipc # on the host
- Check the finding is gone:
compose-lint -q compose.yaml | grep CL-0010 # prints nothing once fixed
Verified against Docker 29.7.2 with busybox:1.37: pid: "service:app" put
the sidecar in app's PID namespace, seeing its 5 processes, and ipc: host
gave the container the host's IPC namespace id.
Tested on: Docker 29.7.2 with Compose 5.5.0, on a host without AppArmor (Yama ptrace_scope 1); the Fix steps above were re-run there in October 2026. The /proc/1/environ denial was also re-run on Docker 29.1.3, Debian 13 with AppArmor, and held. Not tested: SELinux.
What it detects¶
Any service with:
- pid: host — shares the host's PID namespace
- ipc: host — shares the host's IPC namespace
Other values (e.g., ipc: shareable) are not flagged. The comparison is case-sensitive, as Docker's is: pid: HOST and ipc: HOST are refused by the daemon (Error response from daemon: invalid PID mode: HOST and invalid IPC mode: HOST, captured on Docker 29.7.2, not CI-asserted), so the container never starts sharing a namespace and there is nothing to flag.
uts: host and userns_mode: host used to be flagged here and are not any
more. Both are no-ops under the posture these rules are graded against
(ADR-020):
uts: hostshares the host's UTS namespace, but changing the hostname needsCAP_SYS_ADMIN, which is not in Docker's default set. Verified: the call is refused (hostname: sethostname: Operation not permitted, re-proven on every CI run byscripts/validate_rule_premises.py) even when setting the hostname to the value it already had. The container reads the host's hostname and cannot change it.userns_mode: hostopts out of daemon-level UID remapping, which only exists when the daemon runs with--userns-remap. Against a daemon at defaults there is nothing to opt out of —/proc/self/uid_mapis identical with and without it.
Flagging a directive that changes nothing is what removed CL-0023, and the same
bar applies here. If you run with --userns-remap, userns_mode: host is
meaningful on your hosts — that is a departure from the documented posture, and
the honest place to catch it is a policy check that knows your daemon
configuration.
Out of scope¶
Compose also accepts cgroup: host (cgroup-namespace sharing). No rule grades it. That is a demand decision, not a judgement that it is harmless: every service in the corpus that sets it is also privileged: true (CL-0002, CRITICAL), so a finding for it would reach no one first (Triage for a newly found gap in ASSURANCE.md). The measurement plan, and the ownership question between this rule and a new one, are in #1000; it is recounted at each corpus refresh.
cgroup_parent is not graded either. It places the container under a chosen
cgroup; CIS Docker Benchmark 5.25 asks that the placement be confirmed
appropriate, not that the key be absent, and the KICS query for it reports the
key's presence. No corpus file sets it.
Why it matters¶
Linux namespaces are a core container isolation mechanism. Sharing them with the host removes that boundary:
pid: host¶
The container sees every process on the host and can signal them, including SIGKILL — verified live: a default-capability container under pid: host listed 291 host processes. That is a recon and denial-of-service primitive against the host and every other container on it, and it defeats the PID-namespace boundary that makes a container's process list its own.
Reading another process's environment via /proc/[pid]/environ is not part of what this directive grants. An earlier revision of this page claimed it was; at default capabilities the read is refused (Permission denied, verified on /proc/1/environ). Getting it requires SYS_PTRACE and an unconfined AppArmor profile — two separate configurations, flagged by CL-0027 and CL-0009. Scoring that disclosure here would be claiming two other rules' impact as this one's.
ipc: host¶
The container can attach to host shared memory segments, potentially reading sensitive data from other applications or injecting data into them.
ATT&CK coverage¶
Remediating this finding contributes to mitigating the following MITRE ATT&CK techniques (pinned to ATT&CK v18). compose-lint is a static analyser, so this is mitigation coverage — it detects nothing at runtime.
| Technique | Tactic |
|---|---|
| T1611 Escape to Host | Privilege Escalation |
See also¶
- CL-0008 —
network_mode: host(host network namespace) - CL-0027 —
SYS_PTRACE, whose namespace confinementpid: hostremoves - CL-0002 —
privileged: true(often combined with these directives) - Hardening guide, step 11 — where this rule fits when hardening a whole file
Severity derivation¶
Derivation (see severity model):
- Baseline: A — the attacker already has code execution in this container, as the workload uid
- Precondition: Technique — the host process table and IPC objects become visible immediately, but converting that visibility into impact takes a technique: signalling a host process, or reading and writing a shared memory segment another workload trusts
- Impact: Cross-container — every container's processes and IPC objects, plus the host's
- Qualifier/modifier: none
- Derived: Technique × Cross-container = HIGH
- Shipped: HIGH
- Evidence:
_cl0010— underpid: hosta container saw 291 host processes on a live daemon. The reach is visibility and signalling: reading/proc/1/environat default capabilities is denied (verified), so the secret-disclosure path belongs toSYS_PTRACEand an unconfined AppArmor profile, which other rules score
References: - CIS Docker Benchmark 5.16 — Ensure that the host's process namespace is not shared - CIS Docker Benchmark 5.17 — Ensure that the host's IPC namespace is not shared
A reference means the rule relates to that source. It does not mean a file with no finding complies with it. The CIS, OWASP and ATT&CK mapping for every rule, and the tags SARIF output carries for it, are on Standards mapping.