Suricata from to sources CTI
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
Metadata
Release files for iocmite 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| iocmite-0.1.tar.gz | 8.0 kB | Without provenance | Details for iocmite-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| iocmite-0.1-py3-none-any.whl | Python 3 | none | any | Details for iocmite-0.1-py3-none-any.whl |
Total release size: 17.9 kB
Release files / iocmite-0.1.tar.gz
| Download URL | iocmite-0.1.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d9d7c3137c8ba73da50690c9bb3e400a9f340de3048fc7e6a6e63d684bc007e
|
|
BLAKE2b-256 checksum How to use checksums |
71323b0f4d91350fc778457418a69b542a1ed1ce6949ed32576a81757bee0b69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / iocmite-0.1-py3-none-any.whl
| Download URL | iocmite-0.1-py3-none-any.whl |
|---|---|
| Size | 10.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3036ef8eed2b520e1116a83a785730ae3bca9a461db83563c7cb8b49baca500e
|
|
BLAKE2b-256 checksum How to use checksums |
e0f2c10da18bb7c08ef611d1c24ee859be359c9af8fa3c8463d5ae6fdbdf4ff4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for iocmite 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.