Last active
May 10, 2020 09:30
-
-
Save liejuntao001/266f2c5a5e85be70201eee9bcbd2b4a4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*filter | |
:INPUT ACCEPT [0:0] | |
:FORWARD DROP [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:FILTERS - [0:0] | |
:DOCKER-USER - [0:0] | |
-F INPUT | |
-F DOCKER-USER | |
-F FILTERS | |
# BASIC Allow | |
-A INPUT -i lo -j ACCEPT | |
# Chain to FILTERS | |
-A INPUT -j FILTERS | |
-A DOCKER-USER -i eth0 -j FILTERS | |
# COMMON FIREWALL RULES | |
# ALLOW something | |
-A FILTERS -p tcp -m multiport --dports 80,443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT | |
# DENY something | |
-A FILTERS -p icmp --icmp-type echo-request -j REJECT | |
################################################################### | |
### special cases for servers | |
### please modify by the server | |
### end special cases | |
############################################################ | |
# FINAL REJECT | |
# Optional logging | |
-A FILTERS -m limit --limit 5/min -j LOG --log-prefix "iptables_INPUT_denied: " --log-level 7 | |
-A FILTERS -j REJECT | |
COMMIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for looking into this, really appreciate the help. I think I will stick with my current setup and using double rules in INPUT+DOCKER-USER for the per host per service mapping.