Skip to content

Commit

Permalink
fix: [stix2 export] Avoiding issues with EventReport referencing attr…
Browse files Browse the repository at this point in the history
…ibutes or objects exported as Custom STIX 2 Object

- As Event Reports are converted into STIX 2.1 Note
  objects, and we check all the references to existing
  data layer within the Event, some Attributes or
  objects referenced in the Event report might be
  converted to Custom STIX objects
- We have to check if those references are pointing
  to custom objects and add the `allow_custom` flag
  in that case
  • Loading branch information
chrisr3d committed Aug 7, 2024
1 parent db540fe commit 567ef5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions misp_stix_converter/misp2stix/misp_to_stix21.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ def _parse_event_data(self):
list(object_refs) if object_refs
else self._handle_empty_note_refs()
)
if any(ref.startswith('x-misp-') for ref in note_args['object_refs']):
note_args['allow_custom'] = True
self._append_SDO(Note(**note_args))
else:
self._id_parsing_function = {
Expand Down

0 comments on commit 567ef5a

Please sign in to comment.