Add ENABLE_IP_BAN mode switch

Introduce ENABLE_IP_BAN in config and script.
When set to 0, ssh-monitor works in monitor-only mode (alerts without ipset/iptables bans).

Made-with: Cursor
This commit is contained in:
ssh-monitor
2026-04-16 11:57:59 +10:00
parent 803817cdbb
commit 56d4b0002e
3 changed files with 68 additions and 6 deletions
+3
View File
@@ -44,6 +44,9 @@ LAST_SECURITY_EVENTS_FILE="/var/log/last_security_events_check"
LAST_LOGIND_CHECK_FILE="/var/log/last_logind_check"
BAN_LIST_FILE="/var/log/ssh_bans.txt"
# 1 = мониторинг + автобан IP (нужен ipset). 0 = только мониторинг и уведомления (логины, неудачи, sudo, logind и т.д. — без ipset/iptables).
ENABLE_IP_BAN="1"
# systemd-logind: 1 = включено, 0 = выключено
ENABLE_LOGIND_MONITOR="1"
LOGIND_NOTIFY_NEW="1"