-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[ssh] | ||
|
||
enabled = true | ||
|
||
port = ssh | ||
|
||
filter = sshd | ||
|
||
logpath = /var/log/auth.log | ||
|
||
action = hostsdeny[file=/etc/hosts.deny] | ||
|
||
maxretry = 3 | ||
|
||
ignoreip = 127.0.0.1/8 {% if whitelistedips is defined %} {% for host in whitelistedips %} {{host}} {% endfor %} {% endif %} | ||
|
||
findtime = 300 | ||
|
||
bantime = -1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
# Parameters: | ||
# prudentia_dir (provided) | ||
# whitelistedips (optional) list of ips for /etc/hosts.allow | ||
|
||
- name: Fail2Ban | Install fail2ban | ||
apt: pkg=fail2ban state=installed update-cache=yes | ||
sudo: yes | ||
tags: | ||
- fail2ban | ||
|
||
- name: Fail2Ban | local fail2ban jail config | ||
template: src={{prudentia_dir}}/files/file2ban/jail.local.j2 dest=/etc/fail2ban/jail.local | ||
sudo: yes | ||
tags: | ||
- fail2ban | ||
|
||
- name: Fail2Ban | reload fail2ban | ||
service: name=fail2ban state=reloaded | ||
sudo: yes | ||
tags: | ||
- fail2ban | ||
|
||
|