CPUG

The Check Point User Group

A Resource For The Check Point Community.  Fast.  Useful.  Independent.

1. CCSA/CCSE One-Week Dual-Certification Training Course with CPUG in San Francisco!
    Courses Starting 12/8, (2009) 1/19, 2/9, 3/9, 4/6, 5/4, 6/8, 7/6, 8/3.
2. Join Us On LinkedIn - We now have a CPUG group.


Go Back   CPUG: The Check Point User Group > Check Point Firewall-1/VPN-1 And Related Products > SmartView Tracker/Logging And Alerting
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 2005-08-13
Administrator
 
Join Date: 2005-08-11
Location: San Francisco, CA
Posts: 582
Rep Power: 10
BarryStiefel has disabled reputation
Default Logging to Syslog?

Logging to Syslog?



To log specific events to syslog, I use 'User-Defined' logging for this. My user-defined program (defined in the Rulebase Properties, Logging and Alerting tab) is "/usr/ucb/logger -p daemon.notice". The path to the 'logger' utility will vary on OS.

Another alternative is to log everything to syslog. You can do this with the command:

$FWDIR/bin/fw log -f 2>>/var/adm/fw-log.log | /bin/logger -p local5.info > /dev/null 2>&1 &

This command runs in the background and logs everything to syslog. Note that it might be best to put this into a boot script after FireWall?-1 loads so that everything is dumped to syslog.

2002-Nov-27 01:03 dwelchATphoneboyDOTcom

I´m working with a solution for Windows, using WSH (Windows Script Host). It needs WSH version 5.6, that, if needed, you can get at: msdn.microsoft.com/scripting.

The script is:

Set objShell = CreateObject?("WScript.Shell") Set objWshScriptExec = objShell.Exec("fw log -ft -l -n") Set objStdOut = objWshScriptExec.StdOut While Not objStdOut.AtEndOfStream strLine = objStdOut.ReadLine If InStr?(strLine,"drop") Then ObjShell?.Run "c:klogklog -h 10.0.0.1 -L Alert -F User -m """ & strLine & """", 0, false End If Wend

The idea is to run the "fw log" command from within the script, so it can send the StdOut? to a variable (strLine).

Now, you will need Kiwi Logger (KLog), a console-mode utility that send text messages to a syslog daemon. Get it at: http://www.kiwisyslog.com/products.htm

You will use the variable strLine as the message (-m) option in KLog. All you have to do now is save this script as "anything.vbs" in the FW /bin folder and call it like this:

cscript anything.vbs

As you can see from the script, you will be able to filter any kind of text before sending it to the Syslog. In the case above, only dropped packets will be sent. The - ObjShell?.Run "command", 0, false - avoids the zillion klog shell windows that would be opened otherwise. The performance of it doesn´t seem to affect the processor. Hope this helps...

-- GuyR - 06 Jan 2004

FAQForm FAQs.Class: LoggingAndAlertingFAQs FAQs.OS: FAQs.Version:
Reply With Quote
  #2 (permalink)  
Old 2006-05-03
Junior Member
 
Join Date: 2006-03-02
Posts: 6
Rep Power: 0
gorhon has an average reputation (10+)
Default Re: Logging to Syslog?

hello,

Thanks this batch file. but not work. please write line and line.

thank you.
Reply With Quote
  #3 (permalink)  
Old 2006-09-01
Junior Member
 
Join Date: 2005-09-26
Posts: 19
Rep Power: 0
herrmadbeef has an average reputation (10+)
Default Re: Logging to Syslog?

any news about this

thanks
Reply With Quote
  #4 (permalink)  
Old 2006-09-01
Administrator
 
Join Date: 2005-08-11
Location: San Francisco, CA
Posts: 582
Rep Power: 10
BarryStiefel has disabled reputation
Default Re: Logging to Syslog?

Sorry, this was one of the original FAQ's from PhoneBoy and I copied it over verbatim. I don't have any more information on it.
Reply With Quote
  #5 (permalink)  
Old 2006-09-06
Junior Member
 
Join Date: 2005-09-26
Posts: 19
Rep Power: 0
herrmadbeef has an average reputation (10+)
Default Re: Logging to Syslog?

hey guys i just found this info i hope it could help

i havent test it yet cause i dont have atm a virtualmachine or anything look like

but if some1 try it before i do let me know

Sending FireWall-1 logs to a remote ‘syslog’ server
Management server on Nokia/SecurePlatform/Solaris – NG FP3/AI


1) On the management station, redirect syslog messages to the external syslog server.

If management station is Nokia:
a) Log in to the Voyager web interface on the management station, using a browser.
b) Click the ‘Config’ button, and then click the ‘System Logging’ link.
c) In the ‘System Logging’ page, enter the IP of the remote syslog server in the “Add new remote IP address to log to” field, and press the ‘Apply’ button.
d) In the ‘System Logging’ page, click the drop-down menu labeled ‘Add Security Level’, and choose ‘Info’ and press the ‘Apply’ Button.

(note – slight variations in the names of buttons and fields in Voyager might happen, depending on the IPSO OS version)


If management station is SecurePlatform/Solaris:
a) Edit /etc/syslog.conf, on the management station, and add the following line at the end of the file:

local5.info @hostname

where ‘hostname’ is the resolvable hostname of the remote syslog server, or the IP of the syslog server.

b1) SecurePlatform - Execute ‘service syslog restart’.
b2) Solaris – Execute ‘/etc/init.d/syslog stop’ and ‘/etc/init.d/syslog start’.





2) On the management station, the FireWall-1 log entries need to be directed to the local syslog daemon, so it will relay it to the external syslog server.

a) Edit $FWDIR/bin/fwstart, and add the command
$FWDIR/bin/fw log –t –f –l | logger -t FireWall-1 -p local5.info &
as the second line in the file.

b) Run ‘cpstop ; cpstart’ on the management station.


Provider-1 Solaris

1) Follow step #1 in the previous section
2) On the Provider-1 Solaris machine, edit $MDSDIR/scripts/fwstart, and add the command
$FWDIR/bin/fw log -t -f -l | logger -t "CMA $MSP_SOMEIP_ADDR" -p local5.info &
as the second line in the file.









Limitations:
1) After a ‘cpstop’, the ‘fw log’ command will not exit, and will continue running. Performing ‘cpstart’ afterwards will result several ‘fw log’ commands running simultaneously.
2) After an upgrade of the FireWall-1 on the management station, the changes in step #2 must be repeated.
3) After an upgrade of the OS on the management station, the changes in step #1 must be repeated.
4) Note - the ‘syslog’ protocol is not secured and is not encrypted. The ‘syslog’ packets can be captured and analyzed. It is recommended to pass the ‘syslog’ traffic to the ‘syslog’ server over a secure medium (dedicated interface/VLAN, IPSec tunnel, etc).
Reply With Quote
  #6 (permalink)  
Old 2006-09-06
Junior Member
 
Join Date: 2005-09-26
Posts: 19
Rep Power: 0
herrmadbeef has an average reputation (10+)
Default Re: Logging to Syslog?

Solution: How to make FireWall-1 log to a syslog server (55.0.6739477.2672094)
To log specific events to syslog, use a 'User-Defined' logging. This is defined in the Rule Base Properties, Log and Alert tab. An example is"/usr/ucb/logger -p daemon.notice"

Another alternative is to log everything to syslog. To have all logs go straight to the syslog server run
$FWDIR/bin/fw log -f 2>>/var/adm/fw-log.log | /bin/logger -p local5.info > /dev/null 2>&1 &

This command runs in the background and logs everything to syslog. Note that it might be best to put this into a boot script after FireWall-1 loads so that everything is dumped to syslog.


Problem Description
How to make FireWall-1 log to a syslog server



Problem Environment:
Firewall-1

UNIX

Solaris
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT -7. The time now is 18:31.


Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0