mirror of
https://github.com/2martens/terraform.git
synced 2026-10-17 17:46:52 +02:00
16 lines
505 B
Plaintext
16 lines
505 B
Plaintext
#!/bin/sh
|
|
|
|
printf "[sshd]\nenabled = true\nbanaction = iptables-multiport" > /etc/fail2ban/jail.local
|
|
systemctl enable fail2ban
|
|
|
|
ufw allow OpenSSH
|
|
ufw allow 80 comment HTTP
|
|
ufw allow 443 comment HTTPS
|
|
|
|
%{if main_node ~}
|
|
ufw allow to ${node_ip} port 2377 proto tcp comment "Swarm join port and communication between manager nodes"
|
|
%{endif ~}
|
|
ufw allow to ${node_ip} port 7946 comment "overlay network node discovery"
|
|
ufw allow to ${node_ip} port 4789 proto udp comment "overlay network traffic"
|
|
ufw enable
|