Skip to content

Commit dfd7d8d

Browse files
committed
refactor: remove unnecessary references to x_mitre_data_sources
1 parent 52ae062 commit dfd7d8d

4 files changed

Lines changed: 2 additions & 31 deletions

File tree

examples/get_datacomponents_detecting_technique.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

mitreattack/stix20/custom_attack_objects.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ class DataComponent(CustomStixObject, object):
233233
234234
Custom Properties
235235
-----------------
236-
x_mitre_data_source_ref: str
237236
x_mitre_log_sources: list[object]
238237
"""
239238

tests/changelog/conftest.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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"

tests/changelog/core/test_missing_functions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ def test_get_relative_data_component_url_real_generation(self, mock_stix_object_
7272
"x_mitre_version": "1.0",
7373
"created": "2023-01-01T00:00:00.000Z",
7474
"modified": "2023-01-01T00:00:00.000Z",
75-
"x_mitre_data_source_ref": "x-mitre-data-source--test-id",
7675
}
7776

7877
# Test real URL generation

0 commit comments

Comments
 (0)