Code Monkey home page Code Monkey logo

frankensec's Introduction

frankenSEC

SEC rules for Crossed Swords 2019 (XS19) logs and alerts

This repository contains SEC event correlation rules used in XS19 yellow team data processing as a part of our overarching frankenstack project. As the name may suggest, the contents are a Frankenstein monster of packaged SEC rules originally developed during several iterations of the frankencoding event since XS17. Much inspiration has been drawn from SagittariuSEC, a master thesis outlining a package of SEC rules.

Basic operation

  • These rules expect that the events have been enriched by 'peek' (https://github.com/ccdcoe/go-peek).
  • In our environment setup, enriched events are consumed from Kafka by the simple-kafka-consumer (a python script that is a part of the overarching Frankenstack repo) and its output is directed to a named pipe (fifo). SEC opens the named pipe with (--input) and processes incoming events.
  • Note that the rules are input source agnostic, so it does not matter how you feed SEC the input events.
  • SEC rules are responsible for initial parsing, filtering, correlation and in many cases adds meaning to the events.
  • SEC writes relevant events (again) to a separate named pipe (fifo). These are read by a tool sec2alerta (bundled with this repo) we developed specifically for this purpose.
  • The tool sec2alerta makes sure the event has all the required fields for sending events to the Alerta Server API.
  • NB! Note the alerta de-duplication and correlation functionality. The rules are constructed in a way that sequences of events/alerts/attacks taking place between the same pair of hosts are correlated together under a single 'umbrella' event. The information from the latest event is prominent, but clicking on the alert reveals the previous (historical) events that have been correlated together.
  • Events are visualized for the XS training audience (RT) on the Alerta Dashboard. However, same information could be accessed on the command line using the alerta client.

Versions

You need to run SEC version 2.8.1 or newer to make use of some of the lcall actions used in the rules.

Running the stuff

Mind the various directories and paths that are expected here. This only serves as an example.

# Run SEC as a deamon
/opt/sec/bin/sec --conf=/opt/sec/rules/*.sec --input=/opt/sec/inputs/fifo --intevents --intcontexts --reopen-timeout=60 --dumpfts --rwfifo --keepopen --log=/opt/sec/var/sec.log --detach

# Run simple-kafka-consumer
/opt/frankenstack/scripts/simple-kafka-consumer.py --kafka-meta --brokers <ip-redacted> --consume-topics peek-topic1 peek-topic2 | tee /opt/sec/inputs/generic

# Run sec2alerta
/opt/sec2alerta/sec2alerta.py --fifo /opt/sec/outputpipe

Links

frankensec's People

Contributors

markuskont 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.