You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Fail2ban configuration for redmine. NOTE: name of the resource is
4
+
# restricted to 29 - len(fail2ban-rm-) characters => 17
5
+
# characters. This is due to a limit on iptable chain names.
6
+
#
7
+
# === Parameters
8
+
#
9
+
# [*root_dir*]
10
+
# root directory
11
+
# [*ports*]
12
+
# optional port list - defaults to standard http and https
13
+
# [*bantime*]
14
+
# see fail2ban::jail
15
+
# [*maxretry*]
16
+
# see fail2ban::jail
17
+
#
18
+
# === Examples
19
+
#
20
+
# redmine::fail2ban { 'redmine.example':
21
+
# root_dir => '/srv/www/redmine.example.net',
22
+
# }
23
+
#
24
+
# === Authors
25
+
#
26
+
# Braiins Systems s.r.o.
27
+
#
28
+
# === Copyright
29
+
#
30
+
# Copyright 2015 Braiins Systems s.r.o.
31
+
#
32
+
defineredmine::fail2ban(
33
+
$port=['80', '443'],
34
+
$bantime=15,
35
+
$maxretry=3,
36
+
$serveraliases=[],
37
+
$root_dir,
38
+
) {
39
+
$fail2ban_name = "rm-${title}"
40
+
# Check the supplied title to prevent exceeding the iptables chain name limit
41
+
if size($title) > 17 {
42
+
fail("redmine::fail2ban - title '${title}' longer than 17 characters, iptables chain name: '${fail2ban_name}' would exceed iptables limit, make the resource name shorter!")
43
+
}
44
+
fail2ban::filter { $fail2ban_name:
45
+
filterfailregex => 'Failed login for \'.*\' from <HOST> .*$',
46
+
} ->
47
+
# The jail uses the default iptables multiport ban action
0 commit comments