fix: [galaxies] fixes #37 #38

pull/40/head
Christophe Vandeplas 2020-07-04 18:50:41 +02:00
parent 0b71d8a4f4
commit df4d92b447
3 changed files with 7 additions and 4 deletions

View File

@ -9,7 +9,7 @@ setup(
name='MISP_maltego', name='MISP_maltego',
author='Christophe Vandeplas', author='Christophe Vandeplas',
# also update version in util.py # also update version in util.py
version='1.4.5', version='1.4.6',
author_email='christophe@vandeplas.com', author_email='christophe@vandeplas.com',
maintainer='Christophe Vandeplas', maintainer='Christophe Vandeplas',
url='https://github.com/MISP/MISP-maltego', url='https://github.com/MISP/MISP-maltego',

View File

@ -85,6 +85,7 @@ class SearchInMISP(Transform):
# we need to do really rebuild the Entity from scratch as request.entity is of type Unknown # we need to do really rebuild the Entity from scratch as request.entity is of type Unknown
# TODO First try to build the object, then only attributes (for those that are not in object, or for all?) # TODO First try to build the object, then only attributes (for those that are not in object, or for all?)
# TODO check for the right version of MISP before, it needs to be 2.4.127 or higher.
# obj_json = conn.misp.search(controller='objects', value=request.entity.value, with_attachments=False) # obj_json = conn.misp.search(controller='objects', value=request.entity.value, with_attachments=False)
# for o in obj_json: # for o in obj_json:
# for item in attribute_to_entity(attr, only_self=True, link_label=link_label): # for item in attribute_to_entity(attr, only_self=True, link_label=link_label):

View File

@ -12,7 +12,7 @@ import requests
import tempfile import tempfile
import time import time
__version__ = '1.4.5' # also update version in setup.py __version__ = '1.4.6' # also update version in setup.py
tag_note_prefixes = ['tlp:', 'PAP:', 'de-vs:', 'euci:', 'fr-classif:', 'nato:'] tag_note_prefixes = ['tlp:', 'PAP:', 'de-vs:', 'euci:', 'fr-classif:', 'nato:']
@ -445,9 +445,9 @@ def galaxycluster_to_entity(c, link_label=None, link_direction=LinkDirection.Inp
# LATER this uses the galaxies from github as the MISP web UI does not fully support the Galaxies in the webui. # LATER this uses the galaxies from github as the MISP web UI does not fully support the Galaxies in the webui.
# See https://github.com/MISP/MISP/issues/3801 # See https://github.com/MISP/MISP/issues/3801
galaxy_archive_url = 'https://github.com/MISP/misp-galaxy/archive/master.zip' galaxy_archive_url = 'https://github.com/MISP/misp-galaxy/archive/main.zip'
local_path_uuid_mapping = os.path.join(local_path_root, 'MISP_maltego_galaxy_mapping.json') local_path_uuid_mapping = os.path.join(local_path_root, 'MISP_maltego_galaxy_mapping.json')
local_path_clusters = os.path.join(local_path_root, 'misp-galaxy-master', 'clusters') local_path_clusters = os.path.join(local_path_root, 'misp-galaxy-main', 'clusters')
galaxy_cluster_uuids = None galaxy_cluster_uuids = None
@ -480,6 +480,8 @@ def galaxy_update_local_copy(force=False):
zf.extractall(local_path_root) zf.extractall(local_path_root)
zf.close() zf.close()
except Exception: except Exception:
# remove the lock
os.remove(lockfile)
raise(MaltegoException("ERROR: Could not download Galaxy data from htts://github.com/MISP/MISP-galaxy/. Please check internet connectivity.")) raise(MaltegoException("ERROR: Could not download Galaxy data from htts://github.com/MISP/MISP-galaxy/. Please check internet connectivity."))
# generate the uuid mapping and save it to a file # generate the uuid mapping and save it to a file