Fail2ban on Goautodial

General and Support topics relating to ViciDialNow and GoAutoDial ISO installers

Moderators: enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, s0lid

Fail2ban on Goautodial

Postby root2 » Tue Jan 08, 2013 11:56 am

Hi Everyone,

Has anyone been successful in installing fail2ban on goautodial 2.1..I tried installing it but I get this error "iptables: No chain/target/match by that name" when type iptables -L -V

I laready changed the ignoreip edited to 127.0.0.1 192.168.1.0/24.

Thanks again guys in advance!

Installing Fail2ban in centos
1.yum install fail2ban
If your CentOS doesn't find the package, please execute the following command and then try again.
2.rpm -Uvh http://download.fedora.redhat.com/pub/e ... noarch.rpm
3.yum install python iptables
or
wget http://downloads.sourceforge.net/projec ... r=transact
tar -xf fail2ban-0.8.4.tar.bz2
cd fail2ban-0.8.4
python setup.py install
cp files/redhat-initd /etc/init.d/fail2ban
chkconfig --add fail2ban
chkconfig fail2ban on

Once installing the Fail2ban create asteirsk.conf file under the fail2ban directory

4. vi /etc/fail2ban/filter.d/asterisk.conf

and copy and paste the below

# ===================
# /etc/fail2ban/filter.d/asterisk.conf
# Fail2Ban configuration file
#
#
# $Revision: 250 $
#
[INCLUDES]
# Read common prefixes. If any customizations available -- read them from
# common.local
#before = common.conf
[Definition]
#_daemon = asterisk
# Option: failregex
# Notes.: regex to match the password failures messages in the logfile.
#The
# host must be matched by a group named "host". The tag "" can
# be used for standard IP/hostname matching and is only an alias
#for
# (?:::f{4,6}:)?(?PS+)
# Values: TEXT
#

failregex = Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - Wrong password
Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - No matching peer found
Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - Device does not match ACL
Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - Username/auth name mismatch
Registration from '.*' failed for '<HOST>(:[0-9]{1,5})?' - Peer is not supposed to register
NOTICE.* <HOST> failed to authenticate as '.*'$
NOTICE.* .*: No registration for peer '.*' (from <HOST>)
NOTICE.* .*: Host <HOST> failed MD5 authentication for '.*' (.*)
VERBOSE.* logger.c: -- .*IP/<HOST>-.* Playing 'ss-noservice' (language '.*')


# Option: ignoreregex
# Notes.: regex to ignore. If this regex matches, the line is ignored.
# Values: TEXT
#
ignoreregex =
# ===================
Add the [asterisk-iptables] section to your /etc/fail2ban/jail.conf file :
# /etc/fail2ban/jail.conf
#====================



5 . Save and exit the file
6. vi /etc/fail2ban/jail.conf
go to the last line of theis file and paste the below lines there

[asterisk-iptables]
enabled = true
filter = asterisk
action = iptables-allports[name=ASTERISK, protocol=all]
sendmail-whois[name=ASTERISK,
dest=youremailaddress@somewhere.com, sender=fail2ban@somewhere.com]
logpath = /var/log/asterisk/full
maxretry = 5
bantime = 600
#====================


7. Also in /etc/fail2ban/jail.conf file you want to add your own IP address range ( ours is192.168.1.0 ) :
ignoreip = 127.0.0.1 192.168.1.0/24

8. make the fail2ban to start at startup
chkconfig fail2ban on
9. start the fail2ban now
/etc/init.d/fail2ban start
10 . now check whether the fail2ban is installed properly to detect the attacks
iptables -L –v
You should see "fail2ban-ASTERISK" in your iptables output.

11. now try to register a extension from outside with wrong password or worng extension and run the iptables command to see the blocked ip addresses
AMD Phenom(tm) 9600B Quad-Core Processor
4 gig ddr2
500gig hd
Goautodial 2.1
Vicidial SVN 2.4-309a BUILD: 110430-1642
Asterisk 1.4.39.1-vici
Dahdi 2.4.1
CentOS 5.6
root2
 
Posts: 20
Joined: Fri Aug 19, 2011 6:46 am

Re: Fail2ban on Goautodial

Postby williamconley » Thu Apr 18, 2013 5:46 pm

funny, i always thought fail2ban was already installed in goautodial. but we don't use it ... we use pure whitelist only.
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20256
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Fail2ban on Goautodial

Postby gardo » Thu Apr 18, 2013 6:18 pm

It's not part of GoAutoDial CE 2.1 32bit. However, it's installed by default on the 64bit version: http://goautodial.org/projects/goautodialce/wiki/64bit. GoAutoDial CE v3.0 will also have it out of the box for both 32bit and 64bit versions.
http://goautodial.com
Empowering the next generation contact centers
gardo
 
Posts: 1926
Joined: Fri Sep 15, 2006 10:24 am
Location: Manila, 1004

Re: Fail2ban on Goautodial

Postby williamconley » Thu Apr 18, 2013 9:15 pm

have you instituted dynamic good guys yet? (Whitelist with Dynamic agent bypass port ... already released the package on Viciwiki.com)
Vicidial Installation and Repair, plus Hosting and Colocation
Newest Product: Vicidial Agent Only Beep - Beta
http://www.PoundTeam.com # 352-269-0000 # +44(203) 769-2294
williamconley
 
Posts: 20256
Joined: Wed Oct 31, 2007 4:17 pm
Location: Davenport, FL (By Disney!)

Re: Fail2ban on Goautodial

Postby callcrazy » Wed May 15, 2013 3:39 pm

@root2 - The switches are case sensitive. The help says -v and you show -V.
Vicibox 6.0.4 from .iso | VERSION: 2.12-538a BUILD: 160122-1401 | Asterisk 1.8.32.3-vici | 1xDB, 2xWeb, 7xPBX | Amfeltec Timers | Sangoma/Lyra AMD | Dell Hardware
callcrazy
 
Posts: 122
Joined: Fri Sep 10, 2010 11:30 am
Location: MI


Return to ViciDialNow - GoAutoDial

Who is online

Users browsing this forum: No registered users and 106 guests