GithubHelp home page GithubHelp logo

xenisys / threatbus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tenzir/threatbus

0.0 1.0 0.0 245 KB

๐ŸšŒ The missing link to connect open-source threat intelligence tools.

License: BSD 3-Clause "New" or "Revised" License

Python 87.92% Zeek 9.06% Makefile 2.15% Dockerfile 0.88%

threatbus's Introduction

Threat Bus

The missing tool to interconnect open-source security applications.

PyPI Status Build Status Total alerts Language grade: Python Development Status Latest Release License

Getting Started โ€” Contributing Guidelines โ€” Writing Plugins โ€” License

Key Features

  • Connect Open-Source Security Tools: Threat Bus is a pub-sub broker for threat intelligence data. With Threat Bus you can seamlessly integrate MISP intelligence with the Zeek intel framework or report sightings from IDS deployments to some data base.

  • Plugin-based Architecture: The project is plugin-based and can be extended easily. We welcome contributions to adopt new open source tools!

  • Snapshotting: The snapshot feature allows subscribers to directly request threat intelligence data for a certain time range from other applications. Threat Bus handles the point-to-point communication of all involved apps.

Getting Started

Start Threat Bus

venv/bin/threatbus -c config.yaml

Start Zeek as Threat Bus app

zeek -i <INTERFACE> -C ./apps/zeek/threatbus.zeek

Start Zeek and request a snapshot

zeek -i <INTERFACE> -C ./apps/zeek/threatbus.zeek -- "Tenzir::snapshot_intel=-30 days"

Use the Threat Bus Docker container

docker run tenzir/threatbus:latest --help

Start Threat Bus container with a custom config file

docker run -p 47661:47661 -v $PWD/my-custom-config.yaml:/opt/tenzir/threatbus/my-custom-config.yaml tenzir/threatbus:latest -c my-custom-config.yaml

Installation

Install threatbus and all plugins that you require. Optionally, use a virtual environment.

virtualenv venv           # optional
source venv/bin/activate  # optional
pip install threatbus
pip install threatbus-inmem
pip install threatbus-misp
pip install threatbus-zeek
pip install threatbus-<plugin_name>

Testing

Use the Makefile to run unit and integration tests.

make unit-tests
make integration-tests

The integration tests require a local Zeek installation.

Plugin Development

Setup a virtual environment and install threatbus and some plugins with the in development mode:

virtualenv venv
source venv/bin/activate
make dev-mode

Configuration & Extension

A plugin must define a setup.py. Whenever a plugin is installed, you have to add a corresponding configuration section to threatbus' config.yaml. That section has to be named after the name in the entrypoint declaration of the plugin's setup.py file.

Please adhere to the plugin naming conventions and always prefix your plugin name with threatbus-.

Plugins can either be apps or backbones. Application plugins (apps) add new functionality to threatbus and allow communication to a threat-intelligence-enabled app (e.g., Zeek or Suricata). Backbone plugins add a new storage and distribution backend to threatbus (e.g., in-memory or Kafka).

Example:

  • plugin folder structure:
    plugins
    โ”œโ”€โ”€ apps
    |   โ””โ”€โ”€ threatbus-zeek
    โ”‚       โ”œโ”€โ”€ setup.py
    |       โ””โ”€โ”€ threatbus_zeek.py
    โ””โ”€โ”€ backbones
        โ””โ”€โ”€ threatbus-inmem
            โ”œโ”€โ”€ setup.py
            โ””โ”€โ”€ threatbus_inmem.py
  • setup.py
    from setuptools import setup
    setup(
      name="threatbus-myapp",
      install_requires="threatbus",
      entry_points={"threatbus.app": ["myapp = threatbus_myapp"]},
      py_modules=["threatbus_myapp"],
    )
  • config.yaml entry for threatbus
    ...
    plugins:
      apps:
        myapp:
        ...

Threat Bus API

Plugins specifications are available in threatbus/appspecs.py and threatbus/backbonespecs.py, respectively. For any plugin, you should at least implement the run function.

App plugins are provided two callback functions to use for subscription management. Internally, Threat Bus will propagate subscription requests to all installed backbone plugins.

The subscription callback allows applications to request an optinal snapshot time delta. Threat Bus will forward snapshot requests to all those apps that have implemented the snapshot feature (see threatbus/appspecs.py).

License

Threat Bus comes with a 3-clause BSD license.

threatbus's People

Contributors

mavam avatar 0snap avatar tobim avatar

Watchers

James Cloos 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.