Skip to content

Commit 7552be3

Browse files
committed
fix: deny exec-create and pause paths when their env vars are unset
EXEC=0 documented as covering /containers/{id}/exec but the template only gated paths starting with /exec, so exec-create fell through the generic containers allow. ALLOW_PAUSE was allow-only with no deny rule, so pause fell through whenever CONTAINERS=1 and POST=1. Add the missing deny rules in the same style as the existing archive/change/export/ logs/top denies. Ref: Tecnativa/docker-socket-proxy#114
1 parent d906b09 commit 7552be3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎root/templates/haproxy.cfg‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,16 @@ frontend proxy
3333
acl allow_export env(ALLOW_EXPORT) -m bool
3434
acl allow_logs env(ALLOW_LOGS) -m bool
3535
acl allow_top env(ALLOW_TOP) -m bool
36+
acl allow_pause env(ALLOW_PAUSE) -m bool
37+
acl allow_exec env(EXEC) -m bool
3638

3739
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(archive) } !allow_archive
3840
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(change) } !allow_change
3941
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(export) } !allow_export
4042
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(logs) } !allow_logs
4143
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(top) } !allow_top
44+
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(pause) } !allow_pause
45+
http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/containers/[a-zA-Z0-9_.-]+/(exec) } !allow_exec
4246

4347
# Docker's archive extraction endpoint only consumes tar request bodies when
4448
# their media type is application/x-tar. Supply the documented media type

0 commit comments

Comments
 (0)