linuxserver / docker-fail2ban

GNU General Public License v3.0
57 stars 7 forks source link

[jail.conf values reset to default on container restart] jail.conf does not save correctly? #22

Closed kiyros closed 10 months ago

kiyros commented 10 months ago

Is there an existing issue for this?

Current Behavior

when editing jail.conf file, it does not persist after saving if you restart or start container and instead reset to default values after restarting or starting the container

Expected Behavior

jail.conf should save and should not revert to default values

Steps To Reproduce

  1. edit jail.conf while running the container
  2. save changes
  3. restart container
  4. jail.conf shows default values instead of the edited values

Environment

- OS: Debian 12
- How docker service was installed: installed on portainer with the config found in the repo:
https://docs.linuxserver.io/images/docker-fail2ban/#docker-compose-recommended-click-here-for-more-info

CPU architecture

x86-64

Docker creation

deploy/create button in portainer

Container logs

2024-01-17 20:20:54,664 7F3AEF3FBB48 WARNI 'allowipv6' not defined in 'Definition'. Using default one: 'auto'
 2024-01-17 20:20:54,664 7F3AEF3FBB48 INFO  Loading configs for filter.d/code-server under /etc/fail2ban 
 2024-01-17 20:20:54,664 7F3AEF3FBB48 DEBUG Reading configs for filter.d/code-server under /etc/fail2ban 
 2024-01-17 20:20:54,664 7F3AEF3FBB48 DEBUG Reading config files: /etc/fail2ban/filter.d/code-server.conf
 2024-01-17 20:20:54,664 7F3AEF3FBB48 INFO    Loading files: ['/etc/fail2ban/filter.d/code-server.conf']
 2024-01-17 20:20:54,665 7F3AEF3FBB48 INFO    Loading files: ['/etc/fail2ban/filter.d/common.conf']
 2024-01-17 20:20:54,665 7F3AEF3FBB48 INFO    Loading files: ['/etc/fail2ban/filter.d/common.local']
 2024-01-17 20:20:54,665 7F3AEF3FBB48 INFO    Loading files: ['/etc/fail2ban/filter.d/common.conf', '/etc/fail2ban/filter.d/code-server.conf']
 2024-01-17 20:20:54,665 7F3AEF3FBB48 INFO  Loading configs for action.d/iptables-multiport under /etc/fail2ban 
 2024-01-17 20:20:54,665 7F3AEF3FBB48 DEBUG Reading configs for action.d/iptables-multiport under /etc/fail2ban 
 2024-01-17 20:20:54,665 7F3AEF3FBB48 DEBUG Reading config files: /etc/fail2ban/action.d/iptables-multiport.conf
 2024-01-17 20:20:54,666 7F3AEF3FBB48 INFO    Loading files: ['/etc/fail2ban/action.d/iptables-multiport.conf']
 2024-01-17 20:20:54,666 7F3AEF3FBB48 INFO    Loading files: ['/etc/fail2ban/action.d/iptables.conf']
 2024-01-17 20:20:54,666 7F3AEF3FBB48 INFO    Loading files: ['/etc/fail2ban/action.d/iptables.conf', '/etc/fail2ban/action.d/iptables-multiport.conf']
 2024-01-17 20:20:54,667 7F3AEF3FBB48 NOTIC No file(s) found for glob /docker/code-server/.local/share/code-server/coder-logs/*
 2024-01-17 20:20:54,667 7F3AEF3FBB48 ERROR Failed during configuration: Have not found any log file for code-server jail
 2024-01-17 20:20:54,667 7F3AEF3FBB48 DEBUG Exit with code 255
 2024-01-17 20:20:55,717 7FA814430B48 INFO  Loading configs for fail2ban under /etc/fail2ban 
 2024-01-17 20:20:55,717 7FA814430B48 DEBUG Reading configs for fail2ban under /etc/fail2ban 
 2024-01-17 20:20:55,718 7FA814430B48 DEBUG Reading config files: /etc/fail2ban/fail2ban.conf
 2024-01-17 20:20:55,718 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/fail2ban.conf']
 2024-01-17 20:20:55,718 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/fail2ban.conf']
 2024-01-17 20:20:55,718 7FA814430B48 INFO  Using socket file /var/run/fail2ban/fail2ban.sock
 2024-01-17 20:20:55,718 7FA814430B48 INFO  Using pid file /var/run/fail2ban/fail2ban.pid, [INFO] logging to /config/log/fail2ban/fail2ban.log
 2024-01-17 20:20:55,719 7FA814430B48 INFO  Loading configs for jail under /etc/fail2ban 
 2024-01-17 20:20:55,719 7FA814430B48 DEBUG Reading configs for jail under /etc/fail2ban 
 2024-01-17 20:20:55,719 7FA814430B48 DEBUG Reading config files: /etc/fail2ban/jail.conf, /etc/fail2ban/jail.d/airsonic-auth.conf, /etc/fail2ban/jail.d/apache-auth.conf, /etc/fail2ban/jail.d/apache-badbots.conf, /etc/fail2ban/jail.d/apache-botsearch.conf, /etc/fail2ban/jail.d/apache-fakegooglebot.conf, /etc/fail2ban/jail.d/apache-modsecurity.conf, /etc/fail2ban/jail.d/apache-nohome.conf, /etc/fail2ban/jail.d/apache-noscript.conf, /etc/fail2ban/jail.d/apache-overflows.conf, /etc/fail2ban/jail.d/apache-shellshock.conf, /etc/fail2ban/jail.d/authelia-auth.conf, /etc/fail2ban/jail.d/bitwarden.conf, /etc/fail2ban/jail.d/code-server.conf, /etc/fail2ban/jail.d/dropbear.conf, /etc/fail2ban/jail.d/emby-auth.conf, /etc/fail2ban/jail.d/filebrowser-auth.conf, /etc/fail2ban/jail.d/gitea-auth.conf, /etc/fail2ban/jail.d/gitlab.conf, /etc/fail2ban/jail.d/grafana.conf, /etc/fail2ban/jail.d/guacamole.conf, /etc/fail2ban/jail.d/haproxy-http-auth.conf, /etc/fail2ban/jail.d/homeassistant-auth.conf, /etc/fail2ban/jail.d/lighttpd-auth.conf, /etc/fail2ban/jail.d/nextcloud-auth.conf, /etc/fail2ban/jail.d/nginx-418.conf, /etc/fail2ban/jail.d/nginx-bad-request.conf, /etc/fail2ban/jail.d/nginx-badbots.conf, /etc/fail2ban/jail.d/nginx-botsearch.conf, /etc/fail2ban/jail.d/nginx-deny.conf, /etc/fail2ban/jail.d/nginx-http-auth.conf, /etc/fail2ban/jail.d/nginx-limit-req.conf, /etc/fail2ban/jail.d/nginx-unauthorized.conf, /etc/fail2ban/jail.d/nzbget-auth.conf, /etc/fail2ban/jail.d/openhab-auth.conf, /etc/fail2ban/jail.d/overseerr-auth.conf, /etc/fail2ban/jail.d/php-url-fopen.conf, /etc/fail2ban/jail.d/phpmyadmin-syslog.conf, /etc/fail2ban/jail.d/prowlarr-auth.conf, /etc/fail2ban/jail.d/radarr-auth.conf, /etc/fail2ban/jail.d/sabnzbd-auth.conf, /etc/fail2ban/jail.d/selinux-ssh.conf, /etc/fail2ban/jail.d/sonarr-auth.conf, /etc/fail2ban/jail.d/sshd.conf, /etc/fail2ban/jail.d/suhosin.conf, /etc/fail2ban/jail.d/traefik-auth.conf, /etc/fail2ban/jail.d/unifi-controller-auth.conf, /etc/fail2ban/jail.d/unraid-sshd.conf, /etc/fail2ban/jail.d/unraid-webgui.conf, /etc/fail2ban/jail.d/vaultwarden-auth.conf, /etc/fail2ban/jail.d/znc-adminlog.conf, /etc/fail2ban/jail.d/zoneminder.conf
 2024-01-17 20:20:55,720 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.conf']
 2024-01-17 20:20:55,720 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/paths-lsio.conf']
 2024-01-17 20:20:55,720 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/paths-common.conf']
 2024-01-17 20:20:55,721 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/paths-overrides.local']
 2024-01-17 20:20:55,721 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/airsonic-auth.conf']
 2024-01-17 20:20:55,721 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/apache-auth.conf']
 2024-01-17 20:20:55,721 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/apache-badbots.conf']
 2024-01-17 20:20:55,721 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/apache-botsearch.conf']
 2024-01-17 20:20:55,722 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/apache-fakegooglebot.conf']
 2024-01-17 20:20:55,722 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/apache-modsecurity.conf']
 2024-01-17 20:20:55,722 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/apache-nohome.conf']
 2024-01-17 20:20:55,722 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/apache-noscript.conf']
 2024-01-17 20:20:55,722 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/apache-overflows.conf']
 2024-01-17 20:20:55,723 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/apache-shellshock.conf']
 2024-01-17 20:20:55,723 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/authelia-auth.conf']
 2024-01-17 20:20:55,723 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/bitwarden.conf']
 2024-01-17 20:20:55,723 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/code-server.conf']
 2024-01-17 20:20:55,723 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/dropbear.conf']
 2024-01-17 20:20:55,723 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/emby-auth.conf']
 2024-01-17 20:20:55,724 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/filebrowser-auth.conf']
 2024-01-17 20:20:55,724 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/gitea-auth.conf']
 2024-01-17 20:20:55,724 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/gitlab.conf']
 2024-01-17 20:20:55,724 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/grafana.conf']
 2024-01-17 20:20:55,724 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/guacamole.conf']
 2024-01-17 20:20:55,724 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/haproxy-http-auth.conf']
 2024-01-17 20:20:55,725 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/homeassistant-auth.conf']
 2024-01-17 20:20:55,725 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/lighttpd-auth.conf']
 2024-01-17 20:20:55,725 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nextcloud-auth.conf']
 2024-01-17 20:20:55,725 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nginx-418.conf']
 2024-01-17 20:20:55,725 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nginx-bad-request.conf']
 2024-01-17 20:20:55,725 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nginx-badbots.conf']
 2024-01-17 20:20:55,726 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nginx-botsearch.conf']
 2024-01-17 20:20:55,726 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nginx-deny.conf']
 2024-01-17 20:20:55,726 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nginx-http-auth.conf']
 2024-01-17 20:20:55,726 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nginx-limit-req.conf']
 2024-01-17 20:20:55,726 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nginx-unauthorized.conf']
 2024-01-17 20:20:55,726 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/nzbget-auth.conf']
 2024-01-17 20:20:55,726 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/openhab-auth.conf']
 2024-01-17 20:20:55,727 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/overseerr-auth.conf']
 2024-01-17 20:20:55,727 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/php-url-fopen.conf']
 2024-01-17 20:20:55,727 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/phpmyadmin-syslog.conf']
 2024-01-17 20:20:55,727 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/prowlarr-auth.conf']
 2024-01-17 20:20:55,727 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/radarr-auth.conf']
 2024-01-17 20:20:55,727 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/sabnzbd-auth.conf']
 2024-01-17 20:20:55,728 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/selinux-ssh.conf']
 2024-01-17 20:20:55,728 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/sonarr-auth.conf']
 2024-01-17 20:20:55,728 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/sshd.conf']
 2024-01-17 20:20:55,728 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/suhosin.conf']
 2024-01-17 20:20:55,728 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/traefik-auth.conf']
 2024-01-17 20:20:55,728 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/unifi-controller-auth.conf']
 2024-01-17 20:20:55,728 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/unraid-sshd.conf']
 2024-01-17 20:20:55,729 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/unraid-webgui.conf']
 2024-01-17 20:20:55,729 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/vaultwarden-auth.conf']
 2024-01-17 20:20:55,729 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/znc-adminlog.conf']
 2024-01-17 20:20:55,729 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/jail.d/zoneminder.conf']
 2024-01-17 20:20:55,729 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/paths-common.conf', '/etc/fail2ban/paths-lsio.conf', '/etc/fail2ban/jail.conf', '/etc/fail2ban/jail.d/airsonic-auth.conf', '/etc/fail2ban/jail.d/apache-auth.conf', '/etc/fail2ban/jail.d/apache-badbots.conf', '/etc/fail2ban/jail.d/apache-botsearch.conf', '/etc/fail2ban/jail.d/apache-fakegooglebot.conf', '/etc/fail2ban/jail.d/apache-modsecurity.conf', '/etc/fail2ban/jail.d/apache-nohome.conf', '/etc/fail2ban/jail.d/apache-noscript.conf', '/etc/fail2ban/jail.d/apache-overflows.conf', '/etc/fail2ban/jail.d/apache-shellshock.conf', '/etc/fail2ban/jail.d/authelia-auth.conf', '/etc/fail2ban/jail.d/bitwarden.conf', '/etc/fail2ban/jail.d/code-server.conf', '/etc/fail2ban/jail.d/dropbear.conf', '/etc/fail2ban/jail.d/emby-auth.conf', '/etc/fail2ban/jail.d/filebrowser-auth.conf', '/etc/fail2ban/jail.d/gitea-auth.conf', '/etc/fail2ban/jail.d/gitlab.conf', '/etc/fail2ban/jail.d/grafana.conf', '/etc/fail2ban/jail.d/guacamole.conf', '/etc/fail2ban/jail.d/haproxy-http-auth.conf', '/etc/fail2ban/jail.d/homeassistant-auth.conf', '/etc/fail2ban/jail.d/lighttpd-auth.conf', '/etc/fail2ban/jail.d/nextcloud-auth.conf', '/etc/fail2ban/jail.d/nginx-418.conf', '/etc/fail2ban/jail.d/nginx-bad-request.conf', '/etc/fail2ban/jail.d/nginx-badbots.conf', '/etc/fail2ban/jail.d/nginx-botsearch.conf', '/etc/fail2ban/jail.d/nginx-deny.conf', '/etc/fail2ban/jail.d/nginx-http-auth.conf', '/etc/fail2ban/jail.d/nginx-limit-req.conf', '/etc/fail2ban/jail.d/nginx-unauthorized.conf', '/etc/fail2ban/jail.d/nzbget-auth.conf', '/etc/fail2ban/jail.d/openhab-auth.conf', '/etc/fail2ban/jail.d/overseerr-auth.conf', '/etc/fail2ban/jail.d/php-url-fopen.conf', '/etc/fail2ban/jail.d/phpmyadmin-syslog.conf', '/etc/fail2ban/jail.d/prowlarr-auth.conf', '/etc/fail2ban/jail.d/radarr-auth.conf', '/etc/fail2ban/jail.d/sabnzbd-auth.conf', '/etc/fail2ban/jail.d/selinux-ssh.conf', '/etc/fail2ban/jail.d/sonarr-auth.conf', '/etc/fail2ban/jail.d/sshd.conf', '/etc/fail2ban/jail.d/suhosin.conf', '/etc/fail2ban/jail.d/traefik-auth.conf', '/etc/fail2ban/jail.d/unifi-controller-auth.conf', '/etc/fail2ban/jail.d/unraid-sshd.conf', '/etc/fail2ban/jail.d/unraid-webgui.conf', '/etc/fail2ban/jail.d/vaultwarden-auth.conf', '/etc/fail2ban/jail.d/znc-adminlog.conf', '/etc/fail2ban/jail.d/zoneminder.conf']
 2024-01-17 20:20:55,730 7FA814430B48 WARNI 'allowipv6' not defined in 'Definition'. Using default one: 'auto'
 2024-01-17 20:20:55,730 7FA814430B48 INFO  Loading configs for filter.d/code-server under /etc/fail2ban 
 2024-01-17 20:20:55,730 7FA814430B48 DEBUG Reading configs for filter.d/code-server under /etc/fail2ban 
 2024-01-17 20:20:55,730 7FA814430B48 DEBUG Reading config files: /etc/fail2ban/filter.d/code-server.conf
 2024-01-17 20:20:55,730 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/filter.d/code-server.conf']
 2024-01-17 20:20:55,731 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/filter.d/common.conf']
 2024-01-17 20:20:55,731 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/filter.d/common.local']
 2024-01-17 20:20:55,731 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/filter.d/common.conf', '/etc/fail2ban/filter.d/code-server.conf']
 2024-01-17 20:20:55,731 7FA814430B48 INFO  Loading configs for action.d/iptables-multiport under /etc/fail2ban 
 2024-01-17 20:20:55,731 7FA814430B48 DEBUG Reading configs for action.d/iptables-multiport under /etc/fail2ban 
 2024-01-17 20:20:55,732 7FA814430B48 DEBUG Reading config files: /etc/fail2ban/action.d/iptables-multiport.conf
 2024-01-17 20:20:55,732 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/action.d/iptables-multiport.conf']
 2024-01-17 20:20:55,732 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/action.d/iptables.conf']
 2024-01-17 20:20:55,732 7FA814430B48 INFO    Loading files: ['/etc/fail2ban/action.d/iptables.conf', '/etc/fail2ban/action.d/iptables-multiport.conf']
 2024-01-17 20:20:55,733 7FA814430B48 NOTIC No file(s) found for glob /docker/code-server/.local/share/code-server/coder-logs/*
 2024-01-17 20:20:55,733 7FA814430B48 ERROR Failed during configuration: Have not found any log file for code-server jail
 2024-01-17 20:20:55,733 7FA814430B48 DEBUG Exit with code 255
github-actions[bot] commented 10 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

kiyros commented 10 months ago

2024-01-17 20:20:55,733 7FA814430B48 NOTIC No file(s) found for glob /docker/code-server/.local/share/code-server/coder-logs/* 2024-01-17 20:20:55,733 7FA814430B48 ERROR Failed during configuration: Have not found any log file for code-server jail 2024-01-17 20:20:55,733 7FA814430B48 DEBUG Exit with code 255

I would put "systemd" instead of "auto" for the backend variable but still would not persist after restart. Which is why the log is showing this line

aptalca commented 10 months ago

https://github.com/linuxserver/docker-fail2ban?tab=readme-ov-file#configuration-files