Skip to content

Commit

Permalink
feat: add options for allowing stop and start
Browse files Browse the repository at this point in the history
  • Loading branch information
sammcj committed Nov 26, 2023
1 parent 41d6a27 commit bea02af
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ extremely critical but can expose some information that your service does not ne
- `COMMIT`
- `CONFIGS`
- `CONTAINERS`
- `ALLOW_START` (containers/`id`/`start`)
- `ALLOW_STOP` (containers/`id`/`stop`)
- `ALLOW_RESTARTs` (containers/`id`/`stop`|`restart`|`kill`)
- `DISTRIBUTION`
- `EXEC`
- `GRPC`
Expand Down
2 changes: 2 additions & 0 deletions haproxy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ frontend dockerfrontend
bind :2375
http-request deny unless METH_GET || { env(POST) -m bool }
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/((stop)|(restart)|(kill)) } { env(ALLOW_RESTARTS) -m bool }
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/start } { env(ALLOW_START) -m bool }
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/containers/[a-zA-Z0-9_.-]+/stop } { env(ALLOW_STOP) -m bool }
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/auth } { env(AUTH) -m bool }
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/build } { env(BUILD) -m bool }
http-request allow if { path,url_dec -m reg -i ^(/v[\d\.]+)?/commit } { env(COMMIT) -m bool }
Expand Down

0 comments on commit bea02af

Please sign in to comment.