Keep other machines on the network from reaching Docker containers
shellcheck / shellcheck (push) Failing after 19s
shellcheck / shellcheck (push) Failing after 19s
60-security.sh now checks network exposure (step 4), from two other machines made of network namespaces in the VM: one on private addresses, like a neighbour on the same Wi-Fi, and one on public-looking ones. From each, over IPv4 and IPv6: only SSH and LocalSend are open, a container's published port can't be reached, containers still reach both machines, and SSH takes keys only. It also checks ufw's rules and sshd -T. It found that ufw-docker's rules let any private address (10/8, 172.16/12, 192.168/16) reach published ports, so anyone on a café's or hotel's Wi-Fi could. system/docker-firewall.sh lets only Docker's own bridges (docker0, br-+) past instead; firewall.sh runs it on a new install and migration 1794878760 on existing machines. To let other machines reach a container's port: sudo ufw-docker allow <container> <port>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -28,4 +28,8 @@ if ! sudo grep -q 'BEGIN UFW AND DOCKER' /etc/ufw/after.rules; then
|
||||
sudo systemctl restart ufw.service
|
||||
fi
|
||||
|
||||
# ufw-docker lets private addresses, the rest of a café's Wi-Fi say, reach
|
||||
# published ports; only Docker's own bridges, from here on
|
||||
bash "$HOME/.local/share/coredesktop/system/docker-firewall.sh"
|
||||
|
||||
sudo ufw status verbose
|
||||
|
||||
Reference in New Issue
Block a user