MISP / MISP-Taxii-Server

An OpenTAXII Configuration for MISP
BSD 3-Clause "New" or "Revised" License
80 stars 30 forks source link

Bringing up-to-date with recent PyMISP and Optional Deduplication #82

Closed arcsector closed 2 years ago

arcsector commented 4 years ago

Summary

This PR brings MISP-Taxii-Server up-to-date with the most recent PyMISP. This should fix #80. We can also make deduplication optional so that if the MISP server is substantially large, the search function doesn't hog resources. This should fix #81.

Purpose

The purpose of this PR is to keep this repo backwards compatible with the most recent PyMISP and bring it up-to-date with the most recent version.

Solution Implementation

The way we do this is by checking to make sure that the response key exists in the search dictionary returned by pymisp.search(). In the most recent version, the response key does not exist, and the Attribute key is moved up one level to the top level of the search dictionary. If neither of these keys exist in the top level, we log the issue and move on to the next attribute.

Next we fix the hanging issue by making deduplication optional, while still maintaining backwards compatibility with old MISP-Taxii-Server configs. We can do this by adding in a new argument to the config or env variables: misp.dedup and MISP_DEDUP respectively. If this config is not found, we continue deduplicating like the original program would. If it is found, and is not True, we skip the deduplication loop and move straight on to uploading the package to MISP.

Additional Features

There's also additional features I'd like to add in this PR:

Changes

arcsector commented 4 years ago

Looks like the travis-ci build is failing due to issues with dependencies in mysql 5.6...

lgtm-com[bot] commented 4 years ago

This pull request introduces 1 alert when merging 67d08c443fcf32b86c79e20332583e238bd64d56 into 2300977908c86ca31ca2e0a822d90137be9d3fa0 - view on LGTM.com

new alerts:

lgtm-com[bot] commented 2 years ago

This pull request introduces 2 alerts when merging 2aa3522cae0efc4701112c13d58e4053324faa36 into 2300977908c86ca31ca2e0a822d90137be9d3fa0 - view on LGTM.com

new alerts:

adulau commented 2 years ago

Thank you!