get_findings_v2
¶
get_findings_v2(
*,
config_overrides: Optional[SecurityHubClientConfig] = None,
filters: Optional[OcsfFindingFilters] = None,
scopes: Optional[FindingScopes] = None,
sort_criteria: Optional[SortCriteria] = None,
next_token: Optional[NextToken] = None,
max_results: Optional[MaxResults] = None,
) -> GetFindingsV2Response
Returns a list of findings that match the specified criteria.
You can use the Scopes parameter to define the data boundary for the query. Currently, Scopes supports AwsOrganizations, which lets you retrieve findings from your entire organization or from specific organizational units. Only the delegated administrator account can use Scopes.
You can use the Filters parameter to refine results based on finding attributes. You can use Scopes and Filters independently or together. When both are provided, Scopes narrows the data set first, and then Filters refines results within that scoped data set.
GetFindings and GetFindingsV2 both use securityhub:GetFindings in the Action element of an IAM policy statement. You must have permission to perform the securityhub:GetFindings action.
Parameters:
-
filters(Optional[OcsfFindingFilters], default:None) –The finding attributes used to define a condition to filter the returned OCSF findings. You can filter up to 10 composite filters. For each filter type inside of a composite filter, you can provide up to 20 filters.
-
scopes(Optional[FindingScopes], default:None) –Limits the results to findings from specific organizational units or from the delegated administrator's organization. Only the delegated administrator account can use this parameter. Other accounts receive an
AccessDeniedException.This parameter is optional. If you omit it, the delegated administrator sees findings from all accounts across the entire organization. Other accounts see only their own findings.
You can specify up to 10 entries in
Scopes.AwsOrganizations. If multiple entries are specified, the entries are combined using OR logic. -
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 required for pagination. On your first call, set the value of this parameter to
NULL. For subsequent calls, to continue listing data, set the value of this parameter to the value returned in the previous response. -
max_results(Optional[MaxResults], default:None) –The maximum number of results to return.
Raises:
-
AccessDeniedException–You don't have permission to perform the action specified in the request.
-
ConflictException–The request causes conflict with the current state of the service resource.
-
InternalServerException–The request has failed due to an internal failure of the service.
-
OrganizationalUnitNotFoundException–The request failed because one or more organizational units specified in the request don't exist within the caller's organization.
-
OrganizationNotFoundException–The request failed because one or more organizations specified in the request don't exist or don't belong to the caller's organization.
-
ThrottlingException–The limit on the number of requests per second was exceeded.
-
ValidationException–The request has failed validation because it's missing required fields or has invalid inputs.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_securityhub/_services/security_hub.py
5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 | |