What is missing or needs to be updated?
The Docker Cheatsheet doesn't mention that by default ports mapped to the host ignore UFW rules, leaving docker containers open. This is documented on the docker docs but it is buried in, and most of the time the user will make the mistake instead of reading it.
How should this be resolved?
Adding a section "Be careful when mapping container ports to the host with UFW" to the Docker cheatsheet.
Mapping to the localhost fixes this:
8000:8000 -> 127.0.0.1:8000:8000
Alternatively this ufw-docker repository contains the instructions for modifying UFW rules to disallow public traffic from interacting with docker networks. It also includes a small script to install the extra rules.
What is missing or needs to be updated?
The Docker Cheatsheet doesn't mention that by default ports mapped to the host ignore UFW rules, leaving docker containers open. This is documented on the docker docs but it is buried in, and most of the time the user will make the mistake instead of reading it.
How should this be resolved?
Adding a section "Be careful when mapping container ports to the host with UFW" to the Docker cheatsheet.
Mapping to the localhost fixes this:
8000:8000->127.0.0.1:8000:8000Alternatively this
ufw-dockerrepository contains the instructions for modifying UFW rules to disallow public traffic from interacting with docker networks. It also includes a small script to install the extra rules.