Fail2ban plugin is not working properly.

  • I installed the fail2ban plugin in early 2022 to create a nextcloud jail. I left it alone after confirming that blocking access to the site worked normally.


    I recently installed vaultwarden to create a vaultwarden jail and tested it to see if it works normally, but I only received an email from fail2ban saying that access from the test ip was blocked, but access to the site from the ip was not blocked. I was still able to access the site with the blocked ip.


    The nextcloud and vaultwarden jails I created are all the same, and the default omv gui jail also gives the same error.


    I tried reinstalling the plugin but it's the same.


    After searching on the forum here, I tried using the command related to omv salt, but the error still occurs.


    Nextcloud and vaultwarden run in a docker environment and are accessed through a reverse proxy.


    I am new to linux environment and server.



    [environment]

    G4560, 8GB RAM, omv iso installed




    [Related settings]






    Status

    |- Number of jails: 1

    `- Jail list: nextcloud


    Status for the jail: nextcloud

    |-Filter

    | |- Currently failed: 0

    | |- Total failed: 0

    | `- File list: /var/lib/docker/volumes/nextcloud_data/_data/nextcloud.log

    `-Actions

    |- Currently banned: 1

    |- Total banned: 1

    `- Banned IP list: "TEST IP"




    [Related logs]


    fail2ban.utils [2055511]: ERROR 7f73775e78f0 -- exec: iptables -w -N f2b-vaultwarden


    fail2ban.utils [2055511]: ERROR 7f73775e78f0 -- stderr: "iptables v1.8.7 (nf_tables): invalid port/service `' specified"


    fail2ban.utils [2055511]: ERROR 7f73775e78f0 -- stderr: "Try `iptables -h' or 'iptables --help' for more information."


    fail2ban.utils [2055511]: ERROR 7f73775e78f0 -- returned 2


    fail2ban.actions [2055511]: ERROR Failed to execute ban jail 'vaultwarden' action 'iptables-multiport' info 'ActionInfo({'ip': 'TEST IP', 'family': 'inet4', 'fid': at 0x7f73776beca0 >, 'raw-ticket': at 0x7f73776bf3a0>})': Error starting action Jail('vaultwarden')/iptables-multiport: 'Script error'

  • pavelkms


    After creating jail.local in /etc/fail2ban path


    [DEFAULT]


    chain=DOCKER-USER


    I pasted the above and rebooted the system.

    But nothing has changed.

    After unblocking all IPs, I tried blocking again, but access from the blocked IP is still possible.


    I tried sudo iptables -L

    but I don't see any blocked ips.


    It seems that the ip is not registered in iptables due to a script error.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!