Coder Social home page Coder Social logo

reddalert's Introduction

reddalert

AWS security monitoring/alerting tool built on top of Netflix's EDDA project.

What do we want to see? Examples:

  • security group whitelists some weird port(range)
  • ELB forwards traffic to some weird port
  • an EC2 instance was created from an AMI not seen before
  • IAM user added to a group

Installation

Installing and running the project is pretty simple:

$ virtualenv virtualenv
$ . virtualenv/bin/activate
$ pip install -r requirements.txt
$ python reddalert.py --configfile <file> --statusfile <file> rule_1 [rule_2 [...]]

And setup a cronjob which calls this script periodically.

The configuration file

reddalert integrates into an AWS environment. The purpose of this file is to define this environment. The minimum you need is the address of a running [EDDA] server. See etc/configfile_template.json for an example!

  • edda The address of your EDDA instance.
  • output Comma-seperated list of alerting targets. If something strange is found, reddalert can email you and eg. copy the alert into ElasticSearch. Or just prints it to standard output.
  • store-until Tipically we're only interrested in events happened since the last run. If this configuration option is true, the timestamp of the actual run is stored in the status file at the end of the run. It is overridable from command line, see --since and --until.
  • plugin.<plugin_name> Plugin-specific options.
  • es_host, es_port If you use the elasticsearch output, define the ES address here.

For plugin-specific settings, check the plugin's documentation.

The status file

This file is used to store the context needed by plugins between each run. You don't want to keep getting the same alert for the same AMI, do you? Well, that's why this file exists.

Furthermore, the epoch of the last run is stored here if store-until is enabled.

Detailed Description

arch

Project Layout

[project dir]
\- api           (core files, like EDDA client lib, alerters, etc.)
\- docs          (documentation)
\- etc           (configuration files)
\- plugins       (plugins go here)
\- tests         (unit tests)
\- reddalert.py  (main executable)

Plugins

For a detailed description of available plugins, check wiki.

Each plugin class is expected to have two methods, an init and a run.

  • init Here are some infrastructure-level classes passed, notably:

    • edda_client EDDA "client proxy"
    • conifig The plugin.{plugin_name} part of the config file
  • run It should return the alert objects, in the following format:

    {
        "plugin_name": "identifier of this plugin",
        "id": "identifier of the alerted object, eg. security group id",
        "details": "human-readable details, eg. suspicious port range"
    }
    

Once you have a plugin, don't forget to add it to plugin_list in the plugin module's init file to make it available from command line.

How Do We Use It at Prezi?

We run it periodically every 6 hours. The alerts are sent to ElasticSearch, and from ES trac tickets are automatically created (using a different system). For a long time we received the alerts through email, which was a feasible workflow as well. After the initial fine-tuning we process about 3-5 alerts daily.

Do you want to contribute?

Send a pull request. Tests are highly appreciated.

See Also

reddalert's People

Contributors

jajce avatar kepten avatar mzagon-prezi avatar poupas avatar zsellera avatar

Watchers

 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.