From 16ca57163618684db398c9ef37097161b6948eba Mon Sep 17 00:00:00 2001 From: cs Date: Tue, 26 Aug 2025 20:26:00 +0200 Subject: [PATCH 1/3] Added import of os in client.go --- internal/fail2ban/client.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/fail2ban/client.go b/internal/fail2ban/client.go index 0e54ef5..6ed4b07 100644 --- a/internal/fail2ban/client.go +++ b/internal/fail2ban/client.go @@ -19,6 +19,7 @@ package fail2ban import ( "errors" "fmt" + "os" "os/exec" "strings" "time" From ab7de2a6f1c41439e8a384a662fcb09c365058e6 Mon Sep 17 00:00:00 2001 From: cs Date: Tue, 26 Aug 2025 21:40:13 +0200 Subject: [PATCH 2/3] Update of the fail2ban-curl-allow module to version 1.1 with additional permissions for accessing directories and files in etc_t, var_log_t, and var_run_t. --- deployment/fail2ban-curl-allow.te | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/deployment/fail2ban-curl-allow.te b/deployment/fail2ban-curl-allow.te index 14c604d..12475fd 100644 --- a/deployment/fail2ban-curl-allow.te +++ b/deployment/fail2ban-curl-allow.te @@ -1,11 +1,23 @@ - -module fail2ban-curl-allow 1.0; +# deployment/fail2ban-curl-allow.te +module fail2ban-curl-allow 1.1; require { - type fail2ban_t; - type http_cache_port_t; - class tcp_socket name_connect; + type fail2ban_t; + type http_cache_port_t; + type var_run_t; + type etc_t; + type var_log_t; + class tcp_socket name_connect; + class file { read write open execute }; + class dir { search read }; } #============= fail2ban_t ============== allow fail2ban_t http_cache_port_t:tcp_socket name_connect; + +# Zusätzliche benötigte Berechtigungen +allow fail2ban_t etc_t:file { read open }; +allow fail2ban_t var_log_t:file { read open }; +allow fail2ban_t var_run_t:file { read write open }; +allow fail2ban_t var_run_t:dir search; +allow fail2ban_t etc_t:dir search; \ No newline at end of file From 56c740b6ab1995626b9193150a3c7c0044daca43 Mon Sep 17 00:00:00 2001 From: Materialistix Date: Wed, 27 Aug 2025 09:22:23 +0200 Subject: [PATCH 3/3] Update README.md from systemd deployment --- deployment/systemd/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deployment/systemd/README.md b/deployment/systemd/README.md index ae252ac..088891b 100644 --- a/deployment/systemd/README.md +++ b/deployment/systemd/README.md @@ -26,7 +26,7 @@ Clone the repository to `/opt/fail2ban-ui`: ```bash sudo git clone https://github.com/swissmakers/fail2ban-ui.git /opt/fail2ban-ui cd /opt/fail2ban-ui - sudo go build -o fail2ban-ui ./cmd/main.go + sudo go build -o fail2ban-ui ./cmd/server/main.go ``` ### Create the fail2ban-ui.service @@ -39,6 +39,7 @@ After=network.target fail2ban.service Requires=fail2ban.service [Service] +Type=simple WorkingDirectory=/opt/fail2ban-ui ExecStart=/opt/fail2ban-ui/fail2ban-ui Restart=always