Container create: default-deny HostConfig, validate Mounts and the bind read-only mode
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 15/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- docker, go, rust, typescript
Línea de trabajo
Start with the POST /containers/create middleware in go/internal/middleware/mountsource.go and containerconfig.go, then the matching files in rs/src/middleware.rs and ts/src/middleware.ts. The issue asks for a default-deny allowlist on HostConfig, a Mounts check that matches the Binds whitelist, bind-mode parsing for read_write, and forcing Privileged to false even when container_config is empty. Done means the three repro creates return 403 in each implementation, and the policy tests cover the new rules. The issue is a breaking security change that needs maintainer agreement on the allowlist first.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
On POST /containers/create, the proxy checks only part of the request. Every other field goes to the daemon unchanged:
- The volume whitelist checks the host path of
HostConfig.Bindsand the legacy top-levelVolumes. It does not checkHostConfig.Mounts. - The bind mode is not checked.
read_write: falseis parsed in all three implementations, but no gate reads it. ContainerConfigMutatoroverwritesNetworkMode,RestartPolicy,SecurityOpt,Privileged,UserandLogConfig. Ifcontainer_configis empty, it returns early and does not even forcePrivileged: false.- Other
HostConfigfields pass through:Devices,DeviceRequests,DeviceCgroupRules,GroupAdd,CapAdd,VolumesFrom,Links,Sysctls,CgroupParent,Runtime, thehostvalues ofPidMode,IpcMode,UTSMode,UsernsModeandCgroupnsMode,MaskedPaths/ReadonlyPaths, andSecurityOptwhen the policy sets none.
So every policy-level restriction on mounts and privileges can be bypassed by a caller of the socket.
Affected implementation(s)
- Go
- Rust
- TypeScript
- All
Go go/internal/middleware/mountsource.go (Binds host path only), go/internal/middleware/containerconfig.go:13 (early return). Rust rs/src/middleware.rs and TypeScript ts/src/middleware.ts have the same gaps.
To Reproduce
Policy with volumes: [{host_path: /srv/ok, container_path: /ok, read_write: false}]. Through the proxy, each of these creates is accepted and the daemon receives the field unchanged:
docker create --mount type=bind,src=/,dst=/host alpine:3.20 truedocker create -v /srv/ok:/ok:rw alpine:3.20 true(also-v /srv/ok:/okwith no mode)docker create --cap-add SYS_ADMIN --pid host alpine:3.20 true
Expected behavior
Default-deny on HostConfig:
- A
HostConfigkey outside a fixed allowlist must be absent or hold its zero value. Otherwise the proxy returns403and names the field. A denylist would miss fields that the Engine API adds later. HostConfig.Mountsgets the same whitelist asBinds.bindmounts must match a policy volume, withReadOnly: trueif the volume is notread_write.volumemounts and all other types excepttmpfsare denied.- Each bind mode is parsed. A volume with
read_write: falserequiresro. - The mutator forces
Privileged: falseeven ifcontainer_configis empty.SecurityOptfrom the caller is denied unless the policy lists it, apart fromno-new-privileges.
Status: Break Change: creates that set these fields are now denied.
Additional context
Found while verifying the proxy for ChainSafe/lodestar-infrastructure#9.
- Lenguaje dominante
- Rust
- Estrellas
- 2
- Forks
- 0
- Merge medio
- 13 h 22 min
- PR fusionados (30 d)
- 27
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ChainSafe/docker-socket-policy
-
Lifecycle actions and DELETE are allowed on containers that no policy coversPosiblemente ocupada @abienkowski la tomó hoy. AbiertoPriority: P1 Status: Break Change Type: Bug
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
ChainSafe/docker-socket-policy#86 ·
Los mantenedores suelen responder en 1 día
-
Policy selection is nondeterministic when several policies allow one image; add container_names routing and deny on ambiguityPosiblemente ocupada @abienkowski la tomó hoy. AbiertoPriority: P1 Type: Bug
Dificultad 4/5 3-5 días Aptitud para principiantes 18/100
ChainSafe/docker-socket-policy#85 ·
Los mantenedores suelen responder en 1 día
-
Type: Feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
ChainSafe/docker-socket-policy#65 ·
Los mantenedores suelen responder en 1 día
-
Type: Enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
ChainSafe/docker-socket-policy#46 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de ChainSafe/docker-socket-policy
Issues similares
-
rustix::termios::Termios::OutputModes does not expost some const e.g. OLCUC for musl and macOSAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
bytecodealliance/rustix#1706 · 1 comentario ·
Los mantenedores suelen responder en 11 días
-
`LazyFrameRemote` and `ExecuteRemote` sinks do not accept `Path`, like `LazyFrame` sinks do.Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
-
Bump anybuf version to ^1.0.0Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
wormhole-foundation/wormhole#5062 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
RUSTSEC-2026-0348: Brotli certificate decompression can allocate up to 1 GiB before authenticationAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100