| 1 |
#!/bin/sh |
| 2 |
# Copyright (C) 2000-2013 Boris Wesslowski |
| 3 |
# $Id: fwlw_notify 731 2013-05-17 14:15:23Z bw $ |
| 4 |
# fwlogwatch realtime notification script |
| 5 |
|
| 6 |
# You can invoke a custom action through this script when fwlogwatch |
| 7 |
# issues an alert. A few commented examples are shown below. |
| 8 |
# The available arguments (if activated in the configuration, if not the |
| 9 |
# fields will contain a '-') are: |
| 10 |
# $1 count |
| 11 |
# $2 source IP |
| 12 |
# $3 destination IP |
| 13 |
# $4 protocol |
| 14 |
# $5 source port |
| 15 |
# $6 destination port |
| 16 |
|
| 17 |
|
| 18 |
### Use the following lines for email notifications, $EMAIL is the recipient |
| 19 |
# |
| 20 |
#EMAIL=root@localhost |
| 21 |
# |
| 22 |
#/bin/echo "fwlogwatch ALERT on $HOSTNAME: $1 packet(s) from $2 to $3" | /bin/mail -s "fwlogwatch ALERT: $1 packet(s) from $2" $EMAIL |
| 23 |
|
| 24 |
|
| 25 |
### Use the following lines for SMB notifications, $SMBHOST is the host the |
| 26 |
### alert should appear |
| 27 |
# |
| 28 |
#SMBHOST=hostname |
| 29 |
# |
| 30 |
#/bin/echo "fwlogwatch ALERT on $HOSTNAME: $1 packet(s) from $2" | /usr/bin/smbclient -M $SMBHOST |
| 31 |
|
| 32 |
|
| 33 |
### Use the following line to generate a custom log entry |
| 34 |
# |
| 35 |
#/usr/bin/logger -p security.alert -t "fwlogwatch ALERT" "$1 packet(s) from $2" |
| 36 |
|
| 37 |
|
| 38 |
### You may also want to log alerts to a file |
| 39 |
# |
| 40 |
#NOW=`date +'%Y-%m-%d-%H-%M-%S'` |
| 41 |
#/bin/echo "$NOW: $1 packet(s) from $2 to $3" >> /tmp/fwlw.log |
| 42 |
|
| 43 |
|
| 44 |
### Insert your own ideas here, anything is possible. :-) |