Linux - Monitor log and email

Befejezett Kiadva: Dec 1, 2012 Kiszállításkor fizetve
Befejezett Kiszállításkor fizetve

We have some servers with asterisk open to the world. Below is a copy of the log file where we need these lines emailed to us in the event that there is an attack.

We need a script that will monitor the IP address of the "failed for '[url removed, login to view]'" and if the IP address shows up 10 times in less then 1 minute for any failure then we want it to notify us with the following info:

To: [ASK ABOUT TO ADDRESS]

Subject: Security Threat - Asterisk

Message: [Lines for server logs]

Once this email is sent we don't want the script to send another email for the same IP for 30 minutes (so we don't get slammed with emails while we shutdown the attack).

Example of an attack:

File: /var/log/asterisk/full

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"caryl" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"caryl" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"caryl" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"caryl" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"caryl" ' failed for '[url removed, login to view]' - No matching peer found

[Oct 14 04:02:59] NOTICE[3832] chan_sip.c: Registration from '"278" ' failed for '[url removed, login to view]' - No matching peer found

Asterisk PBX Linux

Projektazonosító: #4002774

A projektről

1 ajánlat Távolról teljesíthető projekt Utoljára aktív: Dec 2, 2012

Odaítélve:

amelantoney

PLEASE SEE MY PERSONAL MESSAGE YOU WILL DEFINITELY HIRE ME ... SEE MY ASTERISK REVIEWS

$30 CAD 0 napon belül
(13 értékelés)
3.7