LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-15-2013, 10:25 AM   #1
snowmizer
LQ Newbie
 
Registered: May 2013
Posts: 3

Rep: Reputation: Disabled
Snortd Syslog Events Not Forwarding


I have Snort set up on CentOS6, configured to forward to a syslog server:

output alert_syslog: host=x.x.x.x:514, LOG_LOCAL7 LOG_INFO

rsyslog.conf

*.* @x.x.x.x:514

Where x.x.x.x is my syslog server

When I start Snort via the command line everything forwards fine to my syslog server

snort -c /etc/snort/snort.conf -i eth1

However, when I run /etc/init.d/snortd start my events don't forward to the syslog server.

I have tried disabling SELinux and no luck.

What am I missing?

Thanks.
 
Old 05-15-2013, 11:51 PM   #2
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
I am not sure if you allow the relevant ports for this to work.If you were doing this without "Snort" then you would have to allow port 514 in iptables.Not sure what the port is for snort.
 
Old 05-16-2013, 01:38 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
- Does Snort actually run from the SysV init script?
- Are the command lines the same?
- What does Snorts log file say?
- What does /var/log/audit/audit.log or /var/log/messages say?
 
Old 05-16-2013, 07:48 AM   #4
snowmizer
LQ Newbie
 
Registered: May 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
After working on this further I discovered that I was seeing events from cron and the other parts of the system. I just am not seeing the local7 events from my test rule. I have been able to figure out that it appears to be something with the SYSLOG variable in /etc/sysconfig/snort. It is set to /var/log/messages. When I looked in this file I was seeing my events (even though I've got the syslog server specified in /etc/snort/snort.conf and /etc/rsyslog.conf). It's as though /etc/init.d/snortd is ignoring the syslog server variable I'm wanting to use. I also noticed that if I didn't put the -s switch in the /etc/init.d/snortd on the command that starts snort nothing is forwarded.

Thanks.
 
Old 05-16-2013, 04:03 PM   #5
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
If you start Snort from the command line then you build the complete command line yourself. OTOH if you start Snort from its /etc/rc.d/init.d/snort init script it may take default values from that plus those added to /etc/sysconfig/snort (if any). It would be best to review settings in both files and compare the actual command line with how you would run it yourself.
 
Old 05-17-2013, 07:44 AM   #6
snowmizer
LQ Newbie
 
Registered: May 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
I went through the /etc/sysconfig/snort file and matched what I was seeing when I issued the "ps -ef | grep snort". That's where I saw that it wasn't using the -s switch. I added that and then it was logging to the value for "SYSLOG" from /etc/sysconfig/snort instead of the values from /etc/snort/snort.conf and /etc/rsyslog.conf. It didn't seem to matter how I modified the command in /etc/sysconfig/snort so I just renamed the run scripts for snortd and added the commands I needed to rc.local since I had a timing issue with when eth1 was up and snort was trying to start. That appears to work.

Thanks for the reply.
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to configure for forwarding "sudo" syslog events in user specified file? nagendrar Linux - Newbie 3 10-27-2011 04:55 AM
syslog events to identify particular issue drManhattan Linux - Newbie 1 05-24-2011 11:31 PM
syslog-ng marking all forwarded events as kern.emerg neocontrol Linux - Server 1 09-01-2010 03:51 PM
redirect events from syslog server junust Linux - General 1 08-10-2009 05:38 AM
Syslog fail events! andykerouac Linux - General 3 01-29-2004 05:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration