I have enabled ufw. The is ufw status verbose
output
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing), deny (routed)
New profiles: skip
To Action From
-- ------ ----
22/tcp ALLOW IN Anywhere
22/tcp (v6) ALLOW IN Anywhere (v6)
But when I run nginx as
docker run --name nginx -p 80:80 -d nginx
I still can see nginx welcome page in the browser and nmap shows 80 port as open.
By default Docker manages its own firewall rules via calling iptables directly. It will allow a port in the firewall when you expose it in your container. These are not visible in
ufw
.