

# 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
<a name="API_DescribeImageScanFindings_RequestSyntax"></a>

```
{
   "imageId": { 
      "imageDigest": "{{string}}",
      "imageTag": "{{string}}"
   },
   "maxResults": {{number}},
   "nextToken": "{{string}}",
   "registryId": "{{string}}",
   "repositoryName": "{{string}}",
   "repositoryType": "{{string}}"
}
```

## Request Parameters
<a name="API_DescribeImageScanFindings_RequestParameters"></a>

For information about the parameters that are common to all actions, see [Common Parameters](CommonParameters.md).

The request accepts the following data in JSON format.

 ** [imageId](#API_DescribeImageScanFindings_RequestSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-request-imageId"></a>
The image ID of the image to describe scan findings for.  
Type: [ImageIdentifier](API_ImageIdentifier.md) object  
Required: Yes

 ** [maxResults](#API_DescribeImageScanFindings_RequestSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-request-maxResults"></a>
The maximum number of results that `DescribeImageScanFindings` returns in paginated output. When you use this parameter, `DescribeImageScanFindings` returns only `maxResults` results in a single page along with a `nextToken` response element. To see the remaining results, send another `DescribeImageScanFindings` request with the returned `nextToken` value. You can specify a value between 1 and 100. If you don't use this parameter, `DescribeImageScanFindings` returns up to 100 results and a `nextToken` value, if applicable.  
Type: Integer  
Valid Range: Minimum value of 1. Maximum value of 100.  
Required: No

 ** [nextToken](#API_DescribeImageScanFindings_RequestSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-request-nextToken"></a>
The `nextToken` value that's returned from a previous paginated `DescribeImageScanFindings` request where you used `maxResults` and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the `nextToken` value. If there are no more results to return, this value is `null`.  
This 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](#API_DescribeImageScanFindings_RequestSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-request-registryId"></a>
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](#API_DescribeImageScanFindings_RequestSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-request-repositoryName"></a>
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](#API_DescribeImageScanFindings_RequestSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-request-repositoryType"></a>
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 uses `FREE`, and the request fails with `ValidationException`.  
Type: String  
Valid Values: `FREE | PREMIUM`   
Required: No

## Response Syntax
<a name="API_DescribeImageScanFindings_ResponseSyntax"></a>

```
{
   "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
<a name="API_DescribeImageScanFindings_ResponseElements"></a>

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](#API_DescribeImageScanFindings_ResponseSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-response-imageId"></a>
The image ID that's associated with the request.  
Type: [ImageIdentifier](API_ImageIdentifier.md) object

 ** [imageScanFindings](#API_DescribeImageScanFindings_ResponseSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-response-imageScanFindings"></a>
The information about the last completed image scan.  
Type: [ImageScanFindings](API_ImageScanFindings.md) object

 ** [imageScanStatus](#API_DescribeImageScanFindings_ResponseSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-response-imageScanStatus"></a>
The current state of the scan.  
Type: [ImageScanStatus](API_ImageScanStatus.md) object

 ** [nextToken](#API_DescribeImageScanFindings_ResponseSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-response-nextToken"></a>
The `nextToken` value to include in a future `DescribeImageScanFindings` request. When the results of a `DescribeImageScanFindings` request exceed `maxResults`, you can use this value to retrieve the next page of results. If there are no more results to return, this value is `null`.  
Type: String

 ** [registryId](#API_DescribeImageScanFindings_ResponseSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-response-registryId"></a>
The registry ID that's associated with the request.  
Type: String  
Pattern: `[0-9]{12}` 

 ** [repositoryName](#API_DescribeImageScanFindings_ResponseSyntax) **   <a name="ecrpublic-DescribeImageScanFindings-response-repositoryName"></a>
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
<a name="API_DescribeImageScanFindings_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** 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 `DescribeImages` or `DescribeImageTags`, or for a premium repository that you're entitled to, `DescribeEntitledImages` or `DescribeEntitledImageTags`.    
 ** 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
<a name="API_DescribeImageScanFindings_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/ecr-public-2020-10-30/DescribeImageScanFindings) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/ecr-public-2020-10-30/DescribeImageScanFindings) 
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/ecr-public-2020-10-30/DescribeImageScanFindings) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/ecr-public-2020-10-30/DescribeImageScanFindings) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/ecr-public-2020-10-30/DescribeImageScanFindings) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/ecr-public-2020-10-30/DescribeImageScanFindings) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/ecr-public-2020-10-30/DescribeImageScanFindings) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/ecr-public-2020-10-30/DescribeImageScanFindings) 
+  [AWS SDK for Python (Boto3)](https://docs.aws.amazon.com/goto/boto3/ecr-public-2020-10-30/DescribeImageScanFindings) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/ecr-public-2020-10-30/DescribeImageScanFindings) 