Skip to main content

The missing link to connect open-source threat intelligence tools.

Project description

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 StartedContributing GuidelinesWriting PluginsLicenseDocumentation

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

threatbus-2020.4.29.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

threatbus-2020.4.29-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file threatbus-2020.4.29.tar.gz.

File metadata

  • Download URL: threatbus-2020.4.29.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for threatbus-2020.4.29.tar.gz
Algorithm Hash digest
SHA256 65690987c1c96058b7c0df1a3a0f00ab599e0dde23602e713049990795f884ef
MD5 b70a4b0184bb0881ef1c50e3e0caffd4
BLAKE2b-256 6319ac8b71f846d8674bb18ff0006a7a650571ca58b176ae9ed9bb8311187cdf

See more details on using hashes here.

File details

Details for the file threatbus-2020.4.29-py3-none-any.whl.

File metadata

  • Download URL: threatbus-2020.4.29-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2

File hashes

Hashes for threatbus-2020.4.29-py3-none-any.whl
Algorithm Hash digest
SHA256 a0afa40c8ff6b8c7aabbb1efb1cd7caeb4d75d628ff1834e62f96b055ce376da
MD5 e67ff2b0e10898b891c6a74669e09105
BLAKE2b-256 cec9e7a00ad7ad3daa5d4271df52ab653e67287e813383a9f38def9e3ef4200a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page