fix: [stix import] Fixed address objects parsing

pull/4769/head
chrisr3d 2019-06-17 09:49:53 +02:00
parent 139eab9fe9
commit fc528d9315
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 6 additions and 4 deletions

View File

@ -210,11 +210,13 @@ class StixParser():
# Return type & value of an ip address attribute
@staticmethod
def handle_address(properties):
if properties.is_source:
ip_type = "ip-src"
if properties.category == 'e-mail':
attribute_type = 'email-src'
relation = 'from'
else:
ip_type = "ip-dst"
return ip_type, properties.address_value.value, "ip"
attribute_type = "ip-src" if properties.is_source else "ip-dst"
relation = 'ip'
return attribute_type, properties.address_value.value, relation
def handle_as(self, properties):
attributes = self.fetch_attributes_with_partial_key_parsing(properties, stix2misp_mapping._as_mapping)