DescribeImageScanFindings
Returns the scan status and vulnerability findings for an image in a premium repository. Images in premium repositories are scanned automatically when they're pushed, and are rescanned as new vulnerabilities are published. Image scanning isn't currently supported for free repositories.
Request Syntax
{
"imageId": {
"imageDigest": "string",
"imageTag": "string"
},
"maxResults": number,
"nextToken": "string",
"registryId": "string",
"repositoryName": "string",
"repositoryType": "string"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- imageId
-
The image ID of the image to describe scan findings for.
Type: ImageIdentifier object
Required: Yes
- maxResults
-
The maximum number of results that
DescribeImageScanFindingsreturns in paginated output. When you use this parameter,DescribeImageScanFindingsreturns onlymaxResultsresults in a single page along with anextTokenresponse element. To see the remaining results, send anotherDescribeImageScanFindingsrequest with the returnednextTokenvalue. You can specify a value between 1 and 100. If you don't use this parameter,DescribeImageScanFindingsreturns up to 100 results and anextTokenvalue, if applicable.Type: Integer
Valid Range: Minimum value of 1. Maximum value of 100.
Required: No
- nextToken
-
The
nextTokenvalue that's returned from a previous paginatedDescribeImageScanFindingsrequest where you usedmaxResultsand the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned thenextTokenvalue. If there are no more results to return, this value isnull.NoteThis token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.
Type: String
Required: No
- registryId
-
The AWS account ID that's associated with the public registry that contains the repository where the image is. If you do not specify a registry, the default public registry is assumed. You can specify only your own account ID. Cross-account access through a repository policy isn't supported for this operation.
Type: String
Pattern:
[0-9]{12}Required: No
- repositoryName
-
The repository that contains the image to describe scan findings for.
Type: String
Length Constraints: Minimum length of 2. Maximum length of 205.
Pattern:
[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*(\/[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*)*Required: Yes
- repositoryType
-
The type of the repository. Currently, image scanning is supported only for premium repositories, so you must specify
PREMIUM. If you don't specify a type, Amazon ECR usesFREE, and the request fails withValidationException.Type: String
Valid Values:
FREE | PREMIUMRequired: No
Response Syntax
{
"imageId": {
"imageDigest": "string",
"imageTag": "string"
},
"imageScanFindings": {
"findings": [
{
"awsAccountId": "string",
"description": "string",
"exploitAvailable": "string",
"findingId": "string",
"firstObservedAt": number,
"fixAvailable": "string",
"lastObservedAt": number,
"packageVulnerabilityDetails": {
"cvss": [
{
"baseScore": number,
"scoringVector": "string",
"source": "string",
"version": "string"
}
],
"referenceUrls": [ "string" ],
"relatedVulnerabilities": [ "string" ],
"source": "string",
"sourceUrl": "string",
"vendorCreatedAt": number,
"vendorSeverity": "string",
"vendorUpdatedAt": number,
"vulnerabilityId": "string",
"vulnerablePackages": [
{
"arch": "string",
"epoch": number,
"filePath": "string",
"fixedInVersion": "string",
"name": "string",
"packageManager": "string",
"release": "string",
"sourceLayerHash": "string",
"version": "string"
}
]
},
"remediation": {
"recommendation": {
"text": "string",
"url": "string"
}
},
"resources": [
{
"details": {
"containerImage": {
"architecture": "string",
"author": "string",
"imageHash": "string",
"imageTags": [ "string" ],
"platform": "string",
"pushedAt": number,
"registry": "string",
"repositoryName": "string"
}
},
"type": "string"
}
],
"score": number,
"scoreDetails": {
"cvss": {
"adjustments": [
{
"metric": "string",
"reason": "string"
}
],
"score": number,
"scoreSource": "string",
"scoringVector": "string",
"version": "string"
}
},
"severity": "string",
"status": "string",
"title": "string",
"type": "string",
"updatedAt": number
}
],
"findingSeverityCounts": {
"string" : number
},
"imageScanCompletedAt": number,
"vulnerabilitySourceUpdatedAt": number
},
"imageScanStatus": {
"description": "string",
"status": "string"
},
"nextToken": "string",
"registryId": "string",
"repositoryName": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- imageId
-
The image ID that's associated with the request.
Type: ImageIdentifier object
- imageScanFindings
-
The information about the last completed image scan.
Type: ImageScanFindings object
- imageScanStatus
-
The current state of the scan.
Type: ImageScanStatus object
- nextToken
-
The
nextTokenvalue to include in a futureDescribeImageScanFindingsrequest. When the results of aDescribeImageScanFindingsrequest exceedmaxResults, you can use this value to retrieve the next page of results. If there are no more results to return, this value isnull.Type: String
- registryId
-
The registry ID that's associated with the request.
Type: String
Pattern:
[0-9]{12} - repositoryName
-
The repository name that's associated with the request.
Type: String
Length Constraints: Minimum length of 2. Maximum length of 205.
Pattern:
[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*(\/[a-z0-9]+((\.|_|__|-+)[a-z0-9]+)*)*
Errors
For information about the errors that are common to all actions, see Common Error Types.
- ImageNotFoundException
-
The image requested doesn't exist in the specified repository. Check the image tag or digest. To list the images in a repository, use
DescribeImagesorDescribeImageTags, or for a premium repository that you're entitled to,DescribeEntitledImagesorDescribeEntitledImageTags.- message
-
The error message associated with the exception.
HTTP Status Code: 400
- InvalidParameterException
-
The specified parameter is invalid. Review the available parameters for the API request.
- message
-
The error message associated with the exception.
HTTP Status Code: 400
- RepositoryNotFoundException
-
The specified repository can't be found. Check the spelling of the specified repository and ensure that you're performing operations on the correct registry.
- message
-
The error message associated with the exception.
HTTP Status Code: 400
- ScanNotFoundException
-
The specified image scan can't be found. Make sure that the image has been scanned.
- message
-
The error message associated with the exception.
HTTP Status Code: 400
- ServerException
-
These errors are usually caused by a server-side issue. Retry the request. If it continues to fail, contact AWS Support.
- message
-
The error message associated with the exception.
HTTP Status Code: 500
- ValidationException
-
There was an error validating the request. Check the request parameters and try again.
- message
-
The error message associated with the exception.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: