Hi! ufw-docker makes the assumption that "private networks are more trusted than public networks". I think that is not a safe assumption to make. If you are, like me, running docker on your laptop, the local network includes anyone on your train, your hotel, or at your conference.
So instead of allowing traffic to docker containers based on IP addresses, it seems much safer to do so based on interface names. Allow traffic for the docker* and br-* devices allows containers to communicate, but does not allow traffic from the local subnet, unless allowed via ufw.
I think that's what people would generally expect/want. I made a very simple proof of concept: https://github.com/brightbyte/docker-fw. Works great for me.
Hi! ufw-docker makes the assumption that "private networks are more trusted than public networks". I think that is not a safe assumption to make. If you are, like me, running docker on your laptop, the local network includes anyone on your train, your hotel, or at your conference.
So instead of allowing traffic to docker containers based on IP addresses, it seems much safer to do so based on interface names. Allow traffic for the
docker*andbr-*devices allows containers to communicate, but does not allow traffic from the local subnet, unless allowed via ufw.I think that's what people would generally expect/want. I made a very simple proof of concept: https://github.com/brightbyte/docker-fw. Works great for me.