cc/td/doc/product/iaabu
hometocprevnextglossaryfeedbacksearchhelp
PDF

Table of Contents

NetRanger Internal Architecture

NetRanger Internal Architecture

This document contains the following sections:

Document Goal

The goal of this document is to provide details on various internal functions and processes of NetRanger, including file and directory structure; daemons, their associated configuration files and tokens; system files; and commands.

Under normal NetRanger operation, detailed knowledge of the architecture and underlying configuration files is not required. Sensor configuration and control should normally be done via the GUI provided on the Director. The information contained in this document may be useful during troubleshooting and in specialized operational environments.

Audience

The intended audience are advanced NetRanger administrators.

Important Terms Used in this Document

The following terms are used throughout this document:


Daemon

NetRanger's functionality is distributed across various daemons (or processes), each of which is purpose-built to handle a specific task. For example, the sapd daemon handles log file polling and database staging whereas the loggerd daemon is charged with writing the log files themselves. The daemons reside in the /usr/nr/bin directory.

Daemon Configuration File

Each daemon has an associated configuration file in the /usr/nr/etc directory. The configuration files have the following naming convention: <daemon>.conf, where <daemon> is the name of the daemon the configuration file is associated with. Each configuration file contains "tokens" that help control daemon activity.

Token

A token is an individual user-configurable setting placed in a daemon's configuration file, such as the name of the router interface used for shunning or the username used to log into a remote database. Table 1 provides an alphabetical list of major tokens and their associated configuration files.


Table 1: Alphabetical List of Major NetRanger Tokens
Token Name Associated Configuration File

ControlPost

sapd.conf

ControlPre

sapd.conf

ControlRun

sapd.conf

ControlUndo

sapd.conf

DisplayMode

sapd.conf

DupDestination

smid.conf

EnableAclLogging

managed.conf

EventAlarmInterval

eventd.conf

EventAlarmThreshold

eventd.conf

EventApplication

eventd.conf

FilenameOfError

all conf files

FilenameOfIPLog

loggerd.conf

FilenameOfLog

loggerd.conf

FilenameOfLogNew

loggerd.conf

FM_Action

sapd.conf

FM_CronTime

sapd.conf

FM_DirFiles

sapd.conf

FM_DirSize

sapd.conf

FM_DirUsed

sapd.conf

LevelOfTrafficLogging

packetd.conf

LogFileMask

sapd.conf

LogFilePathDump

sapd.conf

LogFilePathIPLog

sapd.conf

LogFilePathNew

sapd.conf

LogFilePathOld

sapd.conf

LogFilePathTmp

sapd.conf

LogFilePathVar

sapd.conf

MaxShunEntries

managed.conf

MinContextLevel

loggerd.conf

MinutesOfAutoLog

packetd.conf

MinutesOfAutoShun

packetd.conf

NameOfPacketDevice

packetd.conf

NetDevice

managed.conf

NeverShunAddress

managed.conf

NotifyInterval

sapd.conf

NotifyPerson

sapd.conf

NumberOfRcptTo

packetd.conf

NumberOfSwitchBytes

loggerd.conf

NumberOfSwitchMinutes

loggerd.conf

PollingDelay

sapd.conf

ProfileDetection

packetd.conf

ProfileEnabled

packetd.conf

ProfileResponse

packetd.conf

RecordOfStringName

packetd.conf

ShunAclCisco

managed.conf

ShunInterfaceCisco

managed.conf

SigOfFilterName

packetd.conf

SigOfGeneral

packetd.conf

SigOfStringMatch

packetd.conf

SigOfTcpPacket

packetd.conf

SigOfUdpPacket

packetd.conf

WatchDogInterval

postofficed.conf

WatchDogNumProcessRestarts

postofficed.conf

WatchDogProcDeadAlarmLevel

postofficed.conf

WatchDogProcTimeOutAlarmLevel

postofficed.conf

WatchDogResponseTimeOut

postofficed.conf

File Structure Overview

One of the quickest ways to gain a detailed understanding of NetRanger is to review the Sensor file structure and underlying elements. A thorough understanding of the Sensor file structure will help you configure and install the Sensor as well as help you better utilize NetRanger's features. It should be noted that this file structure serves as the foundation for both the Director and Sensor systems.

The default directory location for the Sensor subsystem is /usr/nr, which contains the following directory structure:

/usr/nr/bin 
    /usr/nr/bin/eventd /usr/nr/bin/eventd/skel /usr/nr/bin/sap /usr/nr/bin/sap/skel /usr/nr/bin/sap/sql /usr/nr/bin/sap/sql/skel
/usr/nr/etc 
    /usr/nr/etc/.lt /usr/nr/etc/backups /usr/nr/etc/licenses /usr/nr/etc/nrConfigure /usr/nr/etc/oem /usr/nr/etc/oem/templates /usr/nr/etc/wgc /usr/nr/etc/wgc/templates
/usr/nr/lib
/usr/nr/skel
/usr/nr/tmp 
    /usr/nr/tmp/queues
/usr/nr/var 
    /usr/nr/var/dump /usr/nr/var/iplog /usr/nr/var/new /usr/nr/var/tmp

The remainder of this document provides information on the NetRanger components in this file structure.

/usr/nr/bin---NetRanger Daemons and Commands

The /usr/nr/bin directory contains all of the executables required to run and administer the application services that support a Sensor or Director system. These can be loosely grouped into three basic categories:

Daemons

NetRanger is a collection of discrete subsystems that have been implemented via daemons, each with its own well-defined set of services.

NetRanger is also a highly configurable distributed application. The daemon services running on a Sensor or Director host depend on the configuration of the application as a whole. At a minimum, a Sensor must have packetd, fileXferd, loggerd, and postofficed daemons running. A Director system should have postofficed, fileXferd, smid, loggerd, and configd running. In a multi-tiered configuration, one Director system could be configured to only stage data to an RDBMS via loggerd and sapd, while another Director system could be dedicated to monitoring and response via the smid and configd daemons.

The full complement of Sensor daemons is as follows:

configd

The configd daemon reads and writes data to the Sensor configuration files (which are currently restricted to /usr/nr/etc). All communication with this daemon is controlled by the following set of SNMP-like executables:

Refer to the "Configuration Commands" section later in this document for more information on commands.

eventd

The eventd daemon allows the Director or Sensor to generate user-defined actions for events received by smid. A common action is to generate pager notifications via e-mail for alarms of severity 4 and above.

fileXferd

The fileXferd daemon is used for file transfer between Sensors and Directors. It is used to transport configuration files between Directors and Sensors.

loggerd

The loggerd daemon writes out sensor and error data to flat files generated by one or more of the other daemon services. This data is passed to loggerd via postofficed. loggerd creates two basic types of flat files: a single Sensor Event file, and one or more IP Session logs. As noted in the Overview, data is written to flat files for reasons of performance and fault tolerance. This data can be staged into an RDBMS and managed for archival via sapd.

managed

The managed daemon is responsible for managing and monitoring network devices (routers and packet filters). For example, when packetd identifies that a certain type of attack should be shunned, it sends a shun command to managed via the post office facility. managed then reconfigures an ACL appropriately. Similar commands can be sent to this daemon from the Director. managed can also be polled for operational statistics such as:

packetd

The packetd daemon interprets and responds to all of the events it detects on the monitored subnet. The types of messages packetd sends to other daemons is based on information stored in /usr/nr/etc/packetd.conf. Where these messages are routed is defined in /usr/nr/etc/destinations.

Although packetd supports 256 levels of alarm events (0-255), only levels 0-5 are currently being used. Level 0 is an internal alarm that packetd uses to track such services as RIP, ICMP, and so on; it is never routed to postofficed. Level 0 is also used to disable a signature.

Levels 1-5 are sent to postofficed, and they identify increasing patterns of misuse, where 5 is the highest type of alarm. Note that every alarm message includes an Alarm-ID that identifies a specific attack signature. These alarm signatures are enumerated in /usr/nr/etc/packetd.conf as SigOfGeneral entries.

In addition to generating alarm messages for a Director application, packetd can automatically instruct managed to shun an attack for a specified period of time.

postofficed

The postofficed daemon serves as the communication vehicle for the entire NetRanger product. All communication between daemons is routed through this service. In most NetRanger configurations the Sensor and Director systems reside on separate hosts. Each system relies on postofficed to maintain communication with the other. Note that postofficed is required even when all of the systems are located on a single host. This daemon service includes the following features:

Routing is based on a three-part key that includes the following:

The Organization IDs are defined in /usr/nr/etc/organizations; Host IDs are defined in /usr/nr/etc/hosts; Application IDs are defined in /usr/nr/etc/services.

sapd

The sapd daemon is a user-configurable scheduler that controls database loading and archival of old event and IP session logs. Oracle or Remedy database loading is accomplished with sapx. Data archival is controlled with the native dump scripts.

smid

The smid daemon's primary function is to populate the alarm icons on the Director's HPOV maps. Additionally, smid can redirect messages to other daemon services, such as eventd and loggerd based on DupDestination entries in /usr/nr/etc/smid.conf file.

Configuration Commands

Table 2 lists the built-in commands on the Sensor that allow remote devices to configure and gather information about the Sensor. These commands serve as the foundation for the Director's nrConfigure interface.

Table 3 provides a syntax description for the commands.


Table 2: Configuration Commands
Command Description Syntax

nrget

Retrieves single pieces of information (for example, one IP address of a managed router).

nrget <appid> <hostid> <orgid> <priority> <token> [ <identifier> ]

nrgetbulk

Retrieves information as a list (for example, a list of IP addresses being shunned).

nrgetbulk <appid> <hostid> <orgid> <priority> <token> [ <identifier> ]

nrset

Sets attributes.

nrset <appid> <hostid> <orgid> <priority> <token> [ <identifier> ] <value>

[ <value> . . . ]

nrunset

Unsets attributes.

nrunset <appid> <hostid> <orgid> <priority> <token> [ <identifier> ]

nrexec

Executes commands.

nrexec <appid> <hostid> <orgid> <priority> <timeout> <token> [ <identifier> ]


Table 3:
Syntax Description
Syntax Element Definition

<appid>

The application ID. A complete list of application IDs is in /usr/nr/etc/services.

<hostid>

The host ID. A complete list of host IDs is in /usr/nr/etc/hosts.

<identifier>

An optional piece of information to further identify a token.

<orgid>

The organization ID. A complete list of organization IDs is in /usr/nr/etc/organizations.

<priority>

The relative priority of the command, expressed as an integer.

<timeout>

The time in seconds to wait until the process is deemed unreachable.

<token>

The name of the token to set or get information from.

<value>

The value that the <token> should be set to.

For example, you would use the following command to retrieve the value set for sapd's ControlPre token (given a Host ID of 10 and Org ID of 100):

nrget 10007 10 100 1 ControlPre
 

The command should return the following:

/usr/nr/bin/sap/load_pre.sh

System Commands

The following scripts are used to perform maintenance on the Sensor:

nrconns

Executing this script returns a list of open NetRanger communication routes. If a connection is down, the following is returned:

<host_name>.<org_name> Connection 1: <ip_address> 45000 1 [SynSent] sto:5000   syn NOT rcvd!
 

The following indicates an established connection:

<host_name>.<org_name> Connection 1: <ip_address> 45000 1 [Established]
sto:5000

nrstart

This script starts the NetRanger daemons. It supports the following options:

-d Don't daemonize 
-h Show help 
-v Show version number 
 

The command takes the following form:

nrstart [-d] [-h] [-v]

nrstop

Executing this script stops the NetRanger daemons.

nrstatus

Executing this script returns a list of currently running daemons. The typical output for a Sensor would be the following:

netrangr   301     1  0   May 18 ?        0:01 /usr/nr/bin/nr.fileXferd
netrangr   298     1  0   May 18 ?        0:01 /usr/nr/bin/nr.loggerd
netrangr   198     1  0   May 18 ?        0:56 /usr/nr/bin/nr.postofficed
netrangr   300     1  0   May 18 ?        0:01 /usr/nr/bin/nr.sapd
netrangr   302     1  0   May 18 ?        1:33 /usr/nr/bin/nr.packetd
netrangr   299     1  0   May 18 ?        0:01 /usr/nr/bin/nr.configd
 

On a Director, typical output would be:

netrangr   439     1  0   May 18 ?        0:09 /usr/nr/bin/nr.loggerd
netrangr   466     1  0   May 18 ?        0:16 /usr/nr/bin/nr.fileXferd
netrangr   465     1  0   May 18 ?        0:06 /usr/nr/bin/nr.smid
netrangr   430     1  0   May 18 ?        0:07 /usr/nr/bin/nr.configd
netrangr   455     1  0   May 18 ?        0:15 /usr/nr/bin/nr.sapd

/usr/nr/etc---System Files and Daemon Configuration Files

The /usr/nr/etc directory contains two types of files:

System Files

This section discusses the system files, which currently include the following:

These files are modeled after UNIX /etc files and UNIX system administrators should have no problem understanding their format and entity relationships.


Note The system files are described in order of use rather than alphabetically.

organizations

This file identifies all of the organizations and their organization ids currently registered for a given NetRanger system. Each entry has the following format:

<org_id> <org_name>
 

where <org_id> is a user-generated ID that uniquely identifies a group of related Sensors and Directors, and <org_name> is a name that is associated with that unique ID. A typical file might look like the following:

100 companyabc 
101 companydef 
102 companyghi 
1001 companyjkl

Note This file serves as a global registry that must agree across all of the Sensor and Director systems within a NetRanger domain.

hosts

This file is much like a UNIX /etc/hosts file. It enumerates the organizations and hosts that are recognized by a given Sensor or Director system in a NetRanger configuration. Each entry has the following format:

<host_id>.<organization_id> <host_name>.<organization_name>
 

where <host_id> and <organization_id> are user-assigned numeric identifiers, and <host_name> and <organization_name> are DNS-like user-assigned names. In addition to a list of recognized hosts, this file always contains a localhost entry.

A typical hosts file might look like the following:

10.100 localhost 
10.100 admin.companyabc 
11.100 dev.companyabc 
12.100 data.companyabc 
13.100 Sensor-1.companyabc 
14.100 Sensor-2.companyabc 
15.100 Sensor-3.companyabc

Note Entries for each host must be consistent across all Sensor and Director systems. Otherwise, some systems will generate "unrecognizable host" messages in /usr/nr/var/errors.postofficed.

services

This file defines the application_id for each of the daemon services found in /usr/nr/bin. When combined with the host_id and organization_id, these identifiers uniquely identify a daemon within a NetRanger security map. Each entry has the following form:

<application_id> <daemon_name> [<comment>]
 

where <application_id> is a Cisco-generated ID number that uniquely identifies the NetRanger daemon, <daemon_name> is the name of the daemon, and <comment> provides some additional information.

All Sensor hosts should have the same default services file, which is currently defined as follows:

10000   postofficed     # Provides the NetRanger communications system
10001   sensord         # Monitors network traffic when used with STK/Nortel
10002   configd         # Provides ability to query runtime/configuration info
10003   managed         # Manages NetRanger components
10004   eventd          # Configurable shell script support for handling events
10005   loggerd         # Logs locally generated events and messages
10006   smid            # Sends data to the director and duplicates messages
10007   sapd            # File management control and database staging
10008   packetd         # Monitors network traffic directly or from Cisco router
10009   reserved        # reserved for Cisco Systems use
10010   fileXferd       # File Transfer service

auths

This file identifies which type of configd operations are authorized for the each of the hosts listed in this file. Each entry follows this form:

<host_name> <configd_services>
 

where <host_name> is the name of the host (in NetRanger format: hostname.orgname) and <configd_services> is a comma-delimited list of authorized commands allowed by the host.

In the following example, admin.cisco has full authorization, whereas data.cisco can only read configuration information:

admin.cisco GET,GETBULK,SET,UNSET,EXEC 
data.cisco GET,GETBULK 
sensor.cisco GET,SET,UNSET,EXEC

Note Each entry in /usr/nr/auths must have a corresponding entry in /usr/nr/etc/hosts.

destinations

NetRanger is a distributed application that has the ability to route messages from a given post office to any of the daemon services registered in the /usr/nr/etc/hosts and /usr/nr/etc/services files. The destinations file identifies what type of messages get routed to a given application on a given host. Each entry is of the following form:

<destination_id> <host_name> <daemon_name> <message_level> <message_type>
 

where <destination_id> is a Numeric ID (up to 32 destinations are currently allowed); <host_name> must be an entry from /usr/nr/etc/hosts; <daemon_name> must be an entry from /usr/nr/etc/services; <message_level> identifies the level of messages that will be routed (messages below that level are not passed on to postofficed); <message_ type> identifies the types of messages to route in a comma-delimited list.

For example, in the following destinations file, level 2 (and higher) event, error, command, and IP_log message types are being routed to the smid daemon on the host admin.cisco. This type of configuration would normally be found on a Sensor system, where admin.cisco is a Director system:

1 admin.cisco smid 2 EVENTS,ERRORS,COMMANDS,IPLOGS

routes

This file identifies the actual IP routes that postofficed uses to send messages between different hosts. Each entry is of the following form:

<host_name> <connection_num> <ip_address> <udp_port> <type>
 

where <host_name> must be an entry from /usr/nr/etc/hosts; <connection_num> identifies the priority of this entry relative to the other routes enumerated in this file (the lower the number, the higher the route priority---if there is more than one entry of the same priority, postofficed accepts the last entry of that priority); <ip_address> identifies the end-point IP address of the remote system; <udp_port> identifies the UDP port service to route through on each host---the default port is 45000; <type> identifies whether the connection is a dial-up vs. dedicated connection. This field is currently not used.

In the following routes file for sensor1.cisco, two direct connections exist between sensor1 and director1 (director1 is dual-homed with IP addresses 10.1.7.9 and 10.4.7.12):

sensor1.cisco 1 192.16.1.1 45000 1 
director1.cisco 1 10.1.7.9 45000 1 
director1.cisco 2 10.4.7.12 45000 1 
 

In the following routes file for sensor1.cisco, a line has been added for a direct connection between sensor1 and director2 (director2 is also dual-homed, with IP addresses 192.16.1.12 and 10.4.7.13). The last line of the routes file indicates that sensor1 can route information to director1 via director2 if all other routes fail. Notice that director2's IP address is used for the third route to director1, and is not considered a direct connection.

sensor1.cisco 1 192.16.1.1 45000 1 
director1.cisco 1 10.1.7.9 45000 1 
director1.cisco 2 10.4.7.12 45000 1 
director2.cisco 1 192.16.1.12 45000 1
director1.cisco 3 192.16.1.12 45000 1

daemons

This file contains the names of daemons that should be started when the system starts up. Each entry is of the following form:

<daemon_name>
 

where <daemon_name> is the name of the daemon in the following format: nr.<daemon_name>.

For example, the following sample entry would start postofficed, configd, loggerd, and smid on a Director system:

nr.postofficed 
nr.configd 
nr.loggerd 
nr.smid

Note Whereas the services file identifies all of the daemon services a given Sensor or Director system is capable of running, the daemons file identifies the services to launch upon startup.

signatures

This file associates signature ids with signature names for NetRanger applications, and is used primarily by Director systems. The format of each entry in the file is:

<signature_id> "<signature_name>"
 

where <signature_id> is a numeric ID uniquely identifying the signature and <signature_name> is the name of the signature.

For example, the following sample entry defines a few attack signatures:

1000 "Bad Option List" 
1001 "Record Packet Rte" 
1002 "Timestamp" 
1003 "Provide s,c,h,tcc" 
1004 "Loose Src Rte" 
1005 "SATNET ID"
Caution The /usr/nr/etc/signatures file should not be modified manually.

Daemon Configuration Files

This section discusses the following topics:

There is a one-to-one correspondence between daemons and their configuration files. Whereas the naming convention for a daemon is nr.<daemon>, the convention for its configuration file is <daemon>.conf. Each of these files contains token-based configuration information of the form:

<token> <value>
 

For example, the error file for nr.managed is identified in managed.conf as follows:

FilenameOfError ../var/errors.managed

eventd.conf

This file contains tokens that control NetRanger's event processing infrastructure. The tokens that require special attention follow.


EventAlarmInterval

The EventAlarmInterval token specifies how much time, in seconds, that NetRanger waits before sending a second notification on alarm activity that meets the event script's conditions.

EventAlarmThreshold

The EventAlarmThreshold token specifies how many alarms should occur before the event processing infrastructure sends a notification. The value for this token can be a comma-delimited list. For example, an entry of "1,5,100" would execute an action the first, fifth, and hundredth time an event occurred during the specified interval.

EventApplication

The EventApplication token specifies the name of the event script. This token is set to the event script in the /usr/nr/bin/eventd directory. Regardless of whether you build custom notification scripts, your script must be able to understand the data fields passed on to it by the event script.

Refer to the NetRanger User Guide for more information on creating custom event processing scripts.

FilenameOfError

The FilenameOfError token specifies the filename used for recording errors in /usr/nr/var. For eventd, the default is /usr/nr/var/errors.eventd.

loggerd.conf

The loggerd.conf file is used by NetRanger to configure the daemon that writes log files.


MinContextLevel

The MinContextLevel specifies the minimum alarm level for logging optional context data. For example, context data associated with level 1-3 alarms will not be written to a Director's Event log file when this token is set to "4."

NumberOfSwitchBytes

The NumberOfSwitchBytes token specifies a size threshold for log files. In other words, it specifies how large a log file can get, in bytes, before loggerd pushes the log file to /usr/nr/var/tmp and starts writing to a new log file in /usr/nr/var/new.

NumberOfSwitchMinutes

The NumberOfSwitchMinutes token specifies a time threshold for log files. In other words, it specifies the maximum amount of time that loggerd should write to a log file in /usr/nr/var/new before pushing the logfile to /usr/nr/var/tmp and starting a new log file.

The loggerd daemon ensures that log files are kept open for at least one minute, even if this means that the file's size crosses the size threshold set with the NumberOfSwitchBytes token.

managed.conf

The managed.conf file is used by the NetRanger Sensor to configure the management daemon that controls actions on the router.


EnableAclLogging

The EnableAclLogging token is used to identify whether logging of policy violations is occurring on the managed router. It is either set to 0 ("off") or 1 ("on").

FilenameOfError

The FilenameOfError token specifies the filename used for recording errors in /usr/nr/var. For managed, the default is /usr/nr/var/errors.managed.

MaxShunEntries

The MaxShunEntries token specifies a maximum number of hosts to shun. This ceiling keeps the Sensor from writing a runaway ACL to the router's shunning interface.

NetDevice

The NetDevice token identifies the IP address, password, and enable password of a Cisco router to which the Sensor is connected. A separate NetDevice entry is required for every Cisco router being managed by the Sensor. The format of the NetDevice token looks like this:
NetDevice <router_ip_address> CiscoDefault <password> <enable_password>
 

where <router_ip_address> identifies the IP address of the Cisco router, <password> is the router's password, and <enable_password> is the router's enable password.

NeverShunAddress

The NeverShunAddress token identifies a host or network device you never want the Sensor or its managed router to shun. At the very minimum you make sure that this file contains NeverShunAddress entries for the local system and the remote Sensor or Director system. Other addresses can be added based on your operational needs. Example entries might look as follows, where <255.255.255.255> identifies the subnet mask for the IP address you do not want shunned.
NeverShunAddress ROUTER_IP_ADDRESS 255.255.255.255 
NeverShunAddress Sensor_IP_ADDRESS 255.255.255.255 
NeverShunAddress INTERNAL_NETWORK 255.255.255.255 
 

ShunAclCisco

The ShunAclCisco token is used to identify the number of the ACL applied to the shunning interface on the router. This token is normally set to 199.

ShunInterfaceCisco

The ShunInterfaceCisco token identifies which interface on the router is being used to shun. The Sensor writes an ACL (whose number is set with the ShunAclCisco token) to the interface indicated. The entry has the following format:
ShunInterfaceCisco <router_ip_address> <interface> <direction>
 

where <router_ip_address> is the IP address of the interface the Sensor uses to communicate with the router (not necessarily the shunning interface!), <interface> is the name of the router interface doing the shunning (for example: Ethernet0, Serial1), and <direction> is either in or out.

packetd.conf

The packetd.conf file serves as the heart of the Sensor system, and is the largest of all of the configuration files.


FilenameOfError

The FilenameOfError token specifies the filename used for recording errors in /usr/nr/var. For packetd, the default is /usr/nr/var/errors.packetd.

MinutesOfAutoLog and MinutesOfAutoShun

The MinutesOfAutoLog and MinutesOfAutoShun tokens establish the amount of time that NetRanger will shun or log after a particular alarm is received. They have the following formats:
MinutesOfAutoLog <log_minutes>
MinutesOfAutoShun <shun_minutes>
 

NameOfPacketDevice

The NameOfPacketDevice token specifies the name of the interface used to capture packets from the monitored subnet. They have the following naming convention: /dev/<device_name>.

The following are legal device names:


RecordOfExcludedAddress

The RecordOfExcludedAddress token identifies alarms that can be locked out for events at specific source addresses. The standard format follows:
RecordOfExcludedAddress <sig_id> <subsig_id> <ip_address>
 

where <sig_id> corresponds to the primary signature established in the Event Specification section that establishes all of the primary IDs; <subsig_id> corresponds to those signatures established in the latter sections, such as those for filtering and string matching; and <ip_address> is the IP address of the source of the alarms.

RecordOfExcludedNetAddress

The RecordOfExcludedNetAddress token can be used to exclude alarms from an entire network. For example:
RecordOfExcludedNetAddress  <sig_id> <subsig_id> <ip_address> <netmask> <direction>
 

RecordOfInternalAddress

The RecordOfInternalAddress token establish which network NetRanger is protecting. It is important to include all internal addresses because this information is also used for intrusion detection. You should have one entry for each network address:
RecordOfInternalAddress <internal_network_address> <internal_network_netmask>
 

RecordOfLogAddress

The RecordOfLogAddress token establishes a binary log of a particular host or network. This is most commonly used to support an investigation and creates a binary record of all data originating from a particular source address. Initially, this line will probably be commented out. It has the following format:
RecordOfLogAddress <logged_network_address> 255.255.255.0
 

RecordOfStringName

This section defines the strings to look for within a given TCP/IP service. The general format for an entry in this section is the following:
RecordOfStringName <string_id> <port> <direction> <num_occurrences> "<matched_string>"
 

where <string_id> establishes the unique ID for that particular string; <port> tells NetRanger which port to watch to look for this string; <direction> tells the Sensor which direction to look for this string (see Table 4); <num_occurrences> indicates how many times the Sensor must see this string before it alarms; <matched_string> is the actual string to be matched.

Table 4: Direction Codes and Corresponding Directions
Direction Code Direction of Attack

1

external-to-internal

2

internal-to-external

3

both directions


SigOfGeneral

The SigOfGeneral token identifies an action and alarm levels for various types of events. packetd.conf contains a number of different SigOf tokens, all of which share the same basic format, which is defined as follows:
SigOfGeneral <sig_id> <action> <dest1> <dest2> <dest3> <dest4> # Description of event
 

where <sig_id> is a numeric identifier that establishes a logical link to internal signature IDs in the packetd daemon; <action> is an action to take (see Table 5); <dest[1-4]> list each of four destinations for alarm activity (these entries should match the entries in /usr/nr/etc/destinations).

Table 5: Action Codes and Corresponding Actions
Action Code Action

0

no action

1

shun

2

log

3

shun and log

4

TCP reset

5

shun and TCP reset

6

TCP reset and log

7

shun, log, and TCP reset


For example, the following SigOfGeneral token defines what to do when a TCP Port Sweep is encountered. It first states that no automatic action should be taken (ACT=0). It also defines that level 5 alarms should be sent to its first three destinations, and a level 4 alarm to the last destination:
SigOfGeneral 3001 0 5 5 5 4 # TCP port sweep
 

SigOfStringMatch

The SigOfStringMatch token uses the same format as SigOfGeneral described previously, and is linked to a RecordOfStringName by its <string_id>:
SigOfStringMatch <string_id> <act> <dest1> <dest2> <dest3> <dest4> # Description of event
 

For example, the following RecordOfStringName token detects any time a user tries to grab the /etc/shadow file using rlogin on port 513:
RecordOfStringName  51302    513   3    1    "[/]etc[/]shadow"
 

The corresponding SigOfStringMatch determines the response when this signature is triggered:
SigOfStringMatch   51302   6   4   4   4   4
 

The response is to send out a TCP reset and log the event (action 6), and send level 4 alarms to each of the four destinations in the /usr/nr/etc/destinations file.

SigOfTcpPacket and SigOfUdpPacket

The SigOfTcpPacket and SigOfUdpPacket tokens establish the alarm levels for any packet, successful or not, with a TCP or UDP destination port corresponding to the entry. The action fields and the event level specification are the same as in previous sections.

Each SigOfTcpPacket and SigOfUdpPacket entry has the following format:
SigOfTcpPacket <port> <action> <dest1> <dest2> <dest3> <dest4>
 

where <port> is the TCP or UDP destination port; <action> specifies an action to take (see Table 5) ; and <dest[1-4]> specifies the destinations listed in /usr/nr/etc/destinations.

The following entry illustrates that all Telnet attempts (Port 23) should have no action taken but should send level 2 alarms to each of four destinations:
SigOfTcpPacket 23 0 2 2 2 2 
 

The next entry indicates level 3 alarms for all TFTP (port 69) attempts that logs the packets:
SigOfUdpPacket 69 1 3 3 3 3 
 

postofficed.conf

The postofficed.conf file contains tokens that control postofficed's heartbeat interval and associated tokens, which together make postofficed an effective purveyor of status about NetRanger processes as well as a conduit for messages.


FilenameOfError

The FilenameOfError token specifies the filename used for recording errors in /usr/nr/var. For postofficed, the default is /usr/nr/var/errors.postofficed.

WatchDogInterval

The WatchDogInterval token specifies how many seconds postofficed waits between polling each process with a status query.

WatchDogNumProcessRestarts

The WatchDogNumProcessRestarts token specifies how many times postofficed attempts to restart a dead process.

WatchDogProcTimeOutAlarmLevel

The WatchDogProcTimeOutAlarmLevel token specifies the level of alarm to send to the NetRanger Director when a process fails to answer a status query.

WatchDogProcDeadAlarmLevel

The WatchDogProcDeadAlarmLevel token specifies the level of alarm to send to the NetRanger Director when a postofficed detects a dead process.

WatchDogResponseTimeOut

The WatchDogResponseTimeOut token specifies how many seconds postofficed waits for a response to a status query before determining that the process is not alive.

sapd.conf

The sapd.conf file contains tokens used for setting up database batch processes, database user IDs and passwords, and other similar bits of information.


ControlPost

The ControlPost token specifies the executable file used to control moving of log files from /usr/nr/var/tmp to /usr/nr/var/dump after they are staged to the database. The default is /usr/nr/bin/sap/load_post.sh.

ControlPre

The ControlPre token specifies the executable file used to control moving of log files from /usr/nr/var/new to /usr/nr/var/tmp. The default is /usr/nr/bin/sap/load_pre.sh.

ControlRun

The ControlRun token specifies the executable file used to control the staging of log files in /usr/nr/var/tmp into the database. The default is /usr/nr/bin/sap/load_run.sh.

ControlUndo

The ControlUndo token specifies the executable file used to move files from /usr/nr/var/tmp back to /usr/nr/var/new if the database staging failed for any reason. The default is /usr/nr/bin/sap/load_undo.sh.

DBAux1

The DBAux1 token specifies additional data needed by Remedy ARS.

DBAux2

The DBAux2 token specifies additional data needed by Remedy ARS.

DBAux3

The DBAux3 token specifies additional data needed by Remedy ARS.

DBPass

The DBPass token specifies the password used to access the Oracle database.

DBPass2

The DBPass2 token specifies the Remedy ARS password.

DBUser

The DBUser token specifies the username used to access the Oracle database.

DBUser2

The DBUser2 token specifies the Remedy ARS username.

DisplayMode

The DisplayMode token specifies how much information is displayed on the console. It can be set to Brief or Full.
DisplayMode Brief
DisplayMode Full
 

FilenameOfError

The FilenameOfError token specifies the filename used for recording errors in /usr/nr/var. For sapd, the default is /usr/nr/var/errors.sapd.

FM_Action

The FM_Action token is used to create the action component of a trigger. Triggers consist of a condition and an action. If a condition is true, then the action is carried out. Another way of looking at it is that a condition specifies when to launch an action, whereas the action is what to carry out.

The five conditions that trigger an FM_Action are:

  • FM_CronTime

  • FM_IdleTime

  • FM_DirFiles

  • FM_DirSize

  • FM_DirUsed


The syntax for setting an FM_Action token is:
FM_Action <label> <exec> <args>
 

where <label> is a unique identifier for the action; <exec> is the name of the script to execute; and <args> is one or more arguments passed to the <exec> script.

For example, the following action, labeled DBLoad1, passes the name of the oldest file in the queried directory to the DBLoad script (see Table 6 for a complete list of mappings between macro names and what they mean to sapd):
FM_Action DBLoad1 DBLoad $FileOldest
 

The condition that triggers this action might look like the following:
FM_DirFiles Oracle_Load 1 /usr/nr/var/new DBLoad1

Table 6: Macro Names and their Expanded Meanings
Macro Meaning Type

$DirFiles

count of all files in queried directory

Filesystem

$DirSize

size in bytes of all files in queried directory

Filesystem

$DirUsed

disk percentage used where queried directory resides

Filesystem

$DirPath

directory location

Filesystem

$FileOldest

name of oldest file in queried directory

Filesystem

$FileNewest

name of newest file in queried directory

Filesystem

$Notify1

value of NotifyPerson token

Token Value

$Notify2

value of NotifyPerson2 token

Token Value

$DBUser

value of DBUser token

Token Value

$DBPass

value of DBPass token

Token Value

$TimeStamp

standard date/time stamp

Date/Time

$CurrTime

current time string

Date/Time

$Today+1

tomorrow's date

Date/Time

$Today

today's date

Date/Time

$Today-1

yesterday's date

Date/Time

$Today-2

day-before-yesterday's date

Date/Time

$Today-3

day-before-the-day-before-yesterday's date

Date/Time

$Week

day-a-week-ago date

Date/Time

$Week-1

day-two-weeks-ago date

Date/Time

$Month

day-starting-current-month date

Date/Time

$Month-1

day-starting-previous-month date

Date/Time


FM_CronTime

The FM_CronTime token specifies an action to take at a specific time of day. It is the condition part of a trigger, and must have an FM_Action associated with it. For example:
FM_CronTime Report_Day 0500 Daily Batch_Day
 

This specifies that the daily report should be run at 5 a.m. (0500 hours).

The corresponding action token might look like the following:
FM_Action Batch_Day /usr/nr/bin/sap/ctl_batch_report.sh DAY $Today-1 $TimeStamp
 

FM_DirFiles

The FM_DirFiles token specifies the maximum number of files that a holding directory can hold before an action is triggered. It is the condition part of a trigger, and must have an FM_Action associated with it. For example:
FM_DirFiles Oracle_Load 1 /usr/nr/var/new DBLoad1
 

This specifies that the DBLoad1 action should be triggered when the number of files in /usr/nr/var/new reaches 1.

The corresponding action token might look like the following:
FM_Action DBLoad1 DBLoad $FileOldest
 

FM_DirSize

The FM_DirSize token specifies the maximum size a directory can grow to before an action is triggered. It is the condition part of a trigger, and must have an FM_Action associated with it. For example:
FM_DirSize TRAP_New 50000 /usr/nr/var/new Trap_New
 

This specifies that the Trap_New action should be triggered when the files in /usr/nr/var/new total 50,000 bytes.

The corresponding action token might look like the following:
FM_Action Trap_New /usr/nr/bin/sap/ctl_dump.sh $DirPath NEWLOG log.*
 

FM_DirUsed

The FM_DirUsed token specifies a threshold of disk usage, that when met, triggers an event. It is the condition part of a trigger, and must have an FM_Action associated with it. For example:
FM_DirUsed NOTIFY_Urgent 95 /usr/nr/var/dump Notify_Urgent
 

This specifies that the Notify_Urgent action should be triggered when the /usr/nr/var/dump directory reaches 95 percent capacity.

The corresponding action token might look like the following:
FM_Action Notify_Urgent /usr/nr/bin/sap/ctl_notify.sh $DirPath $DirUsed $Notify1 URGENT
 

FM_IdleTime

The FM_IdleTime token specifies an action to take after a specified amount of time passes. It is the condition part of a trigger, and must have an FM_Action associated with it. For example:
FM_IdleTime Purge_Dump /usr/nr/var/dump Purge
 

The corresponding action token might look like the following:
FM_Action Purge /usr/nr/bin/sap/custom_purge.sh $DirPath
 

Notice that the directory specified on the FM_IdleTime token (/usr/nr/var/dump) gets passed to the FM_Action token as $DirPath.

LogFileMask

The LogFileMask token specifies that part of the log filename that comes before the timestamp. The default is "log.". For example, log files with this mask would have the following naming convention: log.<timestamp>.

LogFilePathDump

The LogFilePathDump token specifies the directory where log files are sent for purging. The default is /usr/nr/var/dump.

LogFilePathIPLog

The LogFilePathIPLog token specifies the directory where new IP log files are written to. The default is /usr/nr/var/iplog.

LogFilePathNew

The LogFilePathNew token specifies the directory where new log files are written to. The default is /usr/nr/var/new.

LogFilePathTmp

The LogFilePathTmp token specifies the temporary directory where log files from /usr/nr/var/new are pulled to. The default is /usr/nr/var/tmp.

LogFilePathVar

The LogFilePathVar token specifies the root directory for log file handling. The default is /usr/nr/var.

NotifyInterval

The NotifyInterval token specifies how often to send a notification while the condition of the event remains true. For example, the following sets the interval to every 20 minutes while the condition is still true:
NotifyInterval 20
 

NotifyPerson

The NotifyPerson token specifies which e-mail address should receive notifications from sapd on various events.

NotifyPerson2

The NotifyPerson2 token specifies a second e-mail address that should receive notifications from sapd on various events.

PollingDelay

The PollingDelay token specifies how quickly sapd evaluates the triggers. Valid values range from 1 to 9, which, when multiplied by 10, provide a number of seconds from 10 to 90 between cycles. The lower the number, the faster sapd operates.

smid.conf

The smid.conf file is the configuration file for the smid daemon, which passes information to the Director nrdirmap application for display within the HP OpenView user interface.


FilenameOfError

The FilenameOfError token specifies the filename used for recording errors in /usr/nr/var. For smid, the default is /usr/nr/var/errors.smid.

DupDestination

The DupDestination token defines duplicate destinations for NetRanger events. This token allows a Director system to forward event information onto other services and systems. In the following example, events, commands, and errors of level 1 and above are forwarded onto loggerd. This allows the Director to monitor and log events based on a single Sensor data stream. This in turn, helps reduce the amount of network traffic a Sensor must transmit to a Director. Instead of having to transmit two identical (but separate) data streams to director1.cisco, the Sensor is able to send a single stream that is duplicated on the Director platform.
DupDestination director1.cisco loggerd 1 ERRORS,COMMANDS,EVENTS
 

As the next example shows, this token can also be used to forward events onto another Director system. In this case, however, only events of level 2 and above are forwarded.
DupDestination director2.cisco smid 2 ERRORS,COMMANDS,EVENTS,IPLOGS

/usr/nr/skel---Basic UNIX Configuration Files

This directory contains basic UNIX configuration files (such as .profile) that are required to configure remote login accounts.

/usr/nr/tmp---Sockets

This is the directory where sockets are created by the different daemons. The names of these sockets are dictated by the parent daemon. postofficed creates sockets with names such as mailbox.packetd and mailbox.configd. configd creates sockets with names such as socket.command.

/usr/nr/var---Log Files

This is the default location for all of the log files generated by loggerd and error files for all of the applications listed in the /usr/nr/etc/daemons file.

This section discusses the following topics:

Event Logs

Event logs are ASCII files written to the /usr/nr/var directory with the naming convention of log.YYYYMMDDHHMM. By default, level 2-5 events are written to event logs on a Director system, and low-level 1 events are written to an event log on the Sensor system. Log files capture data on alarms, command, and errors.

Event alarm data are unique because the record format contains optional as well as fixed components.

Fixed alarm data include the following information:

The optional data field contains information that cannot be described by the fixed portion of the alarm record format. This information may be a string associated with an event, or context data that consists of a snapshot of incoming and outgoing TCP traffic (a 256-byte maximum in both directions).

For example, a typical line written to a log file would look like the following:

    4,1025294,1998/04/16,16:58:36,1998/04/16,11:58:36,10008,11,100,OUT,OUT,1,2001,0,TCP/IP,10.1.6.1,10.2.3.5,0,0,0.0.0.0,
     
    

Each comma-delimited field contains different data. The first field indicates what kind of record was logged. Table 7 maps a log file's initial field with its corresponding record type.


Table 7: Log File Initial Field Reference Values
Field Value Record Type

0

Default

1

Command

2

Error

3

Command Log

4

Event

5

IP Log

6

Redirect

In the previous example log record, 4 denotes an Event record. Table 8 provides a reference for the rest of the fields in the sample Event record.


Table 8: Log File Field Reference Values
Sample Field Value Field Type

4

Record Type

1025294

Record ID

1998/04/16

GMT Datestamp

16:58:36

GMT Timestamp

1998/04/16

Local Datestamp

11:58:36

Local Timestamp

10008

Application ID

11

Host ID

100

Organization ID

OUT

Source Direction

OUT

Destination Direction

1

Alarm Level

2001

SigID

0

SubSigID

TCP/IP

Protocol

10.1.6.1

Source IP Address

10.2.3.5

Destination IP Address

0

Source Port

0

Destination Port

0.0.0.0

Router IP Address

Two other types of records, Error and Command Log, are similar in structure to the Event record. Both of these record types have the same first eight fields contained in Event records (Record Type, Record ID, GMT Date and Timestamp, Local Date and Timestamp, Application ID, Host ID, and Organization ID).

An Error record type has a ninth field denoting the actual Error String generated by a service. The Command Log record type also contains fields for the source Application ID, Host ID, and Organization ID, as well as the Command String. In both cases, you will have a complete record of errors and commands.

IP Session Logs

IP Session logs capture all incoming and outgoing TCP packets associated with a specific connection, and therefore contain binary data. They are written to a Sensor's /usr/nr/var/iplog directory with the naming convention of iplog.source_IP_address.

In addition to detecting attack signatures, sensord and packetd are able to monitor the traffic associated with a specific type of attack. For example, sensord can be configured to monitor all of the packets associated with an IP spoof. sensord or packetd creates a separate log file in /usr/nr/var/iplog for each of these monitoring sessions. The name of each session log file is based on the IP address of the attacking host (for example, iplog.10.145.16.152).

There is a performance penalty associated with the logging of context data. DMP provides two options for controlling overhead:

Context data is not loaded if this variable is set.

By default, level 1 Event and IP Session logs are left on a Sensor until they are required. This prevents the relatively large amounts of data associated with these types of events from impeding NetRanger communications during periods of network load.

Even though the DMP is designed to transfer NetRanger data into industrial strength databases, both types of data are initially written to flat files for two reasons: speed and fault tolerance. Data can be written to a flat file much faster than to a database, and access to flat files is guaranteed as long as the host system is operational. Databases, on the other hand, are subject to unpredictable load, and contain too many access layers to be truly fault tolerant---if the database is down, there are no places to turn.

Related Documentation

Use this document in conjunction with the following NetRanger documents:

Cisco Connection Online

Cisco Connection Online (CCO) is Cisco Systems' primary, real-time support channel. Maintenance customers and partners can self-register on CCO to obtain additional information and services.

Available 24 hours a day, 7 days a week, CCO provides a wealth of standard and value-added services to Cisco's customers and business partners. CCO services include product information, product documentation, software updates, release notes, technical tips, the Bug Navigator, configuration notes, brochures, descriptions of service offerings, and download access to public and authorized files.

CCO serves a wide variety of users through two interfaces that are updated and enhanced simultaneously: a character-based version and a multimedia version that resides on the World Wide Web (WWW). The character-based CCO supports Zmodem, Kermit, Xmodem, FTP, and Internet e-mail, and it is excellent for quick access to information over lower bandwidths. The WWW version of CCO provides richly formatted documents with photographs, figures, graphics, and video, as well as hyperlinks to related information.

You can access CCO in the following ways:

For a copy of CCO's Frequently Asked Questions (FAQ), contact cco-help@cisco.com. For additional information, contact cco-team@cisco.com.


Note If you are a network administrator and need personal technical assistance with a Cisco product that is under warranty or covered by a maintenance contract, contact Cisco's Technical Assistance Center (TAC) at 800 553-2447, 408 526-7209, or tac@cisco.com. To obtain general information about Cisco Systems, Cisco products, or upgrades, contact 800 553-6387, 408 526-7208, or cs-rep@cisco.com.

Documentation CD-ROM

Cisco documentation and additional literature are available in a CD-ROM package, which ships with your product. The Documentation CD-ROM, a member of the Cisco Connection Family, is updated monthly. Therefore, it might be more current than printed documentation. To order additional copies of the Documentation CD-ROM, contact your local sales representative or call customer service. The CD-ROM package is available as a single package or as an annual subscription. You can also access Cisco documentation on the World Wide Web at http://www.cisco.com, http://www-china.cisco.com, or http://www-europe.cisco.com.

If you are reading Cisco product documentation on the World Wide Web, you can submit comments electronically. Click Feedback in the toolbar and select Documentation. After you complete the form, click Submit to send it to Cisco. We appreciate your comments.





hometocprevnextglossaryfeedbacksearchhelp
Posted: Tue Jul 18 13:15:01 PDT 2000
Copyright 1989-2000©Cisco Systems Inc.