nccgroup/ScoutSuite

Improve error handling across all resources

Open

#873 geöffnet am 23. Sept. 2020

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (1 zugewiesene Person)Python (978 Forks)batch import
component-provider-alibabacomponent-provider-awscomponent-provider-azurecomponent-provider-gcpcomponent-provider-ocienhancementgood first issue

Repository-Metriken

Stars
 (5.904 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

Currently, facades implement good exception handling, but resource parsing does not. That means that for a given resource type, if parsing fails for any given resource, the fetch_all method fails and stops, hence not parsing any additional resources.

All resources should be reviewed and updated, to ensure they handle parsing errors.

e.g., for AWS IAM roles (https://github.com/nccgroup/ScoutSuite/blob/master/ScoutSuite/providers/aws/resources/iam/roles.py#L8) the method should be updated as so:

for raw_role in raw_roles:
    try:
        name, resource = self._parse_role(raw_role)
        self[name] = resource
    except Exception as e:
        print_exception('Failed to parse {} resource: {}'.format(self.__class__.__name__, e))

Contributor Guide