File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 33
33
SecurityContentProductName ,
34
34
SecurityDomain ,
35
35
)
36
- from contentctl .objects .mitre_attack_enrichment import MitreAttackEnrichment
36
+ from contentctl .objects .mitre_attack_enrichment import MitreAttackEnrichment , MitreAttackGroup
37
37
38
38
39
39
class DetectionTags (BaseModel ):
@@ -68,6 +68,13 @@ def kill_chain_phases(self) -> list[KillChainPhase]:
68
68
phases .add (phase )
69
69
return sorted (list (phases ))
70
70
71
+ @property
72
+ def unique_mitre_attack_groups (self )-> list [MitreAttackGroup ]:
73
+ group_set : set [MitreAttackGroup ] = set ()
74
+ for enrichment in self .enrichments :
75
+ group_set .update (set (enrichment .mitre_attack_group_objects ))
76
+ return sorted (group_set , lambda k : k .group )
77
+
71
78
# enum is intentionally Cis18 even though field is named cis20 for legacy reasons
72
79
@computed_field
73
80
@property
Original file line number Diff line number Diff line change @@ -106,12 +106,3 @@ class MitreAttackEnrichment(BaseModel):
106
106
107
107
def __hash__ (self ) -> int :
108
108
return id (self )
109
-
110
- @staticmethod
111
- def getUniqueGroups (
112
- enrichments : list [MitreAttackEnrichment ],
113
- ) -> list [MitreAttackGroup ]:
114
- group_set : set [MitreAttackGroup ] = set ()
115
- for enrichment in enrichments :
116
- group_set .update (set (enrichment .mitre_attack_group_objects ))
117
- return sorted (group_set )
You can’t perform that action at this time.
0 commit comments