Fix Fail2ban recidive jail logpath and re-enable on openSUSE
This commit is contained in:
@@ -339,15 +339,13 @@ perform_health_check() {
|
|||||||
echo
|
echo
|
||||||
|
|
||||||
echo "=== Security Status ==="
|
echo "=== Security Status ==="
|
||||||
# Check Fail2ban if SSH was configured (which includes Fail2ban) and not openSUSE
|
# Check Fail2ban if SSH was configured (which includes Fail2ban)
|
||||||
if [[ "${CONFIGURE_SSH:-true}" == "true" && "$DISTRO" != "opensuse" ]]; then
|
if [[ "${CONFIGURE_SSH:-true}" == "true" ]]; then
|
||||||
if systemctl is-active --quiet fail2ban; then
|
if systemctl is-active --quiet fail2ban; then
|
||||||
echo "✅ Fail2ban: Active"
|
echo "✅ Fail2ban: Active"
|
||||||
else
|
else
|
||||||
echo "❌ Fail2ban: Inactive"
|
echo "❌ Fail2ban: Inactive"
|
||||||
fi
|
fi
|
||||||
elif [[ "$DISTRO" == "opensuse" ]]; then
|
|
||||||
echo "ℹ️ Fail2ban: Not available on openSUSE (compatibility issues)"
|
|
||||||
else
|
else
|
||||||
echo "ℹ️ Fail2ban: Not configured"
|
echo "ℹ️ Fail2ban: Not configured"
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -31,9 +31,9 @@ install_fail2ban() {
|
|||||||
;;
|
;;
|
||||||
opensuse)
|
opensuse)
|
||||||
handle_error sudo zypper install -y fail2ban
|
handle_error sudo zypper install -y fail2ban
|
||||||
# On openSUSE, Fail2ban has issues with systemd backend, skip it for now
|
# On openSUSE, create a basic log file for Fail2ban to monitor
|
||||||
log_warning "Fail2ban on openSUSE may have compatibility issues. Consider manual configuration."
|
sudo touch /var/log/fail2ban.log
|
||||||
return 0
|
sudo chmod 644 /var/log/fail2ban.log
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
log_error "Unsupported Linux distribution: $DISTRO"
|
log_error "Unsupported Linux distribution: $DISTRO"
|
||||||
@@ -129,6 +129,7 @@ enabled = false
|
|||||||
|
|
||||||
[recidive]
|
[recidive]
|
||||||
enabled = true
|
enabled = true
|
||||||
|
logpath = /var/log/fail2ban.log
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
handle_error sudo systemctl enable fail2ban
|
handle_error sudo systemctl enable fail2ban
|
||||||
|
|||||||
Reference in New Issue
Block a user