Skip to main content

Import indicators of different data sources to dataset Suricata and add sightings in MISP on this indicators

Project description

Suricata from to sources CTI

Total alerts Language grade: Python

the purpose of the application is to import attributes from different sources of threat Intelligence into suricata datasets to put them under surveillance.

Concepts of datasets in Suricata

Indicators can be saved in a suricata dataset and create detection rules on this dataset.

This concept is detailed here.

Installation

git clone  https://github.com/sebdraven/iocmite.git
python3 -m'venv' venv && source venv\bin\activate
pip install -r requirements.txt`
python setup.py install

or

python -m'venv' venv && source venv\bin\activate
pip install iocmite
iocmite --help

Download the last release of Suricata here and run:

tar xvfz suricata-6.0.x && cd suricata-6.0.x/python && python setup install

Json setting and Rule Suricata for MISP source and Sightings

{
    "misp": {
        "url": "",
        "key": ""
    },
    "eve_json": "/var/log/suricata/eve.json",
    "metadata": "sightings",
    "tmp_file": "/tmp/last_run",
    "rule": "",
    "datasets": {
        "sources": {
            "misp": {
                "ip-src": {
                    "name": "ips",
                    "type": "string"
                },
                "ip-dst": {
                    "name": "ips",
                    "type": "string"
                },
                "hostname": {
                    "name": "dbl",
                    "type": "string"
                },
                "domain": {
                    "name": "dbl",
                    "type": "string"
                },
                "user-agent": {
                    "name": "uabl",
                    "type": "string"
                }
                
            }
        }
    }
}

Sample signatures are provided in the rules directory. For example, the one matchine on HTTP hostname is:

alert http any any -> any any (msg: "domains TA (HTTP)"; http.host; dataset:isset,dbl, type string, state /var/lib/suricata/data/dbl.lst; sid:1100001; rev:1; metadata:sightings http.hostname;)

The metadata term in the rule suricata is the same in the setting JSON file. The signatures suppose a standard system wide Suricata installation, you will need to change the path in the state option in the dataset keyword if ever you don't have a standard installation.

Setup the url and key of MISP in the json file.

Usage

Principles

To synchronize the IOCs in MISP with Suricata datasets, you need to run an import command periodically. You can use a cron task to do so.

To send sightings back to MISP, you need to run a IOCmite instance that will wait for new events and publish sightings as soon as they came.

Example commands

To import indicators from MISP to suricata with redis to store last run time, run the following command:

iocmite --config /path/to/json/file/settings.json --import --redis

To import indicators from MISP to suricata with temp file to store last run time, run the following command:

iocmite --config /path/to/json/file/settings.json --import --tmp_file

To catch alert from redis and send sightings to MISP, run the following command:

iocmite --config /path/to/json/file/settings.json --redis --sightings

To catch alert from eve_json and send sightings to MISP, run the following command:

iocmite --config /path/to/json/file/settings.json --eve_json --sightings

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

iocmite-0.1.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

iocmite-0.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file iocmite-0.1.tar.gz.

File metadata

  • Download URL: iocmite-0.1.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for iocmite-0.1.tar.gz
Algorithm Hash digest
SHA256 0d9d7c3137c8ba73da50690c9bb3e400a9f340de3048fc7e6a6e63d684bc007e
MD5 b661bcce2e484dfe0d3bde798eee7fba
BLAKE2b-256 71323b0f4d91350fc778457418a69b542a1ed1ce6949ed32576a81757bee0b69

See more details on using hashes here.

File details

Details for the file iocmite-0.1-py3-none-any.whl.

File metadata

  • Download URL: iocmite-0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for iocmite-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3036ef8eed2b520e1116a83a785730ae3bca9a461db83563c7cb8b49baca500e
MD5 efeb465b47c1453541492f625efb5955
BLAKE2b-256 e0f2c10da18bb7c08ef611d1c24ee859be359c9af8fa3c8463d5ae6fdbdf4ff4

See more details on using hashes here.

Supported by

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