get_findings
async
¶
get_findings(
*,
config_overrides: Optional[AsyncSecurityHubClientConfig] = None,
filters: Optional[AwsSecurityFindingFilters] = None,
sort_criteria: Optional[SortCriteria] = None,
next_token: Optional[NextToken] = None,
max_results: Optional[MaxResults] = None,
) -> GetFindingsResponse
Returns a list of findings that match the specified criteria.
If cross-Region aggregation is enabled, then when you call GetFindings from the home Region, the results include all of the matching findings from both the home Region and linked Regions.
Parameters:
-
filters(Optional[AwsSecurityFindingFilters], default:None) –The finding attributes used to define a condition to filter the returned findings.
You can filter by up to 10 finding attributes. For each attribute, you can provide up to 20 filter values.
Note that in the available filter fields,
WorkflowStateis deprecated. To search for a finding based on its workflow status, useWorkflowStatus. -
sort_criteria(Optional[SortCriteria], default:None) –The finding attributes used to sort the list of returned findings.
-
next_token(Optional[NextToken], default:None) –The token that is required for pagination. On your first call to the
GetFindingsoperation, set the value of this parameter toNULL.For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.
-
max_results(Optional[MaxResults], default:None) –The maximum number of findings to return.
Raises:
-
InternalException–Internal server error.
-
InvalidAccessException–The account doesn't have permission to perform this action.
-
InvalidInputException–The request was rejected because you supplied an invalid or out-of-range value for an input parameter.
-
LimitExceededException–The request was rejected because it attempted to create resources beyond the current Amazon Web Services account or throttling limits. The error code describes the limit exceeded.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To get a list of findings The following example returns a filtered and sorted list of Security Hub findings.
>>> await client.get_findings(filters={'AwsAccountId': [{'Value': '123456789012', 'Comparison': 'PREFIX'}]}, max_results=1)
Source code in docs_src/capo_securityhub/_services/async_security_hub.py
4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 | |