@@ -115,40 +115,3 @@ def getUniqueGroups(
115
115
for enrichment in enrichments :
116
116
group_set .update (set (enrichment .mitre_attack_group_objects ))
117
117
return sorted (group_set )
118
-
119
- @staticmethod
120
- def checkParentTypeNotDefinedWhenSubtypeDefined (
121
- enrichments : list [MitreAttackEnrichment ],
122
- ) -> None :
123
- # Get all the mitre_attack_ids
124
- mitre_attack_ids = [enrichment .mitre_attack_id for enrichment in enrichments ]
125
- # Split these into two groups - one that just has parents and one which has subtypes as well
126
- mitre_attack_id_parents = [
127
- mitre_attack_id
128
- for mitre_attack_id in mitre_attack_ids
129
- if "." not in mitre_attack_id
130
- ]
131
- mitre_attack_id_subtypes = [
132
- mitre_attack_id
133
- for mitre_attack_id in mitre_attack_ids
134
- if "." in mitre_attack_id
135
- ]
136
-
137
- subtype_and_parent_exist_exceptions : list [Exception ] = []
138
-
139
- for mitre_attack_id in mitre_attack_id_subtypes :
140
- parent_id = mitre_attack_id .split ("." )[0 ]
141
- if parent_id in mitre_attack_id_parents :
142
- subtype_and_parent_exist_exceptions .append (
143
- Exception (
144
- f"Overlapping parent and subtype tactic: [Parent: '{ parent_id } ', Subtype: '{ mitre_attack_id } ']"
145
- )
146
- )
147
- if len (subtype_and_parent_exist_exceptions ):
148
- raise ExceptionGroup (
149
- "Error: both MITRE Attack ID Subtype and Parent are defined. "
150
- "A parent tactic OR a subtype tactic may be defined, but not both" ,
151
- subtype_and_parent_exist_exceptions ,
152
- )
153
-
154
- return None
0 commit comments