Mercurial > repos > other > Puppet
annotate modules/fail2ban/templates/ibb-sshd-bad-user.epp @ 430:79e5fed321fa
Break up SSH bad users regexes
The list had got so long that it was failing to compile!
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 11 Dec 2022 20:27:08 +0000 |
parents | 3e04f35dd0af |
children |
rev | line source |
---|---|
292
3e04f35dd0af
Turn Fail2ban setup into a module
IBBoard <dev@ibboard.co.uk>
parents:
291
diff
changeset
|
1 <%- | Array $bad_users | -%> |
197
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
2 # Fail2Ban configuration file |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
3 # Author: IBBoard |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
4 |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 [Definition] |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 # Option: failregex |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 # Notes.: regex to match the password failures messages in the logfile. The |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
9 # host must be matched by a group named "host". The tag "<HOST>" can |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
10 # be used for standard IP/hostname matching and is only an alias for |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
11 # (?:::f{4,6}:)?(?P<host>[\w\-.^_]+) |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
12 # Values: TEXT |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
13 # |
430 | 14 failregex = <% $bad_users.each |$array| { %> Failed password for invalid user (<%= join($array, '|') %>)? from <HOST> port [0-9]+ ssh2 |
15 <% } %> | |
16 | |
197
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
17 |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
18 # Option: ignoreregex |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
19 # Notes.: regex to ignore. If this regex matches, the line is ignored. |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
20 # Values: TEXT |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
21 # |
23c4f6a38b57
Make Fail2Ban SSH rules more agressive
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
22 ignoreregex = |