@@ -849,6 +849,13 @@ def __init__(self, config: Dict, playbook_compatible=False) -> None:
849849 False ,
850850 True ,
851851 )
852+ self .keep_original_id = get_config_variable (
853+ "CONNECTOR_KEEP_ORIGINAL_ID" ,
854+ ["connector" , "keep_original_id" ],
855+ config ,
856+ False ,
857+ False ,
858+ )
852859 self .bundle_send_to_directory = get_config_variable (
853860 "CONNECTOR_SEND_TO_DIRECTORY" ,
854861 ["connector" , "send_to_directory" ],
@@ -1571,6 +1578,7 @@ def send_stix2_bundle(self, bundle: str, **kwargs) -> list:
15711578 file_name = kwargs .get ("file_name" , None )
15721579 bundle_send_to_queue = kwargs .get ("send_to_queue" , self .bundle_send_to_queue )
15731580 cleanup_inconsistent_bundle = kwargs .get ("cleanup_inconsistent_bundle" , False )
1581+ keep_original_id = kwargs .get ("keep_original_id" , self .keep_original_id )
15741582 bundle_send_to_directory = kwargs .get (
15751583 "send_to_directory" , self .bundle_send_to_directory
15761584 )
@@ -1581,6 +1589,11 @@ def send_stix2_bundle(self, bundle: str, **kwargs) -> list:
15811589 "send_to_directory_retention" , self .bundle_send_to_directory_retention
15821590 )
15831591
1592+ # Bundle ids must be rewritten
1593+ bundle = self .api .stix2 .prepare_bundle_ids (
1594+ bundle = bundle , use_json = True , keep_original_id = keep_original_id
1595+ )
1596+
15841597 # In case of enrichment ingestion, ensure the sharing if needed
15851598 if self .enrichment_shared_organizations is not None :
15861599 # Every element of the bundle must be enriched with the same organizations
0 commit comments