fail2ban implementation for JIRA

Sunil Pothireddy [Intel] December 8, 2013

Can anyone share your action and filter files for implementing fail2ban on JIRA.

I was trying to configure fail2ban on our system and looking for best methods for implementing it effectively.

Any help is highly appreciated.........

3 answers

0 votes
testrijder January 4, 2018

The confluence documentation (https://confluence.atlassian.com/adminjiraserver073/using-fail2ban-to-limit-login-attempts-861253903.html) is half-baked and might lock you out with successful login attempts. Also  the GET definition seems wrong.


The jail definition in filter.d will work with this (checked on v7.6.2 and Fail2ban 0.9.3)

----------
[Definition]
failregex = <HOST>.*"POST /rest/gadget/1.0/login HTTP/1.1" 200 219
            <HOST>.*"POST /login.jsp HTTP/1.1" 200
ignoreregex=
----------


#1: this is using the fact that the message size is 220 when it succeeds and 219 when it fails
#2: this is using the fact that a sucessful login will return 302 (redirect) while it returns 200 if the login fails

 

YMMV

0 votes
Sunil Pothireddy [Intel] December 9, 2013

Thanks for replying but there regular expressions will trigger only for almost every login page count
failregex = <HOST>.*"GET /login.jsp

but we need these alerts to be triggered based on incorrect counts and not on login page count.

For example if you use above failregex then count will be increased as soon as you open a new tab and enter JIRA login URL.

I had gone through Justin link as well and also added my question(comment) yesterday itself.

So I needed something which has better implementation of filters to encounter all intruders.

0 votes
Geoff
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 9, 2013

Not sure if I'm missing something, but google took me to this:

https://confluence.atlassian.com/display/JIRA/Using+Fail2Ban+to+limit+login+attempts

Some more info from the comments on that page: http://justinit.wordpress.com/2011/04/12/setup-fail2ban-for-jira-and-confluence/

Suggest an answer

Log in or Sign up to answer