-
Notifications
You must be signed in to change notification settings - Fork 17
Description
The Docker Deploy Daemon recommended configuration (AppAPI Docker Socket Proxy or AIO Docker Socket Proxy container) breaks Docker container isolation and Nextcloud/webserver user isolation. The first described configuration in the doco doesn't offer even that security, and there are no checks to warn the user. It is a significant security risk which users should take consciously - it is not appropriate as an out of the box feature with no warnings.
The docker socket proxy containers are thoughtfully built and much better than nothing! But still, they open a significant attack surface. Access to the nextcloud database (haproxy password) grants the ability to deploy arbitrary containers, limited only by naming pattern and number of volumes. This is effective root access on the Docker host. Docker documentation strongly advises against this pattern as a security risk.
Attaching a docker socket to a web service is a significant security risk which home users are likely to take unknowingly, and enterprise users do not expect in a "stable" "enterprise" product which includes large organizations and at-risk groups as primary users/customers. Amnesty International is a case study on the website, after all! There is fantastic promise in app_api, but if image preview providers are considered too insecure to enable by default (according to the threat model page), the docker socket proxy - and app_api by extension since that's the only supported option - certainly should be considered insecure, too.
I don't mean to be a hater; if it's really a requirement to allow Nextcloud Apps to launch their own containers there are plenty of ways to make this work. Top of my head:
- make the remote docker host the recommended approach, because it is isolated from the NC host and therefore has more limited issues with escalated data and resource access. Plus it is easy to state the risks in an error message.
- Recommend sysbox (and use it in the AIO VM image). (This would also support kubernetes)
- Instead of recommending the user manage a container that proxies the host's docker socket, recommend they manage:
- a docker-in-docker container. This second container has to be run privileged - good, the user has to opt-in to the risk - and it can contain all the child containers without breaking isolation.
- a firecracker-in-docker container, which starts a microVM with an isolated docker daemon. This would isolate the ExApps containers.
- each ExApp container manually, and smooth the Ux to do that.
- Eg App_Api admin pane could list ExApps that don't appear to be running, and the appropriate
docker runcommand for each one (including auth tokens)
- Eg App_Api admin pane could list ExApps that don't appear to be running, and the appropriate
I am sure the team has or is considering these kinds of approaches. But until a better security model exists than a Haproxy password and some regexes, this app should be marked as insecure and not enabled by default.