Skip to content

Commit

Permalink
fix: [stix1 import] Fixed SocketAddress properties parsing to avoid i…
Browse files Browse the repository at this point in the history
…ssue when there is no port field
  • Loading branch information
chrisr3d committed Nov 2, 2023
1 parent d80ed0d commit c15c88e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/files/scripts/stix2misp.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,9 @@ def handle_socket_address(self, properties):
elif properties.hostname:
type1 = "hostname"
value1 = properties.hostname.hostname_value.value
return "{}|port".format(type1), "{}|{}".format(value1, properties.port.port_value.value), ""
if properties.port:
return "{}|port".format(type1), "{}|{}".format(value1, properties.port.port_value.value), ""
return type1, value1, ''

# Parse a system object to extract a mac-address attribute
@staticmethod
Expand Down

0 comments on commit c15c88e

Please sign in to comment.