dappnode / DAppNode

General repository of the project dappnode
GNU General Public License v3.0
587 stars 102 forks source link

Docker compose discussion #451

Open pablomendezroyo opened 2 years ago

pablomendezroyo commented 2 years ago

The docker-compose volumes, networks and service keys/volumes/networks are critical in dappnode since all dappnode packages are distributed through docker-compose.yml files.

service keys The compose keys may be critical and allow a container to gain privileges on the host and perform almost any type of attack.

In dappnode there is a compose keys "whitelist" to restrict the use of these keys. However this list has been growing due to necessities and it must be reviewed in deep.

To discuss:

networks There are currently two docker networks for simplicity in dappnode: dncore_network (for all containers) and dnpublic_network (for HTTPS portal mappings). The current setup is that no one owns any docker network, both of them are declared as external. The dncore_network is created on dappnode installation with docker network create. The dnpublic_network is created by the dappmanager when installing the HTTPS package.

To discuss:

volumes There are two types of docker volumes used in dappnode: named and bind-mounted volumes. Bind mounted volumes are dangerous and should be only used in a reasoned case of necessity (especially the docker socket volume)

To discuss:

┆Issue is synchronized with this Basecamp todo by Unito

dapplion commented 2 years ago

You must replace the "seems to be used nowhere" to "I have run a script checking all latest versions and guarantee that as of Jun 20th 2022 it's not used anywhere"

3alpha commented 2 years ago

Regarding exporter package, I've been running for last few days a package without root system exposed and majority of data is there. I think we should just remove rootfs binding because risk greatly overweigh (limited) benefits.

Wireguard needs kernel modules to run.

dapplion commented 2 years ago

Regarding exporter package, I've been running for last few days a package without root system exposed and majority of data is there. I think we should just remove rootfs binding because risk greatly overweigh (limited) benefits.

Wireguard needs kernel modules to run.

Please PR

tropicar commented 2 years ago
cap_add: used by [Mysterium](https://github.com/dappnode/DAppNodePackage-Mysterium/blob/836c62dc76c45aac188772fa8c506e8cd922908f/docker-compose.yml#L10). @tropicar could you find another approach to not use that capability? if not, could you explain why capability NET_ADMIN is necessary?

I don't know exactly why is required, but even in the Mysterium docs, they run the container with that flag by default. When I created the package, the package cant run without that option. I guess it's because the service requires some network permissions. I can ask them if it's possible but I am not so optimistic, but we can try it. https://docs.mysterium.network/for-node-runners/docker-guide