Skip to content

Commit 2bdbe5d

Browse files
F2B: update F2B after discussion in docker-mailserver#3256 (docker-mailserver#3288)
1 parent b6261c7 commit 2bdbe5d

3 files changed

Lines changed: 11 additions & 16 deletions

File tree

config-examples/fail2ban-jail.cf

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ bantime = 1w
88
findtime = 1w
99

1010
# "maxretry" is the number of failures before a host get banned.
11-
maxretry = 2
11+
maxretry = 6
1212

1313
# "ignoreip" can be a list of IP addresses, CIDR masks or DNS hosts. Fail2ban
1414
# will not ban a host which matches an address in this list. Several addresses
@@ -25,15 +25,12 @@ enabled = true
2525

2626
[postfix]
2727
enabled = true
28-
# See https://github.com/fail2ban/fail2ban/blob/27294c4b9ee5d5568a1d5f83af744ea39d5a1acb/config/filter.d/postfix.conf#L58
29-
# `mode=aggressive` basically combines more filters to match more lines, and hence, apply rules
30-
# more aggressively. The same goes for the `postfix-sasl` jail.
31-
mode = aggressive
32-
28+
# For a reference on why this mode was chose, see
29+
# https://github.com/docker-mailserver/docker-mailserver/issues/3256#issuecomment-1511188760
30+
mode = extra
3331

3432
[postfix-sasl]
3533
enabled = true
36-
mode = aggressive
3734

3835
# This jail is used for manual bans.
3936
# To ban an IP address use: setup.sh fail2ban ban <IP>

docs/content/config/security/fail2ban.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ hide:
2929

3030
### DMS Defaults
3131

32-
DMS will automatically ban IP addresses of hosts that have generated 2 failed attempts over the course of the last week. The bans themselves last for one week.
32+
DMS will automatically ban IP addresses of hosts that have generated 6 failed attempts over the course of the last week. The bans themselves last for one week. The Postfix jail is configured to use `mode = extra` in DMS.
3333

3434
### Custom Files
3535

@@ -39,10 +39,10 @@ This following configuration files inside the `docker-data/dms/config/` volume w
3939

4040
1. `fail2ban-jail.cf` is copied to `/etc/fail2ban/jail.d/user-jail.local`
4141
- with this file, you can adjust the configuration of individual jails and their defaults
42-
- the is an example provided [in our repository on GitHub][github-file-f2bjail]
42+
- there is an example provided [in our repository on GitHub][github-file-f2bjail]
4343
2. `fail2ban-fail2ban.cf` is copied to `/etc/fail2ban/fail2ban.local`
4444
- with this file, you can adjust F2B behavior in general
45-
- the is an example provided [in our repository on GitHub][github-file-f2bconfig]
45+
- there is an example provided [in our repository on GitHub][github-file-f2bconfig]
4646

4747
[docs-dms-config-volume]: ../../faq.md#what-about-the-docker-datadmsconfig-directory
4848
[github-file-f2bjail]: https://github.com/docker-mailserver/docker-mailserver/blob/master/config-examples/fail2ban-jail.cf

target/fail2ban/jail.local

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ bantime = 1w
88
findtime = 1w
99

1010
# "maxretry" is the number of failures before a host get banned.
11-
maxretry = 2
11+
maxretry = 6
1212

1313
# "ignoreip" can be a list of IP addresses, CIDR masks or DNS hosts. Fail2ban
1414
# will not ban a host which matches an address in this list. Several addresses
@@ -25,14 +25,12 @@ enabled = true
2525

2626
[postfix]
2727
enabled = true
28-
# See https://github.com/fail2ban/fail2ban/blob/27294c4b9ee5d5568a1d5f83af744ea39d5a1acb/config/filter.d/postfix.conf#L58
29-
# `mode=aggressive` basically combines more filters to match more lines, and hence, apply rules
30-
# more aggressively. The same goes for the `postfix-sasl` jail.
31-
mode = aggressive
28+
# For a reference on why this mode was chose, see
29+
# https://github.com/docker-mailserver/docker-mailserver/issues/3256#issuecomment-1511188760
30+
mode = extra
3231

3332
[postfix-sasl]
3433
enabled = true
35-
mode = aggressive
3634

3735
# This jail is used for manual bans.
3836
# To ban an IP address use: setup.sh fail2ban ban <IP>

0 commit comments

Comments
 (0)