Instalei o fail2ban no CentOS 7 e adicionei jail.local:
[sshd]
enabled = true
Quando tento um login ssh incorreto, recebo uma entrada de log em /var/log/secure assim:
Jun 5 11:09:40 arsenal sshd[32595]: Connection closed by 192.168.1.202 port 61745 [preauth]
Mas nada aparece no log do fail2ban, a menos que eu configure para DEBUG:
2019-06-05 11:09:40,893 fail2ban.filtersystemd [32110]: DEBUG Read systemd journal entry: '2019-06-05T11:09:40.893324arsenal sshd[32595]: Connection closed by 192.168.1.202 port 61745 [preauth]'
Mesmo se eu tentar esse login incorreto várias vezes seguidas, ele não bloqueará nada:
# fail2ban-client status sshd
Status for the jail: sshd
|- Filter
| |- Currently failed: 0
| |- Total failed: 0
| `- Journal matches: _SYSTEMD_UNIT=sshd.service + _COMM=sshd
`- Actions
|- Currently banned: 0
|- Total banned: 0
`- Banned IP list: