Skip to content

Commit

Permalink
remove duplicated get_findings
Browse files Browse the repository at this point in the history
  • Loading branch information
marwinbaumannsbp committed Dec 4, 2023
1 parent 3340bdb commit 4ae7930
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions awsfindingsmanagerlib/awsfindingsmanagerlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ def measurement_data(self):
'Days Open': self.days_open
}


class FindingsManager:
"""Models security hub and can retrieve findings."""

Expand Down Expand Up @@ -346,18 +345,6 @@ def _get_aggregating_region(self):
self._logger.debug('Could not get aggregating region, either not set, or a client error')
return aggregating_region

def get_findings(self, query_filter):
"""Retrieves findings from security hub based on a provided query.
Args:
query_filter (dict): The query filter to execute on security hub to get the findings.
Returns:
findings (list): A list of findings from security hub.
"""
return self._get_findings(query_filter)

@retry(retry_on_exceptions=botocore.exceptions.ClientError)
def _get_findings(self, query_filter):
findings = set()
Expand Down Expand Up @@ -431,9 +418,17 @@ def calculate_query_filter(query_filter=DEFAULT_SECURITY_HUB_FILTER,
query_filter.update({'AwsAccountId': aws_account_ids})
return query_filter

def get_findings(self):
pass
# run get findings with default filter
def get_findings(self, query_filter):
"""Retrieves findings from security hub based on a provided query.
Args:
query_filter (dict): The query filter to execute on security hub to get the findings.
Returns:
findings (list): A list of findings from security hub.
"""
return self._get_findings(query_filter)

def get_findings_by_rule_id(self):
pass
Expand Down

0 comments on commit 4ae7930

Please sign in to comment.