From 7552be316a8a8a0f602ee9cf5790cdfc24c3ca48 Mon Sep 17 00:00:00 2001 From: Abhirup Manna Date: Sun, 1 Nov 2026 21:14:51 +0530 Subject: [PATCH] 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 --- root/templates/haproxy.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/root/templates/haproxy.cfg b/root/templates/haproxy.cfg index f8f9751..f0f06c6 100644 --- a/root/templates/haproxy.cfg +++ b/root/templates/haproxy.cfg @@ -33,12 +33,16 @@ frontend proxy acl allow_export env(ALLOW_EXPORT) -m bool acl allow_logs env(ALLOW_LOGS) -m bool acl allow_top env(ALLOW_TOP) -m bool + acl allow_pause env(ALLOW_PAUSE) -m bool + acl allow_exec env(EXEC) -m bool http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(archive) } !allow_archive http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(change) } !allow_change http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(export) } !allow_export http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(logs) } !allow_logs http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(top) } !allow_top + http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/(containers|pods)/[a-zA-Z0-9_.-]+/(pause) } !allow_pause + http-request deny if { path,url_dec -m reg -i ^(/v[\d\.]+)?(/libpod)?/containers/[a-zA-Z0-9_.-]+/(exec) } !allow_exec # Docker's archive extraction endpoint only consumes tar request bodies when # their media type is application/x-tar. Supply the documented media type