[HowTo] Hacker in Asterisk abwehren: Fail2Ban (ohne iptables)

Der vServer mit dem Asterisk ist extern. Bei falschen Registrierungsversuchen von ATA oder Softphone wird auch diese IP blockiert. Da die IP dynamisch ist, habe ich gar nicht erst versucht eine von diesen unter "allow" einzutragen. Wurde meine IP blockiert, während dem ich mit WinSCP am Asterisk arbeite, wird die Verbindung nicht unterbrochen, kann dann aber keine geänderten Files mehr auf dem vServer speichern und neu einloggen mit gleicher IP geht auch nicht mehr.
 
Zuletzt bearbeitet:
Warum fail2ban nicht mit Asterisk 1.8 funktioniert steht hier. Neue Konfigurationsdatei findet man dort. Ich kopiere das mal hier rein:
Code:
# 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 "<HOST>" can
#          be used for standard IP/hostname matching and is only an alias for
#          (?:::f{4,6}:)?(?P<host>\S+)
# 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 =
 
Zuletzt bearbeitet:
Kostenlos!

Statistik des Forums

Themen
248,885
Beiträge
2,303,946
Mitglieder
378,564
Neuestes Mitglied
warumdas