Skip to content

Commit a17cf86

Browse files
authored
Merge pull request #56 from minima1cha0s/main
fix: deny exec-create and pause paths when their env vars are unset
2 parents d906b09 + 7552be3 commit a17cf86

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)