Giter Site home page Giter Site logo

andrewburian / banhammer Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 252 KB

A C++ Intrusion Prevention System designed to montior arbitrary log files with regex and perform system actions.

License: GNU General Public License v2.0

C++ 97.83% ApacheConf 0.81% Makefile 1.36%

banhammer's Introduction

8006-a3 (BanHammer!)

A C++ Intrusion Prevention System designed to monitor arbitrary log files with regex and perform system actions.

Setup

Banhammer works by creating filters, actions, and associations between the two for monitoring log files and executing system actions Banhammer can only execute actions at the privilege level it was started in.

There are three main configuration locations for BanHammer, outlined here

BanHammer
├── action.d
│   └── *.act
├── banhammer.conf
└── filter.d
    └── *.fil

action.d contains action definitions in the form of .act files filter.d contains filter definitions, .fil and banhammer.conf sets up the associations between the two

Filters

Filters contain regular expressions that match lines in a log file. Each of these lines will be counted as an attempt.

Directive Description
[params] Parameters that are global to each filter line. Currently only datetime_regex and datetime_format are used.
[regex] Contains the regex that matches the log file lines. The line after this is a list of names for the groups in the regex.

All sections are necessary but can be in any order

Actions

Action definitions may contain any of these detectives:

Directive Description
[before] Any commands in this section are executed when the action definition is first read into banhammer. Even if this action is used more than once, this section will only be executed the first time
[act] Commands in this section are executed once a linked filter's conditions are met
[unact] These commands are executed after the actions bantime has elapsed since the act section was executed

While not all sections are necessary, they must be in the presented order

Main Config

The main config links filters with actions, as well as provides refining arguments, creating rules

All the following parameters must be included in each rule

[rulename]
filter=filtername
action=actionname
logfile=/path/to/log.file
period=300
attempts=4
bantime=3600

License

See License

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.