You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

setup_fail2ban.mkd 849B

123456789101112131415161718192021222324
  1. ## Configure fail2ban for Gitblit-SSH
  2. This procedure uses [fail2ban](http://www.fail2ban.org/).
  3. First, create a new filter file `gitblit.conf` in filter directory (Debian/CentOS: `/etc/fail2ban/filter.d/`) or into `filter.conf` file. Here is an example:
  4. [Definition]
  5. failregex = Failed login attempt for .+, invalid credentials from <HOST>\s*$
  6. could not authenticate .*? \(/<HOST>:[0-9]*\) for SSH using the supplied password$
  7. ignoreregex =
  8. Then edit `jail.conf` to add "gitblit" service (Debian: `/etc/fail2ban/jail.conf`). For example:
  9. [gitblit]
  10. enabled = true
  11. port = 443,29418
  12. protocol = tcp
  13. filter = gitblit
  14. logpath = /var/log/gitblit.log
  15. Reload fail2ban config to apply (`fail2ban-client reload`).
  16. Check the status of the gitblit fail2ban jail with `fail2ban-client status gitblit`