Ensure fail2ban and logrotate are available on all machines
This commit is contained in:
11
ansible/roles/base/files/fail2ban-logrotate
Normal file
11
ansible/roles/base/files/fail2ban-logrotate
Normal file
@ -0,0 +1,11 @@
|
||||
/var/log/fail2ban.log {
|
||||
weekly
|
||||
rotate 7
|
||||
missingok
|
||||
compress
|
||||
nodateext
|
||||
notifempty
|
||||
postrotate
|
||||
/usr/bin/fail2ban-client flushlogs 1>/dev/null || true
|
||||
endscript
|
||||
}
|
7
ansible/roles/base/files/ssh-jail.conf
Normal file
7
ansible/roles/base/files/ssh-jail.conf
Normal file
@ -0,0 +1,7 @@
|
||||
[sshd]
|
||||
enabled = true
|
||||
bantime = 600
|
||||
findtime = 30
|
||||
maxretry = 5
|
||||
port = {{ ssh_port }},ssh
|
||||
ignoreip = {{ wireguard.cidr }}
|
@ -1,6 +1,6 @@
|
||||
# TCP port to bind to
|
||||
# Change to a high/odd port if this server is exposed to the internet directly
|
||||
Port 7743
|
||||
Port {{ ssh_port }}
|
||||
|
||||
{% if expose_ssh %}
|
||||
AllowUsers {{ user }}
|
||||
|
Reference in New Issue
Block a user