Interview Prep/Docker/Image Security & Hardening

How do you handle Linux capabilities for a service binding to port 80?

IntermediateProductionImage Security & Hardening
Answer

Best: bind to a high port (8080) in the container and map externally. Otherwise drop all and add back only NET_BIND_SERVICE, or set net.ipv4.ip_unprivileged_port_start=0 for the container namespace:

docker run --sysctl net.ipv4.ip_unprivileged_port_start=80 --user 10001 app
All Docker questions Roadmap: Docker & containers

More on Image Security & Hardening