From d1a83b138a956439f36217e2852319900675db7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Ban=CC=83os=20Lo=CC=81pez?= Date: Fri, 29 Jun 2018 13:25:03 +0200 Subject: [PATCH] Ensure firewall flush in RHEL allows all traffic in (issue #79) --- firewall/iptables.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firewall/iptables.go b/firewall/iptables.go index 5c156ce..cb05603 100644 --- a/firewall/iptables.go +++ b/firewall/iptables.go @@ -4,6 +4,7 @@ package firewall import ( "fmt" + "os" log "github.com/Sirupsen/logrus" "github.com/ingrammicro/concerto/utils" @@ -43,6 +44,9 @@ func apply(policy Policy) error { } func flush() error { + if _, err := os.Stat("/etc/redhat-release"); err == nil { + utils.RunCmd("firewall-cmd --set-default-zone=trusted") + } utils.RunCmd("/sbin/iptables -w -P INPUT ACCEPT") utils.RunCmd("/sbin/iptables -w -F CONCERTO") utils.RunCmd("/sbin/iptables -w -D INPUT -j CONCERTO")