Asterisk 1.8 Breaks Fail2Ban

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,201
Reaction score
5,220
The Fail2Ban Wiki is reporting that Asterisk 1.8 (again) improved things by changing the log entries for failed login attempts. The new 1.8 entries now include the port number, e.g.

HTML:
Nov  4 18:30:40 localhost asterisk[32229]: NOTICE[32257]:  chan_sip.c:23417 in handle_request_register: Registration from  'XXXXXXXXXXXXXXXXX' failed for '192.168.200.100:36998' - Wrong password
This obviously breaks PIAF's existing Fail2Ban REGEX screening which looked for Wrong password immediately after the IP address.


The fix is to log into your server as root and issue the following commands:

HTML:
cd /etc/fail2ban/filter.d
wget http://pbxinaflash.net/source/fail2ban/asterisk18.conf
mv asterisk.conf asterisk14.conf
mv asterisk18.conf asterisk.conf
service fail2ban restart


NOTE: All Incredible PBX 1.8 future installs now include the patch provided you download a fresh copy of the .x installer.
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
Just testing update-fixes to push this out via that method. Will let everyone know when they can get the automated version. Should not be too long

Tom
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
Mr Ward, Darmock;

I have rentPBX and did this patch but it MADE my server unstable and I am locked out of SSH too.

I have a ticket in to restore the old (now named asterisk14.conf) file back and restart my server as I am locked out now.

Does this Fail2Ban conf need to have a 'special' rentpbx version made?

Just asking.
 

darmock

PIAF Developer
Joined
Oct 18, 2007
Messages
2,892
Reaction score
98
Good question. Sorry don't I have an answer for you. I am still testing Ward's patch to fail2ban so stay tuned. There are significant changes in the asterisk.conf file FYI.

Generally Ward test's out the cloud/remote virtual/incredible PIAF and I test out the real boxes and virtual versions of PIAF. Trouble is there are now too many permutations of how PIAF can be installed and run to test every single one of them. However I am sure people say we whine too much about this being for free. 8^)


Tom
 

mainenotarynet

Not really a Guru - Just a long time user
Joined
May 29, 2010
Messages
754
Reaction score
155
Thanks for the reply but it turns out I'm an idiot as I changed 2 passwords on the Piaf and forgot to update the phones as well which actually triggered the fail2ban to ban ME. to not ban me I need to put my public IP where? -- /etc/fail2ban/jail.conf or somewhere else?

Yes I did correct my phones this time :)
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,201
Reaction score
5,220
Thanks for the correction. We tested it on RentPBX before the patch announcement was ever made. :crazy:

There's a reason why you should only make one change at a time and test, test, test.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,201
Reaction score
5,220
Running update-programs then update-fixes will get all existing PIAF-Purple systems upgraded automatically. All new installs now include the Fail2Ban fix. Thanks, Tom!
 

Members online

Forum statistics

Threads
25,810
Messages
167,755
Members
19,240
Latest member
nikko
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top