fix: [MISP export] get full list

pull/486/head v3.0
Terrtia 2020-02-21 15:47:05 +01:00
parent 32b023165a
commit 1f8c858c77
No known key found for this signature in database
GPG Key ID: 1E1B1F50D84613D0
2 changed files with 3 additions and 0 deletions

View File

@ -384,6 +384,7 @@ def create_misp_event(event, distribution=0, threat_level_id=4, publish=False, a
misp = PyMISP(misp_url, misp_key, misp_verifycert) misp = PyMISP(misp_url, misp_key, misp_verifycert)
#print(event.to_json()) #print(event.to_json())
misp_event = misp.add_event(event) misp_event = misp.add_event(event)
#print(misp_event)
# # TODO: handle error # # TODO: handle error
event_metadata = extract_event_metadata(misp_event) event_metadata = extract_event_metadata(misp_event)
return event_metadata return event_metadata

View File

@ -152,7 +152,9 @@ def export_object_file():
l_obj_invalid=l_obj_invalid, dict_misp_event_export=dict_misp_event_export) l_obj_invalid=l_obj_invalid, dict_misp_event_export=dict_misp_event_export)
else: else:
if export_to_misp and MispExport.ping_misp(): if export_to_misp and MispExport.ping_misp():
l_obj_to_export = AILObjects.get_user_list_of_obj_to_export(user_id)
event = MispExport.create_list_of_objs_to_export(l_obj_to_export, r_type='event') event = MispExport.create_list_of_objs_to_export(l_obj_to_export, r_type='event')
event_metadata = MispExport.create_misp_event(event, distribution=dict_misp_event_export.get('export_to_misp', None), event_metadata = MispExport.create_misp_event(event, distribution=dict_misp_event_export.get('export_to_misp', None),
threat_level_id=dict_misp_event_export.get('misp_threat_level_id', None), threat_level_id=dict_misp_event_export.get('misp_threat_level_id', None),
publish=dict_misp_event_export.get('misp_publish', None), publish=dict_misp_event_export.get('misp_publish', None),