LinuxQuestions.org
Review your favorite Linux distribution.
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
 
LinkBack Search this Thread
Old 04-30-2005, 01:49 AM   #1
mikeghet
Member
 
Registered: Aug 2004
Location: USofA
Distribution: fedora core < SUSE
Posts: 70

Rep: Reputation: 15
Can snort send emails?


I don't know if it's possible, but I can't find any info explaining how to make a rule in snort.conf to send an email when an alert has been activated.

For instance, I'm running an alert for port 80 for a certain website. Snort catches the alert and logs the info in a file. But, I want to be able to email the alert ONLY when it happens.

Again, I can't find any rules for snort that suggest this can be done in the snort.conf file.

But, what about command line piping?

The problem can easily be solved by piping the snort command with ; mail -s "alert" root
or snort commands ; cat alerfile | mail -s "alert" root

However, you have to ctrl+c to get the snort command to exit in order to run the other commands on the commandline. No big deal, but the other comamnds will run no matter what after the break sequence and send a useless email even if no alerts were done, not to mention that's not very automated.

Which brings me to my next question:

Is there anyway to get snort to exit gracefully after an alert is detected?
 
Old 05-01-2005, 02:54 PM   #2
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
http://www.snort.org/docs/faq.html#5.7

Snort doesn't have a email capability itself and you need to be carefull not to have every an email sent for every sinlgle alert (especially if you haven't fine-tuned your snort rules) otherwise you can bog down the Snort sensor and mailbomb the machine you are sending email alerts to. Basically what you're doing is sending alerts to a log file and using a log parsing utility to extract various alerts and send an email. This way you don't have to terminate the Snort process, which would probably be a bad idea (Snort might see an initial port scan and terminate, but would miss the subsequent exploit code).

Last edited by Capt_Caveman; 05-01-2005 at 02:58 PM.
 
Old 05-01-2005, 06:09 PM   #3
mikeghet
Member
 
Registered: Aug 2004
Location: USofA
Distribution: fedora core < SUSE
Posts: 70

Original Poster
Rep: Reputation: 15
yeah, that's what I found. you have to use another program to monitor snort...kind of lame.



The link you posted suggests to use either 'swatch' or 'logcheck' to do this monitoring. What do you suggest?

" ruletype redalert
{
type alert
output alert_syslog: LOG_LOCAL2
output database: alert, postgresql, user=user dbname=snort password=pwd
}"

That's the code that would have to be inserted into snort.conf, apparently. the 'output databse' line isnt necessary, is it?
 
Old 05-01-2005, 07:40 PM   #4
Capt_Caveman
Senior Member
 
Registered: Mar 2003
Distribution: Fedora
Posts: 3,658

Rep: Reputation: 57
yeah, that's what I found. you have to use another program to monitor snort...kind of lame.
Snort is really designed to be a highly efficient IDS that can handle a pretty substantial load and doesn't really have alot of "bells-and-whistles". Most of those are third-party add-ons.

The link you posted suggests to use either 'swatch' or 'logcheck' to do this monitoring. What do you suggest?
I haven't used either one extensively enough to say which is better.

That's the code that would have to be inserted into snort.conf, apparently. the 'output databse' line isn't necessary, is it?
I believe that's for logging to the database as well as to the syslog facility. Without it, you'd probably just send alerts to syslog and not have them show up to your db.
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't Send or Receive Emails with Hula markw8500 Linux - Software 0 11-20-2005 11:52 AM
sendmail doesn't send emails outside dev_mohamed Linux - Networking 2 08-28-2005 03:42 PM
send 50-100 emails? codec Linux - Software 1 11-23-2004 07:28 AM
Can't recieve emails but can send them mosherben Linux - Software 12 08-10-2004 11:22 AM
Can't send or Receive Emails amohime Linux - Networking 4 04-11-2003 02:42 AM


All times are GMT -5. The time now is 05:20 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration