From 3344620824ee665b31808871c599bf5c5eb12718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=83rcziem=20=E2=84=A2?= <118485377+spalencsar@users.noreply.github.com> Date: Mon, 6 Oct 2025 11:44:06 +0200 Subject: [PATCH] Fix Fail2ban recidive jail logpath and re-enable on openSUSE --- lib/performance.sh | 6 ++---- lib/security.sh | 7 ++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/performance.sh b/lib/performance.sh index 872958a..54482df 100644 --- a/lib/performance.sh +++ b/lib/performance.sh @@ -339,15 +339,13 @@ perform_health_check() { echo echo "=== Security Status ===" - # Check Fail2ban if SSH was configured (which includes Fail2ban) and not openSUSE - if [[ "${CONFIGURE_SSH:-true}" == "true" && "$DISTRO" != "opensuse" ]]; then + # Check Fail2ban if SSH was configured (which includes Fail2ban) + if [[ "${CONFIGURE_SSH:-true}" == "true" ]]; then if systemctl is-active --quiet fail2ban; then echo "✅ Fail2ban: Active" else echo "❌ Fail2ban: Inactive" fi - elif [[ "$DISTRO" == "opensuse" ]]; then - echo "ℹ️ Fail2ban: Not available on openSUSE (compatibility issues)" else echo "ℹ️ Fail2ban: Not configured" fi diff --git a/lib/security.sh b/lib/security.sh index 1470897..435744e 100644 --- a/lib/security.sh +++ b/lib/security.sh @@ -31,9 +31,9 @@ install_fail2ban() { ;; opensuse) handle_error sudo zypper install -y fail2ban - # On openSUSE, Fail2ban has issues with systemd backend, skip it for now - log_warning "Fail2ban on openSUSE may have compatibility issues. Consider manual configuration." - return 0 + # On openSUSE, create a basic log file for Fail2ban to monitor + sudo touch /var/log/fail2ban.log + sudo chmod 644 /var/log/fail2ban.log ;; *) log_error "Unsupported Linux distribution: $DISTRO" @@ -129,6 +129,7 @@ enabled = false [recidive] enabled = true +logpath = /var/log/fail2ban.log EOF handle_error sudo systemctl enable fail2ban