From 70252000950490b60b9945ac6fc984d74bdde931 Mon Sep 17 00:00:00 2001 From: Mikolaj Izdebski Date: Fri, 26 Jun 2015 20:59:11 +0000 Subject: [PATCH] Support IPv6 on jenkins --- .../ip6tables.jenkins.fedorainfracloud.org | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 roles/base/templates/iptables/ip6tables.jenkins.fedorainfracloud.org diff --git a/roles/base/templates/iptables/ip6tables.jenkins.fedorainfracloud.org b/roles/base/templates/iptables/ip6tables.jenkins.fedorainfracloud.org new file mode 100644 index 0000000000..066f3609e5 --- /dev/null +++ b/roles/base/templates/iptables/ip6tables.jenkins.fedorainfracloud.org @@ -0,0 +1,63 @@ +# {{ ansible_managed }} + +*nat +:PREROUTING ACCEPT [0:0] +:INPUT ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +:POSTROUTING ACCEPT [0:0] + +{% if custom_nat_rules is defined %} +{% for rule in custom_nat_rules %} +{{ rule }} +{% endfor %} +{% endif %} + +COMMIT + + +*filter +:INPUT ACCEPT [0:0] +:FORWARD ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] + +# loopback allowed +-A INPUT -i lo -j ACCEPT + +# Accept ping and traceroute (needs icmp) +-A INPUT -p ipv6-icmp -j ACCEPT + +# Established connections allowed +-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT + +# Established connections allowed +-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT +-A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT + +# allow ssh - always +-A INPUT -m conntrack --ctstate NEW -m tcp -p tcp --dport 22 -j ACCEPT + +# if the host/group defines incoming tcp_ports - allow them +{% if tcp_ports is defined %} +{% for port in tcp_ports %} +-A INPUT -p tcp -m tcp --dport {{ port }} -j ACCEPT +{% endfor %} +{% endif %} + +# if the host/group defines incoming udp_ports - allow them +{% if udp_ports is defined %} +{% for port in udp_ports %} +-A INPUT -p udp -m udp --dport {{ port }} -j ACCEPT +{% endfor %} +{% endif %} + +# if there are custom6 rules - put them in as-is +{% if custom6_rules is defined %} +{% for rule in custom6_rules %} +{{ rule }} +{% endfor %} +{% endif %} + +# otherwise kick everything out +-A INPUT -j REJECT --reject-with icmp6-adm-prohibited +-A FORWARD -j REJECT --reject-with icmp6-adm-prohibited +COMMIT