How to use the pyattck.mitigation.AttckMitigation function in pyattck

To help you get started, we’ve selected a few pyattck examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github swimlane / pyattck / pyattck / pyattck.py View on Github external
def mitigations(self):
        """Creates AttckMitigation objects
        
        Returns:
            (AttckMitigation) -- (Returns a list of AttckMitigation objects)
        """
        mitigation_list = []
        for mitigation in self.attck['objects']:
            if mitigation['type'] == 'course-of-action':
                mitigation_list.append(AttckMitigation(attck_obj=self.attck, **mitigation))
        return mitigation_list
github swimlane / pyattck / pyattck / mitigation.py View on Github external
def __init__(self, attck_obj = None, **kwargs):
        """Creates an AttckTactic object.  
           The AttckMitigation object is considered a list of mitigations to threats based on the Mitre ATT&CK Framework
        """

        self.attck_obj = attck_obj
        
        self.created_by_ref = super(AttckMitigation, self)._set_attribute(kwargs, 'created_by_ref')
        self.id = super(AttckMitigation, self)._set_id(kwargs)
        self.name = super(AttckMitigation, self)._set_attribute(kwargs, 'name')
        self.description = super(AttckMitigation, self)._set_attribute(kwargs, 'description')
        self.external_reference = super(AttckMitigation, self)._set_reference(kwargs)
        self.created = super(AttckMitigation, self)._set_attribute(kwargs, 'created')
        self.modified = super(AttckMitigation, self)._set_attribute(kwargs, 'modified')
        self.stix = super(AttckMitigation, self)._set_attribute(kwargs, 'id')
        self.type = super(AttckMitigation, self)._set_attribute(kwargs, 'type')
        self.wiki = super(AttckMitigation, self)._set_wiki(kwargs)
github swimlane / pyattck / pyattck / technique.py View on Github external
def mitigation(self):
        '''Returns all mitigation objects as a list that are documented to help mitigate the current technique object'''
        from .mitigation import AttckMitigation
        mitigation_list = []
        for item in self.attck_obj['objects']:
            if 'relationship_type' in item:
                if 'mitigates' in item['relationship_type']:
                    if self.stix in item['target_ref']:
                        for o in self.attck_obj['objects']:
                            if item['source_ref'] in o['id']:
                                mitigation_list.append(AttckMitigation(**o))
        return mitigation_list

pyattck

A Python package to interact with the Mitre ATT&CK Frameworks

MIT
Latest version published 2 years ago

Package Health Score

45 / 100
Full package analysis