Skip to content

Commit

Permalink
Merge pull request #77 from Cyb3rWard0g/master
Browse files Browse the repository at this point in the history
Updated Type Annotations and Docstrings
  • Loading branch information
Cyb3rWard0g committed Apr 1, 2024
2 parents 0ccccbf + debe6ca commit 28a009e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions attackcti/attack_api.py
Expand Up @@ -1437,16 +1437,21 @@ def get_techniques_by_content(self, content: str, stix_format: bool = True) -> L
return matched_techniques


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

0 comments on commit 28a009e

Please sign in to comment.