mirror of https://github.com/MISP/MISP-maltego
chg: [transform] improved performance EventTo containing attachments
parent
517c616877
commit
c40e776462
|
@ -35,8 +35,11 @@ class EventToTransform(Transform):
|
||||||
self.config = config
|
self.config = config
|
||||||
maltego_misp_event = request.entity
|
maltego_misp_event = request.entity
|
||||||
self.misp = get_misp_connection(config)
|
self.misp = get_misp_connection(config)
|
||||||
self.event_json = self.misp.get_event(maltego_misp_event.id) # FIXME get it without attachments # FIXME use search + includeAttachments:0, eventid: as request body
|
event_id = maltego_misp_event.id
|
||||||
if not self.event_json.get('Event'):
|
search_result = self.misp.search(controller='events', eventid=event_id, withAttachments=False)
|
||||||
|
if search_result.get('response'):
|
||||||
|
self.event_json = search_result['response'].pop()
|
||||||
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self.response += event_to_entity(self.event_json)
|
self.response += event_to_entity(self.event_json)
|
||||||
|
|
Loading…
Reference in New Issue