Giter VIP home page Giter VIP logo

anomalia-reputation-api's Introduction

anomalia-reputation-api

anomalia is a plugin for nfsen that detects anomalies in TCP connections based on the flow analysis and send to reputation-api endpoint

Introduction

If you do not know the reputation-api, read more about it here

Instalation

For the following examples of settings, nfsen was installed in: `/data/nfsen/`, the endpoint of reputation API is: `10.0.2.2:8081/api/ip` and nfsen web folder is `/var/www/nfsen`.

To install the plugin, you need a you add Perl libraries.

If you use Debian or Ubuntu, you can install them with the command:

apt-get install liblwp-useragent-determined-perl libjson-perl

You must copy the files in backend for /data/nfsen/plugins (in the configuration file, is the variable $BACKEND_PLUGINDIR) and copy the files in frontend for /var/www/nfsen (in the configuration file, is the variable $FRONTEND_PLUGINDIR).

Setting nfsen plugin

In /data/nfsen/etc/nfsen.conf (remember: the localization may be different depending on your installation)

Insert in @plugins the line: ['live', 'Anomaly'],

It should look like this:

@plugins = (
	# others plugins...
	[ 'live',  'Anomaly' ],
);

You should also make additional settings. These settings are used to tell the plugin where is the endpoint of the reputation-api, from which limit the plugin should send an event to the API, and where the plugin will read the main source ports (these values were placed in a file for easier manipulation). To do this, you must include the following line in %PluginConf.

Anomaly => {
	reputation_api_endpoint => "http://10.0.2.2:8081/api/ip",
	ports_file => "$BACKEND_PLUGINDIR/anomaly_ports.txt",
	threshold => 5,
},

Setting reputation-api for plugin

The plugin sends the information found to the configured endpoint, using the following categories:

  • NETFLOW.SYN_CLOSED
  • NETFLOW.SYN
  • NETFLOW.UDP
  • NETFLOW.NULL

Therefore you should configure these categories in reputation-api. The following instructions shows an insertion example in the database for the categories used with a discount tax of 1%

INSERT INTO `category` (`category`, `tax`) VALUES ('NETFLOW.SYN_CLOSED', '0.9900');
INSERT INTO `category` (`category`, `tax`) VALUES ('NETFLOW.SYN', '0.9900');
INSERT INTO `category` (`category`, `tax`) VALUES ('NETFLOW.UDP', '0.9900');
INSERT INTO `category` (`category`, `tax`) VALUES ('NETFLOW.NULL', '0.9900');

Use

To complete the process, you must reload the nfsen.

/data/nfsen/bin/nfsen reload

Go to the tab of the plugin, you should see the configuration information, as in the following example:

Anomaly to reputation::api

For more information about this plugin and how it works go to https://github.com/mdjunior/anomalia-reputation-api


Backend status: running...
Reputation::api Endpoint: http://10.0.2.2:8081/api/ip
Ports File: /data/nfsen/plugins/anomaly_ports.txt
Threshold config: 5

Tips

If you want a quick installation nfsen, see here (using Vagrant and Virtulbox)

anomalia-reputation-api's People

Contributors

mdjunior avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

ccgcyber

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.