@@ -340,9 +340,7 @@ def _add_campaign_fields(obj, attack_id, aliases):
340340 def _add_custom_mitre_fields (obj , attack_id , object_type ):
341341 """Add fields for custom MITRE object types."""
342342 # These objects have varying structures - add basic fields
343- if object_type == "x-mitre-data-component" :
344- obj ["x_mitre_data_source_ref" ] = f"x-mitre-data-source--{ uuid .uuid4 ()} "
345- elif object_type == "x-mitre-tactic" :
343+ if object_type == "x-mitre-tactic" :
346344 obj ["x_mitre_shortname" ] = attack_id .lower () if attack_id else "test-tactic"
347345
348346 def _generate_external_references (attack_id , object_type , is_subtechnique ):
@@ -1240,7 +1238,6 @@ def minimal_stix_bundles(mock_stix_object_factory, mock_relationship_factory):
12401238 stix_type = "x-mitre-data-component" ,
12411239 obj_type = "x-mitre-data-component" ,
12421240 )
1243- old_datacomponent1 ["x_mitre_data_source_ref" ] = old_datasource1 ["id" ]
12441241
12451242 old_datacomponent2 = mock_stix_object_factory (
12461243 name = "Data Component To Be Modified" ,
@@ -1249,7 +1246,6 @@ def minimal_stix_bundles(mock_stix_object_factory, mock_relationship_factory):
12491246 stix_type = "x-mitre-data-component" ,
12501247 obj_type = "x-mitre-data-component" ,
12511248 )
1252- old_datacomponent2 ["x_mitre_data_source_ref" ] = old_datasource2 ["id" ]
12531249
12541250 # Assets (2)
12551251 old_asset1 = mock_stix_object_factory (
@@ -1293,7 +1289,7 @@ def minimal_stix_bundles(mock_stix_object_factory, mock_relationship_factory):
12931289 new_campaign1 = old_campaign1 .copy () # Unchanged
12941290 new_mitigation1 = old_mitigation1 .copy () # Unchanged
12951291 new_datasource1 = old_datasource1 .copy () # Unchanged
1296- new_datacomponent1 = old_datacomponent1 .copy () # Unchanged (includes x_mitre_data_source_ref)
1292+ new_datacomponent1 = old_datacomponent1 .copy () # Unchanged
12971293 new_asset1 = old_asset1 .copy () # Unchanged
12981294
12991295 # Modified objects (version changes)
@@ -1313,7 +1309,6 @@ def minimal_stix_bundles(mock_stix_object_factory, mock_relationship_factory):
13131309 new_datacomponent2_modified = old_datacomponent2 .copy ()
13141310 new_datacomponent2_modified ["x_mitre_version" ] = "1.1"
13151311 new_datacomponent2_modified ["modified" ] = "2025-01-15T12:00:00.000Z"
1316- new_datacomponent2_modified ["x_mitre_data_source_ref" ] = new_datasource2_modified ["id" ]
13171312
13181313 new_asset2_modified = old_asset2 .copy ()
13191314 new_asset2_modified ["x_mitre_version" ] = "1.1"
0 commit comments