Note: The various configuration parameters are described earlier in this chapter.
Configuring Message Handling for SNMP Traps
This is an example of how to set up Traverse to receive an alert when there is a trap sent by a Netscreen firewall for a UDP flood alert.
Configuring Message Handling
plugins/messages/00_rule_traps.xml
file:<Traverse>
<message-handler>
<!-- udp flood rule -->
<ruleset type="trap" name="162">
<rule>
<description>Netscreen: UDP Flood Attack</description> <pattern>TRAP:\s+\S+\s+(\S+)\s+\(\S+\)\s+\.1\.3\.6\.1\.4\.1\.3224\.1\.4:200\s+1:[^=]+=12;\s+2:[^=]+=([^\:]+:\s+)?(.*);</pattern>
<action>accept</action>
<mapping>
<field name="device_name" match="-1"/>
<field name="device_address" match="1"/>
<field name="alert_text" match="3"/>
</mapping>
<transform>${alert_text}</transform>
<severity>warning</severity>
<show-message>true</show-message>
<auto-clear>300</auto-clear>
</rule>
</ruleset> <!-- end UDP flood rule -->
</message-handler>
</Traverse>
This example triggers the following email notification:
From: traverse@Kaseyacustomer.com
Date: Wed, 27 Apr 2008 08:03:41
To: root@Kaseyacustomer.com
Subject: [Traverse] fw00.dnvr01/Warning: Netscreen: UDP Flood Attack
Event Match Notification from Traverse:
Department Name : Acme_Company
Device Name : fw00.dnvr01
Device Address : 204.0.80.43
Event Source : trap/162
Current Severity : Warning
Test Time : April 27, 2008 8:03:41 AM MDT
Transformed Message :
Port Scan Attempt from 213.46.8.202 to 204.0.80.49 protocol 6 (No Name) (2005-4-27 08:46:38)
Handling Syslog Messages from a Router
/var/log/router
. A corresponding source definition file should be created in plugin/messages
with a filename such as 00_src_syslog_router.xml
. Inside this file is a source definition, e.g.<message-handler>
<source type="file" name="router">
<enabled>true</enabled>
<input>/var/log/router</input>
</source>
</message-handler>
On a Windows host, you will need to set up the native syslog handler as described in Processing Syslog Messages.
syslogd
. The rule will accept all messages in the log file/syslogd
and display it on the Event Console for 15 minutes. After that time, the message is auto-acknowledged and removed from view. For now, all of these messages will be displayed with OK severity. You will need to create plugin/messages/90_rule_syslog_router.xml
with following contents:<Traverse>
<message-handler>
<ruleset type="file" name="router">
<!-- <ruleset type="syslogd" name="default"> -->
<rule>
<description>Default Action for Router Messages</description>
<pattern>:\d+\s+(\w+)\s+(.*)</pattern>
<action>accept</action>
<mapping>
<field name="device_name" match="1"/>
<field name="message_text" match="2"/>
</mapping>
<severity>ok</severity>
<show-message>true</show-message>
<auto-clear>900</auto-clear>
<transform>${message_text}</transform>
</rule>
</ruleset>
</message-handler>
</Traverse>
etc/traverse.init
restart)Aug 1 06:54:10 172.27.72.254 13822: Aug 1 06:51:46.772:
%CRYPTO-6-IKMP_NOT_ENCRYPTED: IKE packet from 65.203.13.221
was not encrypted and it should've been.
The source address of this message is 172.27.72.254. If this is the same IP address that was used to provision the device in Traverse, no further action is required.
As messages are logged in /var/log/router
or received via the syslogd
listener in Traverse, you should now see them show up on the Event Manager console. You should customize which events you want to display and possibly trigger alerts.