Skip to content

Sources for a Docker image that runs an iptables based firewall script, packaged with the required binaries for environments where iptables-restore is not present

License

Notifications You must be signed in to change notification settings

capybara1/Docker-Firewall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Firewall

Motivation

Primarily a iptables based firewall script, packaged with the required binaries for environments where iptables-restore is not present.

Inspirations

Articles that inspired this solution

Usage

Command Line

Assuming the desired file with the output from iptables-restore is located at /etc/iptables/state

docker run \
  --rm \
  --cap-add=NET_ADMIN \
  --net=host \
  -v /etc/iptables:/host/etc/iptables:ro \
  capybara1/firewall:1.0

Cloud-Init (RancherOS)

write_files:
- path: /etc/iptables/state
  permissions: "0400"
  owner: "root:root"
  content: |
    #insert output of iptables-save here
rancher:
  services:
    firewall:
      image: capybara1/firewall:latest
      net: host
      cap_add:
      - NET_ADMIN
      volumes:
      - /etc/iptables:/host/etc/iptables:ro
      labels:
        io.rancher.os.after: wait-for-network, console
        io.rancher.os.detach: "false"
        io.rancher.os.remove: "true"

About

Sources for a Docker image that runs an iptables based firewall script, packaged with the required binaries for environments where iptables-restore is not present

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published