fix: [stix2 import] Keeping uuids from STIX objects imported as attributes

pull/3609/head
chrisr3d 2018-09-04 11:16:25 +02:00
parent 9c320179e9
commit f378e521f1
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 2 additions and 1 deletions

View File

@ -237,9 +237,10 @@ class StixParser():
self.misp_event.add_object(**misp_object)
def parse_attribute(self, o, labels):
attribute_uuid = o['id'].split('--')[1]
attribute_type = self.get_misp_type(labels)
attribute_category = self.get_misp_category(labels)
attribute = {'type': attribute_type, 'category': attribute_category}
attribute = {'uuid': attribute_uuid, 'type': attribute_type, 'category': attribute_category}
tags = [{'name': label} for label in labels[3:]]
if tags:
attribute['Tag'] = tags