Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN \
/tmp/*

ENV ALLOW_ARCHIVE=0 \
ALLOW_ATTACH=0 \
ALLOW_CHANGES=0 \
ALLOW_EXPORT=0 \
ALLOW_LOGS=0 \
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN \
/tmp/*

ENV ALLOW_ARCHIVE=0 \
ALLOW_ATTACH=0 \
ALLOW_CHANGES=0 \
ALLOW_EXPORT=0 \
ALLOW_LOGS=0 \
Expand Down
1 change: 1 addition & 0 deletions Dockerfile.riscv64
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ RUN \
/tmp/*

ENV ALLOW_ARCHIVE=0 \
ALLOW_ATTACH=0 \
ALLOW_CHANGES=0 \
ALLOW_EXPORT=0 \
ALLOW_LOGS=0 \
Expand Down
4 changes: 4 additions & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ full_custom_readme: |
container_name: socket-proxy
environment:
- ALLOW_ARCHIVE=0 #optional
- ALLOW_ATTACH=0 #optional
- ALLOW_CHANGES=0 #optional
- ALLOW_EXPORT=0 #optional
- ALLOW_LOGS=0 #optional
Expand Down Expand Up @@ -224,6 +225,7 @@ full_custom_readme: |
docker run -d \
--name=socket-proxy \
-e ALLOW_ARCHIVE=0 `#optional` \
-e ALLOW_ATTACH=0 `#optional` \
-e ALLOW_CHANGES=0 `#optional` \
-e ALLOW_EXPORT=0 `#optional` \
-e ALLOW_LOGS=0 `#optional` \
Expand Down Expand Up @@ -290,6 +292,7 @@ full_custom_readme: |
| Parameter | Function |
| :----: | --- |
| `-e ALLOW_ARCHIVE=0` | `(/libpod)?/(containers∣pods)/{id}/archive` |
| `-e ALLOW_ATTACH=0` | `(/libpod)?/containers/{id}/attach` and `/attach/ws`, whatever `POST` is set to |
| `-e AUTH=0` | `/auth` |
| `-e BUILD=0` | `/build` |
| `-e COMMIT=0` | `/commit` |
Expand Down Expand Up @@ -471,6 +474,7 @@ full_custom_readme: |

## Versions

* **22.11.26:** - Add `ALLOW_ATTACH`; container attach is now denied by default, also with `POST=1`.
* **05.10.26:** - Add `TIMEOUT_CLIENT` & `TIMEOUT_SERVER` options.
* **18.08.26:** - Add `ALLOW_ARCHIVE`, `ALLOW_CHANGES`, `ALLOW_EXPORT`, `ALLOW_LOGS`, `ALLOW_TOP` options.
* **15.06.26:** - Rebase to Alpine 3.24.
Expand Down
2 changes: 2 additions & 0 deletions root/templates/haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ frontend proxy
bind @@BIND_PROTO@@

acl allow_archive env(ALLOW_ARCHIVE) -m bool
acl allow_attach env(ALLOW_ATTACH) -m bool
acl allow_change env(ALLOW_CHANGES) -m bool
acl allow_export env(ALLOW_EXPORT) -m bool
acl allow_logs env(ALLOW_LOGS) -m bool
Expand All @@ -37,6 +38,7 @@ frontend proxy
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/[a-zA-Z0-9_.-]+/(attach) } !allow_attach
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
Expand Down