Returns a list of image scan findings for your account. Amazon Inspector generates the findings when it scans images that have scanning enabled.
Parameters:
-
filters
(Optional[ImageScanFindingsFilterList], default:
None
)
–
An array of name value pairs that you can use to filter your results. You can use the following filters to streamline results:
-
imageBuildVersionArn – Filters findings by the image build version that was scanned.
-
imagePipelineArn – Filters findings by the pipeline that created the scanned image.
-
vulnerabilityId – Filters findings by vulnerability ID, for example a CVE ID.
-
severity – Filters findings by severity level.
If you don't request a filter, then all findings in your account are listed.
-
max_results
(Optional[RestrictedInteger], default:
None
)
–
The maximum number of items to return in a single request.
-
next_token
(Optional[PaginationToken], default:
None
)
–
A token to specify where to start paginating. Use the nextToken value from a previously truncated response.
Raises:
-
CallRateLimitExceededException
–
You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.
-
ClientException
–
A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.
-
ForbiddenException
–
You are not authorized to perform the requested operation.
-
InvalidPaginationTokenException
–
You have provided an invalid pagination token in your request.
-
InvalidRequestException
–
The request is malformed or otherwise invalid. Verify the request and try again.
-
ServiceException
–
An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.
-
ServiceUnavailableException
–
The service is unable to process your request at this time.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Examples:
List vulnerability findings for an image build
The following example lists the vulnerability findings that Amazon Inspector detected for the specified image build version.
>>> await client.list_image_scan_findings(filters=[{'name': 'imageBuildVersionArn', 'values': ['arn:aws:imagebuilder:us-west-2:111122223333:image/my-example-recipe/1.0.0/1']}])
Source code in docs_src/capo_imagebuilder/_services/async_imagebuilder.py
| async def list_image_scan_findings(
self,
*,
config_overrides: Optional[AsyncimagebuilderClientConfig] = None,
filters: Optional[
"capo_imagebuilder.types.image_scan_findings_filter_list.ImageScanFindingsFilterList"
] = None,
max_results: Optional[
"capo_imagebuilder.types.restricted_integer.RestrictedInteger"
] = None,
next_token: Optional[
"capo_imagebuilder.types.pagination_token.PaginationToken"
] = None,
) -> "capo_imagebuilder.types.list_image_scan_findings_response.ListImageScanFindingsResponse":
"""<p>Returns a list of image scan findings for your account. Amazon Inspector generates the findings when it scans images that have scanning enabled.</p>
Args:
filters: <p>An array of name value pairs that you can use to filter your results. You can use the following filters to streamline results:</p> <ul> <li> <p> <code>imageBuildVersionArn</code> – Filters findings by the image build version that was scanned.</p> </li> <li> <p> <code>imagePipelineArn</code> – Filters findings by the pipeline that created the scanned image.</p> </li> <li> <p> <code>vulnerabilityId</code> – Filters findings by vulnerability ID, for example a CVE ID.</p> </li> <li> <p> <code>severity</code> – Filters findings by severity level.</p> </li> </ul> <p>If you don't request a filter, then all findings in your account are listed.</p>
max_results: <p>The maximum number of items to return in a single request.</p>
next_token: <p>A token to specify where to start paginating. Use the <code>nextToken</code> value from a previously truncated response.</p>
Raises:
capo_imagebuilder.errors.call_rate_limit_exceeded_exception.CallRateLimitExceededException: <p>You have exceeded the permitted request rate for the Amazon EC2 APIs that Image Builder calls on your behalf. Retry with an increasing or variable delay between requests.</p>
capo_imagebuilder.errors.client_exception.ClientException: <p>A generic client error. This error usually indicates that the request failed a validation check, such as when a downstream service rejects a configured value.</p>
capo_imagebuilder.errors.forbidden_exception.ForbiddenException: <p>You are not authorized to perform the requested operation.</p>
capo_imagebuilder.errors.invalid_pagination_token_exception.InvalidPaginationTokenException: <p>You have provided an invalid pagination token in your request.</p>
capo_imagebuilder.errors.invalid_request_exception.InvalidRequestException: <p>The request is malformed or otherwise invalid. Verify the request and try again.</p>
capo_imagebuilder.errors.service_exception.ServiceException: <p>An internal server error occurred while Image Builder processed the request. Retrying the request may succeed.</p>
capo_imagebuilder.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service is unable to process your request at this time.</p>
capo_imagebuilder.errors.UnknownServiceError: The service returned an error code this client does not model.
Examples:
List vulnerability findings for an image build
The following example lists the vulnerability findings that Amazon Inspector detected for the specified image build version.
>>> await client.list_image_scan_findings(filters=[{'name': 'imageBuildVersionArn', 'values': ['arn:aws:imagebuilder:us-west-2:111122223333:image/my-example-recipe/1.0.0/1']}])
"""
async def _handler(
req: "AsyncOperationRequest[capo_imagebuilder.types.list_image_scan_findings_request.ListImageScanFindingsRequest]",
) -> AsyncOperationResponse[
"capo_imagebuilder.types.list_image_scan_findings_response.ListImageScanFindingsResponse"
]:
import capo_imagebuilder._operations.imagebuilder.list_image_scan_findings
(
output,
http_response,
) = await capo_imagebuilder._operations.imagebuilder.list_image_scan_findings.async_list_image_scan_findings(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ListImageScanFindings")
)
input_: capo_imagebuilder.types.list_image_scan_findings_request.ListImageScanFindingsRequest = {}
if filters is not None:
input_["filters"] = filters
if max_results is not None:
input_["max_results"] = max_results
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|