Skip to main content

A plugin to enable threatbus communication with MISP.

Project description

Threat Bus MISP Plugin

PyPI Status Build Status License

A Threat Bus plugin that enables communication to MISP.

The plugin goes against the pub/sub architecture of Threat Bus (for now), because the plugin subscribes a listener to ZeroMQ / Kafka, rather than having MISP subscribe itself to Threat Bus. That will be addressed with a MISP module in the near future.


pip install threatbus-misp


Install Kafka on the Threat Bus host

The plugin enables communication either via ZeroMQ or Kafka. When using Kafka, you have to install librdkafka for the host system that is running threatbus. See also the prerequisites section of the confluent-kafka python client.


The plugin can either use ZeroMQ or Kafka to retrieve intelligence items from MISP. It uses the MISP REST api to report back sightings of indicators.

ZeroMQ and Kafka are mutually exclusive, such that Threat Bus does not receive all attribute updates twice. See below for an example configuration.

      host: https://localhost
      ssl: false
      key: MISP_API_KEY
      host: localhost
      port: 50000
    #  topics:
    #  - misp_attribute
    #  poll_interval: 1.0
    #  # All config entries are passed as-is to librdkafka
    #  #
    #  config:
    #    bootstrap.servers: "localhost:9092"
    # "threatbus"
    #    auto.offset.reset: "earliest"

Development Setup

The following guides describe how to set up local, dockerized instances of MISP and Kafka.

Dockerized Kafka

For a simple, working Kafka Docker setup use the single node example from confluentinc/cp-docker-images.

Store the docker-compose.yaml and modify the Kafka environment variables such that the Docker host (e.g., of your Docker machine is advertised as Kafka listener:

    KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://   # <-- That is the IP of your Docker host

For details about Kafka listeners, check out this article.

Then start the compose setup via docker-compose up -d.

To test the setup, use the tests/utils/ and tests/utils/ scripts.

Dockerized MISP

Use DCSO's dockerized MISP to set up a local testing environment:

Setup a MISP Docker cluster

git clone
cd MISP-dockerized
make install
# follow the dialog...

Edit the docker-compose.yaml

cd current
vim docker-compose.yaml

Find the section misp-server in the configuration and add the following:

      - "50000:50000"

Restart MISP to accept the new port

make deploy

Enable the Kafka plugin in the MISP webview

  • Visit https://localhost:80
  • login with your configured credentials
  • Go to Administration -> Server Settings & Maintenance -> Plugin settings Tab
  • Set the following entries
    • Plugin.Kafka_enable -> true
    • Plugin.Kafka_brokers -> <- In this example, is the Docker host, reachable from other Docker networks. The port is reachable when the Kafka Docker setup binds to it globally.
    • Plugin.Kafka_attribute_notifications_enable -> true
    • Plugin.Kafka_attribute_notifications_topic -> misp_attribute <- The topic goes into the threatbus config.yaml

Install Kafka inside the misp-server container

docker exec -ti misp-server bash # pop interactive shell inside the container

apt-get install software-properties-common
apt-get update
# enable stretch-backports to get a recent librdkafka version
add-apt-repository "deb stretch-backports main contrib non-free"
apt-get update
apt-get install librdkafka-dev/stretch-backports
# see
pecl channel-update
pecl install rdkafka
echo "" | tee /etc/php/7.0/mods-available/rdkafka.ini
phpenmod rdkafka
service apache2 restart
exit # leave the Docker container shell

Enable the ZMQ plugin in the MISP webview

  • Visit https://localhost:80
  • login with your configured credentials
  • Go to Administration -> Server Settings & Maintenance -> Diagnostics Tab
  • Find the ZeroMQ plugin section and enable it
  • Go to Administration -> Server Settings & Maintenance -> Plugin settings Tab
  • Set the entry Plugin.ZeroMQ_attribute_notifications_enable to true

Restart all MISP services

make restart-all


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.

Files for threatbus-misp, version 0.3.2
Filename, size File type Python version Upload date Hashes
Filename, size threatbus_misp-0.3.2-py3-none-any.whl (10.9 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size threatbus-misp-0.3.2.tar.gz (13.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page