Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #474 from modoboa/security/fail2ban
Added fail2ban setup
- Loading branch information
Showing
5 changed files
with
61 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
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,17 @@ | ||
"""fail2ban related functions.""" | ||
|
||
from . import base | ||
|
||
|
||
class Fail2ban(base.Installer): | ||
"""Fail2ban installer.""" | ||
|
||
appname = "fail2ban" | ||
packages = { | ||
"deb": ["fail2ban"], | ||
"rpm": ["fail2ban"] | ||
} | ||
config_files = [ | ||
"jail.d/modoboa.conf", | ||
"filter.d/modoboa-auth.conf", | ||
] |
9 changes: 9 additions & 0 deletions
9
modoboa_installer/scripts/files/fail2ban/filter.d/modoboa-auth.conf.tpl
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,9 @@ | ||
# Fail2Ban filter Modoboa authentication | ||
|
||
[INCLUDES] | ||
|
||
before = common.conf | ||
|
||
[Definition] | ||
|
||
failregex = modoboa\.auth: WARNING Failed connection attempt from \'<HOST>\' as user \'.*?\'$ |
9 changes: 9 additions & 0 deletions
9
modoboa_installer/scripts/files/fail2ban/jail.d/modoboa.conf.tpl
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,9 @@ | ||
[modoboa] | ||
enabled = true | ||
port = http,https | ||
protocol = tcp | ||
filter = modoboa-auth | ||
maxretry = %max_retry | ||
bantime = %ban_time | ||
findtime = %find_time | ||
logpath = /var/log/auth.log |
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 |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
|
||
PRIMARY_APPS = [ | ||
"amavis", | ||
"fail2ban", | ||
"modoboa", | ||
"automx", | ||
"radicale", | ||
|