Repository navigation
✨ feat(filter): gate host cgroup namespace on container create (allow_host_cgroupns) - #133
Conversation
allow_host_cgroupns (opt-in, default false) denies HostConfig.CgroupnsMode=host on POST /containers/create. It's the one host-namespace mode v1.5's namespace- hardening pass missed: c76ff4d added the host-mode denial for UTSMode and the container:<ref> sharing gate across Network/PID/IPC/Userns, but CgroupnsMode was never parsed or gated — the decode struct didn't even carry the field, so cgroupns:host (host cgroup-hierarchy disclosure + cgroup-escape vector) passed through uninspected. Mechanical mirror of the allow_host_userns wiring. - ✨ feat(filter): allow_host_cgroupns rail + CgroupnsMode decode field + gate - 🔧 config(presets): list allow_host_cgroupns: false in the three hardened presets (cis, github-actions-runner, gitlab-runner) + compose copies - 📝 docs(changelog,readme,config): document the new opt-in - 🧪 test(filter): host/private/empty/case/whitespace + gate-independence cases Defaults handled by the v1.5 reflection walker (no manual SetDefault). Found by the post-v1.5 roadmap audit as the only clean coherence gap for the rc.
|
@coderabbitai review |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (14)
📝 WalkthroughWalkthroughAdded 🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
✅ Action performedReview finished.
|
What
Adds
request_body.container_create.allow_host_cgroupns(opt-in, defaultfalse), gatingHostConfig.CgroupnsMode=hostonPOST /containers/create.Why
This is the one host-namespace mode v1.5's own namespace-hardening pass missed. Commit
c76ff4d(the v1.5 namespace-sharing gate) added the host-mode denial forUTSModeand thecontainer:<ref>sharing gate across Network/PID/IPC/Userns — butCgroupnsModewas never parsed or gated. The decode struct didn't even carry the field, socgroupns: host(share the host's cgroup namespace — a host-cgroup-hierarchy information-disclosure and cgroup-escape vector) passed straight through uninspected.Surfaced by the post-v1.5 roadmap audit (workflow) as the only clean coherence gap in v1.5's shipped feature set — small, additive, opt-in, and it completes an already-shipped mechanism, so it belongs in this release rather than v1.6.
Changes
container_create.go— newallow_host_cgroupnsrail, a mechanical mirror of theallow_host_usernswiring (config field → filter option → policy →inspect()gate). DeniesCgroupnsMode=hostunless opted in; case-insensitive + trimmed via the sharedisHostNamespaceMode.container_create_types.go— added the previously-missingCgroupnsModefield.SOCKGUARD_REQUEST_BODY_CONTAINER_CREATE_ALLOW_HOST_CGROUPNSoverride off the struct (default false = zero value).cis-docker-benchmark,github-actions-runner,gitlab-runner) now listallow_host_cgroupns: falseexplicitly (+ theirexamples/compose/copies). No behavior change — they already denied it via the default — just self-documenting completeness. CIS gets an honest "no dedicated CIS control" comment.[Unreleased],configuration.mdx(example + key list), README "Shipping in v1.5" namespace-sharing row.Not in scope
The broader create/update-parity and swarm-service-parity gaps the same audit found are real but need design calls / are M/L — they're the v1.6 "Create/Update Parity & Resource-Limit Hardening" theme, not this release. See
.planning/v1.6-roadmap.md.Changelog
allow_host_cgroupnsconfiguration, defaulting tofalse.HostConfig.CgroupnsMode=hostunless explicitly allowed.