Skip to content

Commit 28a009e

Browse files
authored
Merge pull request #77 from Cyb3rWard0g/master
Updated Type Annotations and Docstrings
2 parents 0ccccbf + debe6ca commit 28a009e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

attackcti/attack_api.py

+12-7
Original file line numberDiff line numberDiff line change
@@ -1437,16 +1437,21 @@ def get_techniques_by_content(self, content: str, stix_format: bool = True) -> L
14371437
return matched_techniques
14381438

14391439

1440-
def get_techniques_by_platform(self, name, case=True, stix_format=True ):
1441-
""" Extracts techniques STIX object by platform across all ATT&CK matrices
1440+
def get_techniques_by_platform(self, name: str, case: bool = True, stix_format: bool = True) -> List:
1441+
"""
1442+
Retrieves techniques STIX objects associated with a specific platform across all ATT&CK matrices.
1443+
The search can be case-sensitive or case-insensitive.
14421444
14431445
Args:
1444-
case (bool) : case sensitive or not
1445-
stix_format (bool): Returns results in original STIX format or friendly syntax (e.g. 'attack-pattern' or 'technique')
1446-
1446+
name (str): The name of the platform to search for within the technique's platform.
1447+
case (bool, optional): Determines if the search should be case sensitive. Default is True.
1448+
stix_format (bool, optional): If True, returns technique objects in their original STIX format. If False,
1449+
returns techniques as custom dictionaries parsed according to the Technique Pydantic model.
1450+
Default is True.
1451+
14471452
Returns:
1448-
List of STIX objects
1449-
1453+
List: A list containing the matched technique objects, either as raw STIX objects or as custom dictionaries
1454+
following the structure defined by the Technique Pydantic model, depending on the 'stix_format' flag.
14501455
"""
14511456
if not case:
14521457
all_techniques = self.get_techniques()

0 commit comments

Comments
 (0)