Giter VIP home page Giter VIP logo

snort_reader's Introduction

Snort Alert Log Reader

The Python script to monitor (tail) the Snort alert log file and send notifications for top-priority alerts (priority 2 and 1 by default). Support two ways of notification:

  • via email
  • via the custom script

You can also send SMS notifications with Twilio Texting script (twilio account is required).

Main features:

  • support snort alert log rotation
  • configurable via reader.ini
  • notifications limit (one notification per 6 hours by default)
  • notifications queue
  • processing state saving/loading
  • email notifications support information from /etc/mail.rc
  • pid checking (one running copy only)

TODO:

  • save parsed Snort alerts to the sqlite database
  • Webmin integration

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

Python 2.7
CentOS 7        (tested)
  or Windows    (no email notifications, for debug only)

Installing

Download and copy files, set executable flag:

mkdir /opt/snort_reader
cp snort_alert_reader.py /opt/snort_reader/
cp reader.ini /opt/snort_reader/
chmod +x /opt/snort_reader/snort_alert_reader.py

Configuring

Open configuration file for editing:

vim /opt/snort_reader/reader.ini

Set up following options:

  • snort_log - the path to Snort alert log (/var/log/snort/alert by default)
  • notify_cmd - path to notification script (e.g. /opt/texting/texting). Can be empty.
  • notify_email - email address for notifications. Can be empty.

Testing

Schedule script with crontab:

crontab -e
* * * * * /opt/snort_reader/snort_alert_reader.py > /dev/null 2>&1

Wait one minute after scheduling and verify execution:

tail -f /var/log/alert_snort_reader.log

You can also enable heartbeats with enabling VERBOSE_DEBUG in a script:

cd /opt/snort_reader/
vim snort_alert_reader.py
VERBOSE_DEBUG = True
:wq
kill `cat reader.pid`

Authors

License

This project is licensed under the Apache 2.0 License - see the LICENSE file for details.

snort_reader's People

Contributors

gooorooox avatar

Stargazers

 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.