LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-22-2009, 02:33 PM   #1
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Rep: Reputation: 50
Snort doesn't log to MySQL


I am running a Debian Lenny server and I just installed snort-mysql using apt.

I have configured snort to alert on ALL packages and it works, my /var/log/snort/alert file is full of messages. I have also followed the docs to set up the database for snort inside mysql, created the snort user and granted privileges. I ran the sql file that came with the snort package to setup all the tables inside the database and it seems to have worked.

Then I went into snort.conf and added the line "output database ..." with all the options (database name, user name, password) and I then restarted snort.

Problem is, I still get a lot of messages into the local log file so snort is working, but the 'event' table is empty (I figured it shouldn't?).

Is there a way to check if snort is even able to setup a connection to mysql? I tried to start snort manually in the console but there is no mention of mysql in the output.

Am I missing something?
 
Old 04-22-2009, 03:06 PM   #2
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by Ephracis View Post
I am running a Debian Lenny server and I just installed snort-mysql using apt.

I have configured snort to alert on ALL packages and it works, my /var/log/snort/alert file is full of messages. I have also followed the docs to set up the database for snort inside mysql, created the snort user and granted privileges. I ran the sql file that came with the snort package to setup all the tables inside the database and it seems to have worked.

Then I went into snort.conf and added the line "output database ..." with all the options (database name, user name, password) and I then restarted snort.

Problem is, I still get a lot of messages into the local log file so snort is working, but the 'event' table is empty (I figured it shouldn't?).

Is there a way to check if snort is even able to setup a connection to mysql? I tried to start snort manually in the console but there is no mention of mysql in the output.

Am I missing something?
You should see mysql comments when you run snort manually. If you aren't, this may mean that something is amiss within your config file. Here's what I have:

output database: alert, mysql, user=snort password=xxxxx dbname=snort host=xxxxx.ath.cx sensor_name=spanky

You have to restart the snort daemon for the change to be applied.

You can also run snort in test mode (option -T).

I hope this helps.
 
Old 04-22-2009, 03:17 PM   #3
Ephracis
Senior Member
 
Registered: Sep 2004
Location: Sweden
Distribution: Ubuntu, Debian
Posts: 1,109

Original Poster
Rep: Reputation: 50
Oh, I got it working. Seems like I should not use the -A option.

Is it possible to have two lines? Like

output database: alert, mysql, user=snort password=xxxxx dbname=snort host=localhost
output database: log, mysql, user=snort password=xxxx dbname=snort host=localhost

And what does sensor_name do?
 
Old 04-22-2009, 07:15 PM   #4
unixfool
Member
 
Registered: May 2005
Location: Northern VA
Distribution: Slackware, Ubuntu, FreeBSD, OpenBSD, OS X
Posts: 782
Blog Entries: 8

Rep: Reputation: 158Reputation: 158
Quote:
Originally Posted by Ephracis View Post
Oh, I got it working. Seems like I should not use the -A option.

Is it possible to have two lines? Like

output database: alert, mysql, user=snort password=xxxxx dbname=snort host=localhost
output database: log, mysql, user=snort password=xxxx dbname=snort host=localhost

And what does sensor_name do?
You can have as many lines as you like.

The sensor_name variable is just a logical name for your sensor. It is sensible to name them based on placement, such as 'inside' (internal network sensor), 'outside' (external network sensor), and 'dmz' (dmz sensor).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
What does this snort log look like to you? kav Linux - Security 2 01-03-2008 07:11 AM
Log Rotation for snort log does not seem to be working CentOS4.5 JasonKretzer Linux - Security 3 06-25-2007 12:25 PM
Snort don't want log to mysql lcat Slackware 1 03-07-2005 07:20 AM
configuring my snort to log to mysql linuxtommy Linux - Security 7 09-09-2004 03:31 AM
I can't get snort to log anything abefroman Linux - Security 2 09-07-2004 09:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:05 PM.

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