Code Monkey home page Code Monkey logo

snortban's Introduction

SNORTBAN

Parses the snort alert log and creates one line logs suitable for fail2ban.

REQUIRES

    - Perl
    - One Perl module: Proc::PID::File.
      On Debian, Ubuntu and derivates install it issuing:
        # apt-get install libproc-pid-file-perl
    - fail2ban
    - snort

HOW TO INSTALL

    - Copy the snortban file to a place suitable, run it from /etc/rc.loca
      or create a service file.  It must be called with an '&' so it goes to background.

    - Add an entry in your logrotate.d/snort file to rotate your alert.ban file.
      

USAGE

    snortban [--debug] [--logfile=/var/log/snort/alert] [--banfile=/var/log/snort/alert.ban] &

USING FROM fail2ban

    When running, snortban will log entries to the banfile like this:

    Thu Jan 12 09:56:07 2012 [Priority: 3]  1.2.3.4 -> 5.6.7.8 [**] [122:3:0] (portscan) TCP Portsweep [**]

    Filters must be created in fail2ban to check it. Two examples are in this
    package: snortp1.conf and snortp2.conf. Those fails should be in 
    /etc/fail2ban/filter.d/
    Add this to your jail.conf file so the rules are used:

[snortp1]
enabled  = true
port     = 22
banaction= iptables-allports
filter   = snort_p1
maxretry = 1
logpath  = /var/log/snort/alert.ban

[snortp2]
enabled  = true
port     = 22
banaction= iptables-allports
filter   = snort_p2
maxretry = 10
logpath  = /var/log/snort/alert.ban


LICENSE

    GNU GENERAL PUBLIC LICENSE Version 3
    http://www.gnu.org/licenses/gpl.html

AUTHOR

    Francesc Guasch -  frankie  etsetb upc edu

snortban's People

Contributors

frankiejol avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

snortban's Issues

No Issue, just a thank you!

github does not have message support between users but we can surely add a positive issue ๐Ÿ˜†

Thank you for this old but yet still working trick!!!

-B

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.