Docker publishes port port past the firewall
ufw says this port is closed, but Docker opens it anyway, so it can be reached from the internet.
bind the port to 127.0.0.1 in docker-compose.yml, then
docker compose up -d service
Reference The 25 checks
Security check
docker-firewall
The ports Docker publishes on all addresses, and the ufw rules for them.
It needs root for part of what it reads. Reading the ufw rules and the Docker socket needs root.
Without root, that part is skipped and never counted as passed. Run
sudo kiyesi scan to include it.
The report lists it as passed, in these words:
Docker publishes port port past the firewall
ufw says this port is closed, but Docker opens it anyway, so it can be reached from the internet.
bind the port to 127.0.0.1 in docker-compose.yml, then
docker compose up -d service
Docker publishes web port port past the firewall
ufw says port port is closed, but Docker opens it anyway. For a website that is what you want, so it costs no points, but the firewall's rules no longer say what is open. Never bind it to 127.0.0.1 if it serves your site: the site would go offline.
If service serves your website, allow the port in the firewall too, so its rules say what is open:
sudo ufw allow port/tcp
If it should not be public, bind it to 127.0.0.1 in docker-compose.yml, then
docker compose up -d service