Skip to content

Rename enrich_data_source function to enrich_techniques_data_sources in get_enterprise_techniques #42

@Cyb3rWard0g

Description

@Cyb3rWard0g

Current get_enterprise_techniques()

 def get_enterprise_techniques(self, skip_revoked_deprecated=True, include_subtechniques=True, enrich_data_sources = False, stix_format=True):
        """ Extracts all the available techniques STIX objects in the Enterprise ATT&CK matrix
        Args:
            skip_revoked_deprecated (bool): default True. Skip revoked and deprecated STIX objects. 
            include_subtechniques (bool): default True. Include techniques and sub-techniques STIX objects.
            enrich_data_sources (bool): default False. Adds data component and data source context to each technqiue.
            stix_format (bool):  Returns results in original STIX format or friendly syntax (e.g. 'attack-pattern' or 'technique')
        
        Returns:
            List of STIX objects
        """
        
        if include_subtechniques:
            enterprise_techniques = self.TC_ENTERPRISE_SOURCE.query(Filter("type", "=", "attack-pattern"))
        else:
            enterprise_techniques = self.TC_ENTERPRISE_SOURCE.query([
                Filter("type", "=", "attack-pattern"),
                Filter('x_mitre_is_subtechnique', '=', False)
            ])

        if skip_revoked_deprecated:
            enterprise_techniques = self.remove_revoked_deprecated(enterprise_techniques)

        if enrich_data_sources:
            enterprise_techniques = self.enrich_data_sources(enterprise_techniques)
        
        if not stix_format:
            enterprise_techniques = self.translate_stix_objects(enterprise_techniques)
        return enterprise_techniques

The new parameter to enrich data sources is pointing to a function that does not exist by the name enrich_data_sources

 if enrich_data_sources:
            enterprise_techniques = self.enrich_data_sources(enterprise_techniques)

That function should be ``enrich_techniques_data_sources`

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions