openmediavault-fail2ban first version now available for testing

    • OMV 1.0

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Hello

      1 - What's your OMV version ? (dpkg -l | grep openmediavault)
      2 - What's your openmediavault-fail2ban version ? (dpkg -l | grep openmediavault-fail2ban)
      3 - I think fail2ban is started but you have error in log. Can you check fail2ban service is started ? ( ps -ef | grep fail2ban or service fail2ban status )
      4 - I think a file is missing ...
      5 - Have you test to desinstall and reinstall ? (force desinstall in hopeless case : dpkg -P openmediavault-fail2ban)
      6 - With infos on 1,2,3 i can help you fully ;)
      Open Media Vault 2.2.6 (Stone burner) in Prod
      Open Media Vault 3.0.32 (Erasmus) in Test

      openmedivault Docker Container
      https://github.com/prbond/openmedivault-dockerfile

      Dev :
      openmediavault-fail2ban 1.1.5 for OMV2.X
      openmediavault-fail2ban 1.3.0 for OMV3.X
      https://github.com/prbond/openmediavault-fail2ban
      https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-fail2ban
    • :thumbsup: Youpi
      Open Media Vault 2.2.6 (Stone burner) in Prod
      Open Media Vault 3.0.32 (Erasmus) in Test

      openmedivault Docker Container
      https://github.com/prbond/openmedivault-dockerfile

      Dev :
      openmediavault-fail2ban 1.1.5 for OMV2.X
      openmediavault-fail2ban 1.3.0 for OMV3.X
      https://github.com/prbond/openmediavault-fail2ban
      https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-fail2ban
    • output of dpkg -l | grep openmediavault

      ii openmediavault 1.17 all Open network attached storage solution ii openmediavault-clamav 1.3 all OpenMediaVault ClamAV plugin ii openmediavault-fail2ban 1.1.1 all OpenMediaVault Fail2ban plugin ii openmediavault-forkeddaapd 1.2 all OpenMediaVault forked-daapd (DAAP server) plugin ii openmediavault-keyring 0.3 all GnuPG archive keys of the OpenMediaVault archive ii openmediavault-mysql 1.0.16 all MySQL plugin for OpenMediaVault. ii openmediavault-nginx 1.3 all Nginx plugin for OpenMediaVault. ii openmediavault-omvextrasorg 1.17 all OMV-Extras.org Package Repositories for OpenMediaVault ii openmediavault-plexmediaserver 1.0.10 all OpenMediaVault Plex Media Server plugin ii openmediavault-sabnzbd 1.0.5 all OpenMediaVault SABnzbd plugin ii openmediavault-sensors 1.0.5 all Provides a cpu temperature monitor ii openmediavault-subsonic 1.0.5 all A web-based music streamer, jukebox and Podcast receiver ii openmediavault-virtualbox 1.2 all VirtualBox plugin for OpenMediaVault.

      output of dpkg -l | grep openmediavault-fail2ban

      ii openmediavault-fail2ban 1.1.1 all OpenMediaVault Fail2 ban plugin

      output of service fail2ban status
      Status of authentication failure monitor:fail2ban is not running ... failed!

      reinstall does not work even removing with dpkg -P openmediavault-fail2ban and reinstalling after.

      i have confirmed that the files are there when installed. so i don't think i miss any files.


      after a few more try's i got it working finally.

      one more question, where do i alter or add the filters?

      The post was edited 2 times, last by jonathan999 ().

    • Hum it's strange ...

      to deinstall :

      Source Code

      1. apt-get remove openmediavault-fail2ban
      2. apt-get purge openmediavault-fail2ban

      or

      Source Code

      1. dpkg -r openmediavault-fail2ban
      2. dpkg -P openmediavault-fail2ban


      After "dpkg -l | grep openmediavault-fail2ban" maybe empty
      And you can now reinstall with webgui into plugin section

      It's ok ??

      For this moment you must alter or add filters manually, there are in /etc/fail2ban/filter.d/
      It's a new feature needed ?
      Open Media Vault 2.2.6 (Stone burner) in Prod
      Open Media Vault 3.0.32 (Erasmus) in Test

      openmedivault Docker Container
      https://github.com/prbond/openmedivault-dockerfile

      Dev :
      openmediavault-fail2ban 1.1.5 for OMV2.X
      openmediavault-fail2ban 1.3.0 for OMV3.X
      https://github.com/prbond/openmediavault-fail2ban
      https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-fail2ban
    • It would certainly be nice is we could add and alter filters in the webgui

      fail2ban is working now

      i have one more feature request: when adding a jail write it to jail.local instead of jail.conf in that way when fail2ban get's updated your jails still work after the upgrade because jail.conf get's overwritten by the upgrade

      The post was edited 1 time, last by jonathan999 ().

    • Testing this now, and it seems to be working, but 3 comments:
      - Why doesn't this use a monochrome icon like everything else in omv? The color icon sticks out like a sore thumb!
      - Why does it have default jails for apache and not for nginx ? It would make sense to package the an omv plugin with jails for nginx.
      - It would be nice to have a list of banned IPs in the WebUI, but I don't know if that's possible.
    • Nibb31 wrote:

      It would be nice to have a list of banned IPs in the WebUI, but I don't know if that's possible.
      @pr_bond - that would be good to have in the logs like autoshutdown.
      OMV stoneburner | HP Microserver | 256GB Samsung 830 SSD for system | 4x 2TB in a RAID5
      OMV erasmus| Odroid XU4 | 5TB Data drive | 500GB Backup drive
    • - Why doesn't this use a monochrome icon like everything else in omv? The color icon sticks out like a sore thumb!
      I'm a dev, not a graphist, no time yet to change -> TODOLIST

      - Why does it have default jails for apache and not for nginx ? It would make sense to package the an omv plugin with jails for nginx.
      But i prefer Apache lol, i'm agree with you to put nginx for default -> TODOLIST

      - It would be nice to have a list of banned IPs in the WebUI, but I don't know if that's possible.
      You can already see list of banned IPs In diagnoctics -> Services -> Fail2ban : (like smb, FTP, SSH)

      Example :

      Source Code

      1. Status
      2. |- Number of jail: 2
      3. `- Jail list: ssh, ssh-ddos
      4. Status for the jail: ssh
      5. |- filter
      6. | |- File list: /var/log/auth.log
      7. | |- Currently failed: 0
      8. | `- Total failed: 0
      9. `- action
      10. |- Currently banned: 0
      11. | `- IP list:
      12. `- Total banned: 0
      13. Status for the jail: ssh-ddos
      14. |- filter
      15. | |- File list: /var/log/auth.log
      16. | |- Currently failed: 0
      17. | `- Total failed: 0
      18. `- action
      19. |- Currently banned: 0
      20. | `- IP list:
      21. `- Total banned: 0
      Display All
      Open Media Vault 2.2.6 (Stone burner) in Prod
      Open Media Vault 3.0.32 (Erasmus) in Test

      openmedivault Docker Container
      https://github.com/prbond/openmedivault-dockerfile

      Dev :
      openmediavault-fail2ban 1.1.5 for OMV2.X
      openmediavault-fail2ban 1.3.0 for OMV3.X
      https://github.com/prbond/openmediavault-fail2ban
      https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-fail2ban
    • @WastlJ
      @pr_bond - that would be good to have in the logs like autoshutdown.

      You can already see logs of fail2ban In diagnostics -> Journal -> Fail2ban - Log : (like Auth, message, syslog)
      Open Media Vault 2.2.6 (Stone burner) in Prod
      Open Media Vault 3.0.32 (Erasmus) in Test

      openmedivault Docker Container
      https://github.com/prbond/openmedivault-dockerfile

      Dev :
      openmediavault-fail2ban 1.1.5 for OMV2.X
      openmediavault-fail2ban 1.3.0 for OMV3.X
      https://github.com/prbond/openmediavault-fail2ban
      https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-fail2ban
    • Nibb31 wrote:

      It's been bugging my OCD so bad that I decided to make you an .svg icon for the plugin. I'm not a graphist either, but I think this should be better than the tiny color icon that you've been using...

      Cheers!


      Thank you so much. Now i can install it.

      Another question: Does "port: ftp" works, if i changed the port from default?
      HP ProLiant N54L | 16 GB RAM | 4x4TB WD Red RAID 5 | ESXi 5.5 | OMV 2.1.x 64 bit
    • Hm, it seems that the settings of the plugin, and the jail.conf-file are not in sync.

      If I change the action/email in OMV, it looks like it's saved OK, but when I check /etc/fail2ban/jail.conf the old values are still there.

      Now, I've changed the values directly in jail.conf, and now they're honored by fail2ban, but the settings-view on OMV still shows the wrong values.

      Is this a known bug?
      Atom 330 @ 1.6GHz, 4GB RAM
      2x3TB Data, 1x3TB Parity, SnapRAID + AUFS pool
      Latest OMV running on custom Debain Wheezy, 3.14 Backports kernel
    • I am getting the following error:

      Error #4000:
      exception 'OMVException' with message 'Failed to execute command 'fail2ban-client status 2>&1': ERROR Unable to contact server. Is it running?' in /usr/share/openmediavault/engined/rpc/fail2ban.inc:368
      Stack trace:
      #0 [internal function]: OMVRpcServiceFail2ban->getStats(NULL, Array)
      #1 /usr/share/php/openmediavault/rpcservice.inc(125): call_user_func_array(Array, Array)
      #2 /usr/share/php/openmediavault/rpc.inc(79): OMVRpcServiceAbstract->callMethod('getStats', NULL, Array)
      #3 /usr/sbin/omv-engined(500): OMVRpc::exec('Fail2Ban', 'getStats', NULL, Array, 1)
      #4 {main}

      Source Code

      1. ​root@Krisol:~# dpkg -l | grep openmediavault
      2. ii openmediavault 1.18 all Open network attached storage solution
      3. ii openmediavault-anacron 0.5.3 all anacron plugin for OpenMediaVault.
      4. ii openmediavault-autoshutdown 1.0.8 all OpenMediaVault AutoShutdown Plugin
      5. ii openmediavault-backup 1.0.11 all backup plugin for OpenMediaVault.
      6. ii openmediavault-clamav 1.3 all OpenMediaVault ClamAV plugin
      7. ii openmediavault-dnsmasq 1.0.3 all OpenMediaVault dnsmasq (local DNS and DHCP server) plugin
      8. ii openmediavault-downloader 1.0.5 all OpenMediaVault downloader plugin
      9. ii openmediavault-fail2ban 1.1.1 all OpenMediaVault Fail2ban plugin
      10. rc openmediavault-iscsitarget 0.5.6 all OpenMediaVault iSCSI Enterprise Target plugin
      11. ii openmediavault-keyring 0.3 all GnuPG archive keys of the OpenMediaVault archive
      12. rc openmediavault-links 1.5 all OpenMediaVault links plugin
      13. ii openmediavault-minidlna 1.0.11 all OpenMediaVault miniDLNA (DLNA server) plugin
      14. ii openmediavault-omvextrasorg 1.17 all OMV-Extras.org Package Repositories for OpenMediaVault
      15. ii openmediavault-openvpn 1.1 all OpenVPN plugin for OpenMediaVault.
      16. ii openmediavault-owncloud 1.4 all OpenMediaVault ownCloud plugin
      17. ii openmediavault-plexmediaserver 1.0.10 all OpenMediaVault Plex Media Server plugin
      18. rc openmediavault-route 1.3 all OpenMediaVault IP routing table plugin
      19. ii openmediavault-shellinabox 1.1 all OpenMediaVault shellinabox
      20. rc openmediavault-supportinfo 0.5.12 all OpenMediaVault support panel
      21. ii openmediavault-transmissionbt 1.3 all OpenMediaVault Transmission (BitTorrent client) plugin.
      22. rc openmediavault-virtualhosts 0.5.2 all VirtualHost plugin for OpenMediaVault.
      23. rc openmediavault-website 0.5.6 all OpenMediaVault website plugin
      24. rc openmediavault-wol 1.0.2 all OpenMediaVault WOL plugin
      25. rc openmediavault-wordpress 0.5 all OpenMediaVault Wordpress plugin
      Display All


      Source Code

      1. ​root@Krisol:~# dpkg -l | grep openmediavault-fail2ban
      2. ii openmediavault-fail2ban 1.1.1 all OpenMediaVault Fail2ban plugin


      Source Code

      1. ​root@Krisol:~# ps -ef | grep fail2ban or service fail2ban status
      2. grep: or: No such file or directory
      3. grep: service: No such file or directory
      4. grep: fail2ban: No such file or directory
      5. grep: status: No such file or directory


      tried re installing but same error. appreciate if yu can help