Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename enrich_data_source function to enrich_techniques_data_sources in get_enterprise_techniques #42

Closed
Cyb3rWard0g opened this issue Jan 19, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@Cyb3rWard0g
Copy link
Collaborator

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`

@Cyb3rWard0g Cyb3rWard0g added the bug Something isn't working label Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant