get_findings
¶
get_findings(
*,
config_overrides: Optional[SecurityHubClientConfig] = 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.
>>> client.get_findings(filters={'AwsAccountId': [{'Value': '123456789012', 'Comparison': 'PREFIX'}]}, max_results=1)
Source code in docs_src/capo_securityhub/_services/security_hub.py
4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 | |