summaryrefslogtreecommitdiffstats
path: root/roles/common/templates
diff options
context:
space:
mode:
Diffstat (limited to 'roles/common/templates')
-rw-r--r--roles/common/templates/etc/iptables/services.j22
-rwxr-xr-xroles/common/templates/etc/network/if-up.d/ipsec.j26
2 files changed, 4 insertions, 4 deletions
diff --git a/roles/common/templates/etc/iptables/services.j2 b/roles/common/templates/etc/iptables/services.j2
index ccbc735..247f98a 100644
--- a/roles/common/templates/etc/iptables/services.j2
+++ b/roles/common/templates/etc/iptables/services.j2
@@ -1,30 +1,30 @@
# {{ ansible_managed }}
# Do NOT edit this file directly!
#
# direction protocol destination port source port
# (in|out|inout)[46]? (tcp|udp|..) (port|port:port|port,port) (port|port:port|port,port)
{% if groups.all | length > 1 %}
inout4 udp 500 500 # ISAKMP
{% if groups.NATed | length > 0 %}
-inout4 udp 4500 4500 # IPSec NAT Traversal
+inout4 udp 4500 4500 # IPsec NAT Traversal
{% endif %}
{% endif %}
out tcp 80,443 # HTTP/HTTPS
out tcp 9418 # GIT
out udp 53 # DNS
out udp 67 # DHCP
out tcp 22 # SSH
out udp 123 123 # NTP
in tcp {{ ansible_port|default('22') }} # SSH
{% if 'LDAP-provider' in group_names %}
in tcp 636 # LDAPS
{% elif 'MX' in group_names or 'lists' in group_names %}
out tcp 636 # LDAPS
{% endif %}
{% if 'MX' in group_names %}
in tcp 25 # SMTP
{% if 'MDA' not in group_names %}
out tcp {{ postfix_instance.IMAP.port }}
diff --git a/roles/common/templates/etc/network/if-up.d/ipsec.j2 b/roles/common/templates/etc/network/if-up.d/ipsec.j2
index 7dd41d4..caa5129 100755
--- a/roles/common/templates/etc/network/if-up.d/ipsec.j2
+++ b/roles/common/templates/etc/network/if-up.d/ipsec.j2
@@ -1,47 +1,47 @@
#!/bin/sh
# A post-up/down hook to automatically create/delete a virtual subnet
-# for IPSec (inet4 only).
+# for IPsec (inet4 only).
# Copyright © 2016 Guilhem Moulin <guilhem@fripost.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
set -ue
PATH=/usr/sbin:/usr/bin:/sbin:/bin
# Ignore the loopback interface and non inet4 families.
[ "$IFACE" != lo -a "$ADDRFAM" = inet ] || exit 0
# Only the device with the default, globally-scoped route, is of
# interest here.
ip="$( ip -4 -o route show to default scope global \
| sed -nr '/^default via (\S+) dev (\S+).*/ {s//\2 \1/p;q}' )"
[ "${ip% *}" = "$IFACE" ] || exit 0
ip="${ip##* }"
vip="{{ ipsec[inventory_hostname_short] }}"
vsubnet="{{ ipsec_subnet }}"
case "$MODE" in
start) ip address add "$vip/32" dev "$IFACE" scope global || true
- # Nullroute the subnet used for IPSec to avoid data leaks
+ # Nullroute the subnet used for IPsec to avoid data leaks
# in the absence of xfrm lookup (i.e., when there is no
- # matching IPSec Security Association).
+ # matching IPsec Security Association).
ip route replace prohibit "$vsubnet" proto static || true
ip route replace table 220 to "$vsubnet" via "$ip" dev "$IFACE" proto static src "$vip" || true
;;
stop) ip route del table 220 to "$vsubnet" via "$ip" dev "$IFACE" proto static src "$vip" || true
ip route del prohibit "$vsubnet" proto static || true
ip address del "$vip/32" dev "$IFACE" scope global || true
esac