-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
local lan blocking / one way communication #17
Comments
@mrpops2ko - just to clarify, you want to block the containers from accessing addresses on the specified LAN subnet, right? All containers? or just the ones on the trafficjammed network? FYI - the I'm definitely open to adding the functionality. You could even block access to the internet, if you wanted. There might also be a more elegant way to block LAN access without requiring env vars to define the docker host IP and LAN subnet... I'll have to think about this. |
yep thats right, but i think it would be best if this was integrated by doing it in the trafficjammed network because it lets others maintain the functionality otherwise if they desire it im not talking about the default like you said, it is just by default linux kernel routing that allows this i don't think we need to block access to the internet, because docker already does a good job of this if you create a network using the |
Have you tried using https://docs.docker.com/reference/cli/docker/network/create/#internal |
yep it does what it says on the tin, but that wouldn't work for us / most people because they ultimately do want external internet connectivity its just like how 19 = desktop
|
Got it. Let me play around with this and I'll see what I can come up with. |
hi im wondering if this kind of update would be something you would be interested in
so to provide an example, lets assume you have created a docker network called
traefik-public
and done the whole preventative container communcation for security etcthose containers because they are on the
bridge
docker network driver, are capable of pinging outwards - so if you have a remote desktop, or other devices in the lan then the containers are fully capable of communicating with them and under the scenario of an attacker gaining control of one of those containers they then have access to whatever resources are on your local network.I was thinking some kind of additional variables that define what your docker host and subnet are like;
DOCKER_HOST=192.168.1.2
LAN_SCOPE=192.168.1.1/24
i think we'd need to know the docker host because we cant block that, or else the containers won't be able to communicate outwards at all and then for the lan scope it'd maybe be something like
iptables -I DOCKER-USER -s 192.168.1.1/24 -d 172.17.0.0/16 -j ACCEPT
iptables -I DOCKER-USER -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -I DOCKER-USER -s 172.17.0.0/16 -d 192.168.1.1/24 -j DROP
im no good with iptables im just thinking out loud, im not even sure if thats how the networking would be because its internal docker NAT so it'd be the location of the docker host wouldn't it?
i guess another solution for this outside of the scope of trafficjam would be to slap a vlan tag on this and then centrally manage it at the firewall level instead with appropriate connectivity rules
The text was updated successfully, but these errors were encountered: