Сервер атакован попытками обмена ключами. Fail2ban не добавляет в список банов

Считайте это так, если у вас есть разрешения по умолчанию 666 означает, что у вас есть только r+wдля пользователя, группы и других, а по umask 541вы хотите удалить разрешения r+x,r,x.

Для пользователя:

By default you can read+write and by umask you want to remove read+executable 
permissions, but it will never happen because initially file has no executable 
permissions. So only read permission will be removed.

Для группы:

read permission will removed

Для других:

There is no executable permission in the file, so there will be no change.

Та же концепция применяется к каталогам.

0
08.05.2020, 19:59
1 ответ

Обычно fail2ban не реагирует на такие атаки, чтобы заставить fail2ban реагировать на них, вам нужно установить агрессивный режим в вашей тюрьме в /etc/fail2ban/jail.local

вот так:

[sshd]
 
# To use more aggressive sshd modes set filter parameter "mode" in jail.local:
# normal (default), ddos, extra or aggressive (combines all).
# See "tests/files/logs/sshd" or "filter.d/sshd.conf" for usage example and details.
 
enabled = true
mode   = aggressive
port    = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s

для большей защиты вы можете заблокировать постоянных злоумышленников с помощью повторной тюрьмы, подобной этой:

[recidive]
 
enabled = true
logpath  = /var/log/fail2ban.log
banaction = %(banaction_allports)s
bantime  = 1y
findtime = 1d
maxretry = 2

Ссылки:

https://github.com/fail2ban/fail2ban/pull/1209

https://wiki.archlinux.org/index.php/Fail2ban

2
28.04.2021, 23:15

Теги

Похожие вопросы