ufw-docker-automated

Manage docker containers firewall with UFW!

APACHE-2.0 License

Stars
196

Bot releases are hidden (Show)

ufw-docker-automated - v0.6.0

Published by shinebayar-g almost 3 years ago

  • Now you can be more specific with port specific rules. For example port 80 could be open to internet, but port 8080 could be allowed from specific network. See #29
  • Ufw commands are now called with sudo. This is to be compatible with systems that root user is not available.
  • Outbound rules are coming in next release.
ufw-docker-automated - v0.4.0

Published by shinebayar-g about 3 years ago

  • Added UFW_ALLOW_FROM label support. This label takes comma separated IP addresses as a list. Example: UFW_ALLOW_FROM=192.168.0.2;192.168.1.0/24
  • Added support for outbound rules. UFW_ALLOW_TO (comma separated IP addresses as a list, UFW_DENY_OUTGOING (takes true/false) labels supported.
  • Added support for ufw comments. Ufw rules will be added with container id as a comment. This will help us to cleanup left over rules.

Thanks to @mlollo

ufw-docker-automated - v0.3.0

Published by shinebayar-g almost 4 years ago

Added support for allowing IP based firewall rules. Now you can use UFW_FROM label. Use semicolon separated IP addresses. For example:

➜  docker run -d -p 8080:80 -l UFW_MANAGED=TRUE -l "UFW_FROM=192.168.0.2;192.168.1.0/24" nginx:alpine
13a6ef724d92f404f150f5796dabfd305f4e16a9de846a67e5e99ba53ed2e4e7

➜  sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere                  
80/tcp                     ALLOW       Anywhere                  
443/tcp                    ALLOW       Anywhere                  

172.17.0.2 80/tcp          ALLOW FWD   192.168.0.2     <= allowing only 192.168.0.2 to access nginx server 
172.17.0.2 80/tcp          ALLOW FWD   192.168.1.0/24  <= allowing only 192.168.1.0/24 to access nginx server

Thanks to @mlollo