-->
LogMon Guide |
document created on 14 3 2006 document modified on 21 July 2006 |
LogMon provides for centralized log monitoring and report generation system
for various security devices being monitored.
LogMon caters to various category of security devices and various products within same same category
LogMon uses extensible architecture to collect logs, process it and prepare reports.
LogMon can be easily extended to add more security devices in future
Reports can be generated on a daily and weekly basis.
Devices from which logs are collected
Architecture of LogMon.
LogMon Engine
LogMon's working can be broadly divided following categories
LogMon operator console provides full graphical control on LogMon server. Here is the explanation how it does that Security devices like Symantec antivirus,IWSS,IMSS and RealSecure IDS are Windows machine. LogMon uses Net::RDEP Module for collecting logs from Cisco IDS machine Logs of PIX FireWall are collected using syslog Logs of CheckPoint FireWall are collected using utility called 'fw1-loggrabber'
LogMon Operator Console
It acts as dumb terminal for LogMon i.e. LogMon can be accessed from
operator console with GUI. operator console creates exports graphics from the
LogMon Server to display the data on the operator's console. Facility like
XlogMaster to view Log files dynamically as they are getting generated can
be used from operator console and user does not need to access LogMon server
physically though actual processing is done at LogMon server only
Working of LogMon.
LogMon's working can be divided into two basic categories
Collecting Logs
Collecting logs using TailLog Client
these devices logs in a log file,in a particular directory specified in the configuration.
LogMon uses a client named "TailLog Client" which can monitor the specified directory
and look for latest created file,this is the file in which devices are logging messages
TailLog Client uses a
configuration
file. [29]
where many parameters can be specified,
TailLog a utility is written in Visual Basic.
explanation for the same is given in 'Using LogMon' section.
Collecting logs using Net::RDEP
This is a perl module which can fetch logs from Cisco IDS machine
details are given in 'Using LogMon' section.
Collecting logs using syslog
console of PIX FireWall provides a facility of sending logs to remote machine's syslog
with certain facility and level
LogMon receives logs from PIX FireWall with facility and level as local4.debug
using syslog log file are rotated periodically
Collecting logs using fw1-loggrabber
fw1-loggrabber fetches logs from CheckPoint machine using TCP connection.
fw1-loggrabber can be configured with needs. More about configuring fw1-loggrabber
can be found at 'Using LogMon' section.
logical picture of log collection on LogMon server
Pre-request from devices for collecting logs
for collecting logs using TailLog client
TailLog client must be properly configured on the device. see section configuring
TailLog client.
RealSecure IDS does not log into file by default, administrator must do this setting and
provide proper path to TailLog client to collect logs from RealSecure IDSS server
Cisco IDS logs are collected using Net::RDEP module running on LogMon server
IP address of LogMon server must be added in trusted host list in Cisco IDS server so
that query from LogMon server is served
Cisco PIX firewalls logs are collected using Syslog First Cisco PIX server must be
configured to send logs to remote server with appropriate facility and severity
LogMon runs daemons to process the log files collected and generates reports for those.
for the devices for which aggregation of report is possible for those
weekly reports are created by aggregating the daily reports thus saving system resources and time.
These reports are delivered to concern people using mail.
Mail delivery can be controlled using configuration files.
More about this can be found in 'configuring LogMon' section.
Log files consist of various logs of various severity but not all
the types of logs are taken into consideration while generating reports
Mentioned below are a few cases which support the above statement
LogMon monitors logs collected in real time and and generates alarms for suspicious event
LogMon GUI(Xlogmaster) can be used for looking at log files in real time.
more about Xlogmaster is given in 'Using Xlogmaster' section.
Logs collected are moved to NAS on periodic basis.
LogMon is provided with NFS mount point. moving log file on NAS helps
to keep disk utilization low.
Using of LogMon.
LogMon comes with perl scripts which provides command lines
for collecting logs and producing reports for various devices
as CiscoPix FireWall logs are collected using syslog log
collection will start at system start.
For the daily reports time duration will be taken previous days 24 hours.
i.e. if fired on 24 march 2006 then time duration taken will be from "23 march 2006 00:00:00" to "23 march 23:59:59"
For weekly reports duration will be from "17 march 2006 00:00:00" to "23 march 2006 23:59:59"
options like to,cc,bcc and attach can take multiple values and should be provided in comma
separated form
unspecified options value will be taken from configuration file
more will be in 'Configuring LogMon' section
mail.pl is mainly used for sending reports and alerts to concern person
Configuring of LogMon.
Configuration directory contains following files
Click on a link to view sample file.
Here is the details about each file
User can specify value of these parameter in this file or in command line.
Unspecified parameters value will be taken from this file.
Using Xlogmaster.
Xlogmaster is a graphical utility to monitor logs as they are coming
and take required action on occurrence of certain events
more about Xlogmaster in tutorial [45]
System Services and Packages Used
LogMon uses some system services like
As described in 'Working of LogMon' section logs of Cisco PIX FireWall are collected
using Syslog
as this logs are coming from remote machine some changes are required in file named
'/etc/sysconfig/syslog'
default syslog configuration will not be able to receive logs from remote machine to do such provision
file '/etc/sysconfig/syslog' needs to be changed
initially line will be as shown below
SYSLOGD_PARAMS=""
changing it to
SYSLOGD_PARAMS="-r"
will enable remote logging and system will be able to receive logs sent by remote machine
One of the important thing in process of log collection and report generation
is time synchronization
NTP (Network Time Protocol) is utility to synchronize two Unix machine
adding following entries in file '/etc/ntp.conf' of any device machine will make device
machine to refer time from LogMon machine periodically
server <LogMon machine IP>
where as LogMon itself refers time from Time Server in USA
entries of file '/etc/ntp.conf' of LogMon looks like this
server 129.6.15.28 server 129.6.15.29 server 132.163.4.101 server 132.163.4.102
To synchronize MS-Windows machine with LogMon machine LogMon uses software called 'AboutTime'
Giving LogMons IP as Network Time Server will make Windows machine to refer time from LogMon
![]() Here is a typical client session. In this example, AboutTime reports a 3 millisecond difference between the local computer's clock and the network time server. |
![]() Here is AboutTime's own four-server "traffic" display. It shows that one of the server protocols is unavailable (red), and another is responding to a request (yellow). |
Perl is the programming language used for writing scripts. These scripts runs as daemons
and collects logs from various devices and generate reports.
www.perl.com [46] is official perl home page run by O'Reilly.
FW1-Loggrabber is a command-line tool to grab log files from Checkpoint FW-1 remotely using
Checkpoints LEA (Log Export Api), which is one part of Checkpoints OPSEC API.
More information can be found at
fw1-loggrabber site [47]
TailLog is a command line utility to collect logs from remote MS-Windows machine.
TailLog can monitor a folder in which log files resides and send UDP packets as logfile is
growing, on desired machine and port.
Binary and source code are included with this documentation CD.
Remote Data Exchange Protocol (RDEP) is a protocol designed by Cisco Systems in order to
exchange Intrusion Detection System events, configuration, log, and control messages. This
protocol is supported at least the Cisco IDS version 4.0.
This implementation only supports the collection of events.
The events are retrieved in a format, also developed by Cisco, referred to as Intrusion
Detection Interaction and Operations Messages (IDIOM), which is an XML document. A simple
module for handling these documents is included with this distribution (XML::Idiom).
RDEP supports two methods for retrieving events: an event query and an event
subscription. Both methods use SSL to query the RDEP server and retrieve the events. The
event query method will retrieve all the events in a given time range. No connection is
maintained in anyway. The event subscription, however, does maintain a connection and will
support multiple "gets" to continue to retrieve events as they are available.
See www.cisco.com [48]for more information in RDEP or IDIOM.
Xlogmaster allows you to monitor all your log files and all
devices that allow being read by cat. Furthermore it supplies
several filters that will do things from raising/hiding lines in the
text display to starting programs to send you a paging message about a
possible security breach.
If used wisely Xlogmaster can make it very easy to keep track of
everything that happens on your system and it can increase your systems
security by quite a lot.
Directory Structure and Naming.
Directory Structure.
as described in 'Configuring LogMon' section 'Top Level Directory' can be specified
this is directory in which all directory/files related to LogMon resides
all configuration files used should be in directory
<Top Level Directory>/CONFIGURATION/
all scripts used should be in directory
<Top Level Directory>/log_analysis/codes/aggregation_codes/ or
<Top Level Directory>/log_analysis/codes/report_generation_codes/
depending on kind of script it is
all Logs Collected should get rotated in
<Top Level Directory>/ROTATED/<class>/<device>/<year>/<month>
all reports generated should go in
<Top Level
Directory>/REPORTS/<class>/<device>/<DAILY>/<year>/<month>
or
<Top Level Directory>/REPORTS/<class>/<device>/<WEEKLY>/<year>/
Naming Convention.
All log files rotated should have name like
<class>_<device>-<year><month><day>-<hour><min><sec>
e.g.
ids_cisco-20060612-000003
which means that this is a file of device Cisco of class IDS and was rotated on 00:00:03 of
12 June 2006 thus will have logs of 11 June 2006
Daily report of IMSS antivirus generated for 4 march 2006 will have name
av_imss-20060304
Weekly report of IMSS antivirus generated for 4 march 2006 will have name
av_imss-2006-9
as report is for 9th week of year 2006
Making Dumb Terminal.
XDMCP is the protocol used for making dumb terminal
XDMCP stands for "X Display Manager Control Protocol" and is a network protocol.
It provides a way of running the X-Terminal to run on your PC (or MAC)
and it uses the X Server to provide a client/server interface between display hardware
(the mouse, keyboard, and video displays) and the desktop environment
while also providing both the windowing infrastructure and a
standardized application interface (quoted from XFree86 Project home page).
The X-Terminal can be displayed with an individual window or multiple windows,
based on your X window system's software capabilities and setup.
there is Office machine
there is Home machine
you want to make Home machine is dumb terminal for Office machine
steps are as follows
edit file "/etc/opt/kde3/share/config/kdm/kdmrc"
[xdmcp]
Enable=true
port=177
edit file "/etc/X11/xdm/xdm-config"
Comment out this line
"DisplayManager.requestPort: 0"
and make it like
"!DisplayManager.requestPort: 0"
edit file "/etc/inittab"
add line
7:123:respawn:/usr/X11R6/bin/X -query [Office_ip] >/var/tmp/xserver.log 2>&1 tty7
at proper place number 7 may
now you should see login prompt of Office machine on your Home machine
if not, configure firewall of Office machine to allow request from Home machine
Log Archival.
All the the logs collected and reports gnerated are archived at NAS
(Network Area Storage Device) at periodic intervals.
thus making it easy to maintain the free disk space on LogMon server.
Shutting down and Starting LogMon.
LogMon can be turned down using following comamnd
$>shutdown -h now
to restart LogMon server use fillowing comamnd
$>shutdown -r now
to run this command super user privilege are required.
User should close all LogMon GUI (Xlogmaster) application before putting LogMon down.
All the services e.g. NTP, Syslog, LogMon daemon and Xlogmaster should automatically
start on startup of LogMon
few tests are required to check this. More about this in 'How To/Trouble Shooting' section
get the TailLog binary from this CD or any other resources
which include other machines on which TailLog is running
prepare a folder on disk containing these three files
1. TailLog.exe
2. TailLog.cfg
3. TailLog.bat
bat file should do two things
1. go to folder containing TailLog.exe and TailLog.cfg
cd <Folder_name>
2. fire command to start TailLog
TailLog.exe TailLog.cfg
now add this bat file in 'system Scheduled Tasks' to run on startup using standard procedure
configure TailLog to run forever in scheduled task (default is to run for 72
hours).
now TailLog is ready to run on startup. To start TailLog now right click on TailLog
entry in Scheduled Task list and select 'run'
Configuring TailLog
edit the TailLog.cfg according to need
Parameter | description |
---|---|
version | version of TailLog Currently 1.5 |
watchDirName | Folder in which Log files resides on server |
tag_name | something to identify which device e.g. ids_rs for RealSecure IDS |
pipe_flag | give 1, to enable pipeLog mode |
command_to_execute | in pipeLog mode this command will be executed and output will be sent to server |
file_pattern | extention of log files e.g. *.log |
diagnostic_tag | any thing but must start with '###' |
diagnostic_flag | keep 1, to enable diagnostic messages on,recommended 1 |
skip_flag | keep 1, to get current entries, recommended 1 |
check_interval | time interval to check update in log file, recommended value is 5 |
send_attempts | TailLog will try to send a packet for maximum this times, recommended value is 100 |
attempts_for_mark | number of times to check standard output before sending mark signal,used in pipeLog mode |
send_summary_interval | Summary packet will be sent if no updates are found for this many seconds, recommended value is 20 |
ServerName | IP of LogMon Server |
ServerPort | Port number on which to send packets,make sure that one instance of 'logrotate.pl' is listening on this port |
SleepInterval | in milliseconds,time for which TailLog will sleep after sending last packet,recommended value is 2000 |
Debug | Flag to log any debugging message from TailLog.keep 0 |
file 'mswinsck.ocx' is included with TailLog source and binary.
copy this file in 'C:\windows\system32\'
now go to command prompt and register this ocx file by firing this command
C:\> regsvr32 C:\windows\system32\mswinsck.ocx
Get executable from this CD or download from
AboutTime Site [49]
double click on .exe file and installation will start automatically.
any further details can be found at this site.
may be logging is stopped for this device
if the device is windows machine (IMSS, IWSS, Symantec, IDS RS) check whether
TailLog client is running
using following procedure
1. Right click on empty area of task bar
2. click on Task Manager
3. click on Processes
4. select checkbox to see processes from users
5. see if TailLog is present in that list
6. if not restart the TailLog using Scheduled Task.
if device is checkpoint FireWall
then restart the loggrabber using this command.
$> fw1_restart.pl
this script fired automatically once a day to reestablish the connection so that connection
with CheckPoint FireWall at most one day old.
see how many servers(IP) alert is about
there are total four NTP servers from which LogMon is taking time
if it is about 1,2 or 3 servers then this alert can be treated as informational
alert
See if internal mail system is working fine
if yes then check the SMTP servers IP given in mail.conf file in CONFIGURATION
directory.
more detailed information can be found at logfile at LOGMON_LOGS directory,mail.log
file
if mail was sent from LogMon this file must have entry about mail sent details.
see if any entries were there in log file for that day for that device.
if log file consist of only diagnostic messages (for Windows based machine)
then it might be the case that TailLog is observing wrong Logfile or wrong
Directory
for any other device you should receive 'Log file not updated' alert before blank
report mail
to check NTP, fire this command on console
$> /etc/init.d/xntpd status
result should show you 'running'
to check Syslog, fire this command on console
$> /etc/init.d/syslog status
result should show you 'running'
you need superuser privilege to check this
if result is 'unused' fire command like
$> /etc/init.d/xntpd start
$> /etc/init.d/syslog start
to see LogMon daemon running or not best method will be to see whether all log files
are updating or not
another method is see see file 'device_port.conf' in 'CONFIGURATION' directory
which contains port numbers on which 'logrotate.pl' is listening now fire command
$> fuser <port_no>/udp
if this command shows you some process ID then it means that port is in use. To see
which process is using this port fire this command
$> ps -p <PID>
this command should show 'logrotate.pl' in command column
if not then that it means that log collection for this port's device is stopped
and you should receive alert from LogMon saying 'Log file not updated'
following command will show the disk space used
$> df -kh
following command will show systems performance in real time
$> top
use q to exit
TailLog pseudo code is provided with source of TailLog Client included in this CD
click
here [50]
to view TailLog pseudo code
IMSS | IWSS | Symantec | CheckPoint R54 |
CheckPoint R55 |
Cisco PIX | RealSecure | Cisco IDS | |
access-group | - | - | - | - | - | Y | - | - |
action | Y | Y | Y | Y | Y | Y | - | - |
date_time | Y | Y | Y | Y | Y | Y | Y | Y |
dest_addr | Y | Y | Y | Y | Y | Y | Y | Y |
dest_nat_addr | - | - | - | Y | Y | - | - | - |
dest_port | - | - | - | Y | Y | Y | Y | Y |
direction | - | - | - | Y | Y | Y | - | - |
facility | - | - | - | - | - | Y | - | - |
file | Y | Y | Y | - | - | - | - | - |
interface | - | - | - | Y | Y | Y | - | - |
intruder_addr | - | - | - | - | - | - | Y | Y |
intruder_port | - | - | - | - | - | - | Y | Y |
method | - | Y | - | - | - | - | - | - |
name | Y | Y | Y | - | - | - | Y | Y |
origin | - | - | - | Y | Y | - | - | - |
product | - | - | - | Y | Y | - | - | - |
protocol | - | - | - | Y | Y | Y | - | - |
reason | - | - | - | - | - | Y | - | - |
received_by | Y | - | - | - | - | - | - | - |
received_from | Y | - | - | - | - | - | - | - |
rule | - | - | - | Y | Y | - | - | - |
severity | Y | Y | Y | Y | Y | Y | Y | Y |
shunned_host | - | - | - | - | - | Y | - | - |
src_addr | Y | Y | Y | Y | Y | Y | Y | Y |
src_nat_addr | - | - | - | - | - | Y | - | - |
src_port | - | - | - | Y | Y | Y | Y | Y |
timezone_offset | - | - | - | - | - | - | Y | Y |
user_id | - | Y | - | - | - | - | - | - |
username | - | - | - | - | - | Y | - | - |
victim_addr | - | - | - | - | - | - | Y | Y |
victim_port | - | - | - | - | - | - | Y | Y |
Here is the description about each field
here are sample reports generated and log entries
click on link to view the file
IMSS | log file [51] | report file [52] |
IWSS | log file [53] | report file [54] |
Symantec | log file [55] | report file [56] |
Checkpoint R54 | log file [57] | report file [58] |
Checkpoint R55 | log file [59] | report file [60] |
Cisco PIX | log file [61] | report file [62] |
Cisco IDS | log file [63] | report file [64] |
RealSecure IDS | log file [65] | report file [66] |
Links:
[1] http://intranet.merceworld.com/node/194#What
[2] http://intranet.merceworld.com/node/194#Architecture
[3] http://intranet.merceworld.com/node/194#LogmonEngine
[4] http://intranet.merceworld.com/node/194#LogmonOS
[5] http://intranet.merceworld.com/node/194#Working
[6] http://intranet.merceworld.com/node/194#CollectingLog
[7] http://intranet.merceworld.com/node/194#ReportGen
[8] http://intranet.merceworld.com/node/194#RealTime
[9] http://intranet.merceworld.com/node/194#LogArchival
[10] http://intranet.merceworld.com/node/194#Using
[11] http://intranet.merceworld.com/node/194#Configuring
[12] http://intranet.merceworld.com/node/194#UsingXlogmaster
[13] http://intranet.merceworld.com/node/194#SystmService
[14] http://intranet.merceworld.com/node/194#Syslog
[15] http://intranet.merceworld.com/node/194#time
[16] http://intranet.merceworld.com/node/194#Perl
[17] http://intranet.merceworld.com/node/194#fw1-loggrabbber
[18] http://intranet.merceworld.com/node/194#TailLog
[19] http://intranet.merceworld.com/node/194#Rdep
[20] http://intranet.merceworld.com/node/194#Xlogmaster
[21] http://intranet.merceworld.com/node/194#DirStructureNaming
[22] http://intranet.merceworld.com/node/194#DirStruc
[23] http://intranet.merceworld.com/node/194#Naming
[24] http://intranet.merceworld.com/node/194#DumbTerminal
[25] http://intranet.merceworld.com/node/194#Archival
[26] http://intranet.merceworld.com/node/194#ShutdownStart
[27] http://intranet.merceworld.com/node/194#HowTo
[28] http://intranet.merceworld.com/node/194#Appendix
[29] http://intranet.merceworld.com/../src/Windows/TailLogClient/TailLog.cfg
[30] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/chkpt_ignore_pattern_file
[31] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/chkpt_r54_protected_ip_file
[32] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/chkpt_r55_protected_ip_file
[33] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/cisco_ids_severity_file
[34] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/device_port.conf
[35] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/error_constants
[36] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/false_positive_source_ip
[37] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/log_paths
[38] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/log_process_constants
[39] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/mail_conf
[40] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/name_for_ip
[41] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/pix_conf
[42] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/pix_conf_parent_file
[43] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/pix_errcodes
[44] http://intranet.merceworld.com/../src/Linux/LogMon/CONFIGURATION/rs_ids_severity_file
[45] http://intranet.merceworld.com/xlogtutorial.html
[46] http://www.perl.com
[47] http://sourceforge.net/projects/fw1-loggrabber/
[48] http://intranet.merceworld.com/www.cisco.com
[49] http://www.arachnoid.com/abouttime/
[50] http://intranet.merceworld.com/../src/Windows/Taillog_dec21/tailLog_pseudocode
[51] http://intranet.merceworld.com/../misc/sample-logs/av_imss
[52] http://intranet.merceworld.com/../misc/sample-reports/av_imss
[53] http://intranet.merceworld.com/../misc/sample-logs/av_iwss
[54] http://intranet.merceworld.com/../misc/sample-reports/av_iwss
[55] http://intranet.merceworld.com/../misc/sample-logs/av_symantec
[56] http://intranet.merceworld.com/../misc/sample-reports/av_symantec
[57] http://intranet.merceworld.com/../misc/sample-logs/fw_r54
[58] http://intranet.merceworld.com/../misc/sample-reports/fw_r54
[59] http://intranet.merceworld.com/../misc/sample-logs/fw_r55
[60] http://intranet.merceworld.com/../misc/sample-reports/fw_r55
[61] http://intranet.merceworld.com/../misc/sample-logs/fw_pix
[62] http://intranet.merceworld.com/../misc/sample-reports/fw_pix
[63] http://intranet.merceworld.com/../misc/sample-logs/ids_cisco.html
[64] http://intranet.merceworld.com/../misc/sample-reports/ids_cisco
[65] http://intranet.merceworld.com/../misc/sample-logs/ids_rs
[66] http://intranet.merceworld.com/../misc/sample-reports/ids_rs