You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
I liked the sound of a widget showing Docker containers status, however there is one thing that will keep me from that - it seems to allow only the mentioned connection via a socket.
Now, as a security practice, all containers I use that need a connection to Docker just to pull some information (like traefik for example) go through an instance of docker-socket-proxy, which uses haproxy to proxy the requests to the Docker socket mounted there, allowing only selected methods/endpoints, specified using predefinied environment variables, itself exposing nothing else than the proxy on port 2375.
The way you would set it up is, you run a separate container with the above alongside the one that needs the Docker information with CONTAINERS=1 environment variable to allow the /containers endpoint and in the container of the application that needs the info you set DOCKER_HOST=tcp://<container_name>:2375 environment variable, for example:
With a setup like this, the application requesting the data is only allowed requests that are GET/HEAD to /containers,/events,/ping and /version, preventing it the possibility to start, stop, create, exec, delete or any other action that should probably not be allowed to an application that does not handle such actions anyway.
Of course, with the idea of allowing more hosts, instead of a global variable an option in widget could be used.
As far as I can see, the original commiter, based on the docs/configuration.md file, intented for it to work that way, but the concept changed somewhere between his rework and the release.
Kind regards.
The text was updated successfully, but these errors were encountered:
Hey, thanks for providing such a detailed explanation! I think this is a reasonable request and shouldn't be difficult to add, here's what I have in mind config-wise:
svilenmarkov
changed the title
Allow Docker containers widget to pull data from DOCKER_HOST instead of socket
Allow Docker containers widget to pull data from proxied socket
Feb 10, 2025
Hi.
I liked the sound of a widget showing Docker containers status, however there is one thing that will keep me from that - it seems to allow only the mentioned connection via a socket.
Now, as a security practice, all containers I use that need a connection to Docker just to pull some information (like traefik for example) go through an instance of docker-socket-proxy, which uses
haproxy
to proxy the requests to the Docker socket mounted there, allowing only selected methods/endpoints, specified using predefinied environment variables, itself exposing nothing else than the proxy on port 2375.The way you would set it up is, you run a separate container with the above alongside the one that needs the Docker information with
CONTAINERS=1
environment variable to allow the/containers
endpoint and in the container of the application that needs the info you setDOCKER_HOST=tcp://<container_name>:2375
environment variable, for example:With a setup like this, the application requesting the data is only allowed requests that are
GET
/HEAD
to/containers
,/events
,/ping
and/version
, preventing it the possibility to start, stop, create, exec, delete or any other action that should probably not be allowed to an application that does not handle such actions anyway.Of course, with the idea of allowing more hosts, instead of a global variable an option in widget could be used.
As far as I can see, the original commiter, based on the
docs/configuration.md
file, intented for it to work that way, but the concept changed somewhere between his rework and the release.Kind regards.
The text was updated successfully, but these errors were encountered: