[ aws . ecr ]

describe-image-scan-findings

Description

Returns the scan findings for the specified image.

See also: AWS API Documentation

See ‘aws help’ for descriptions of global parameters.

describe-image-scan-findings is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the --no-paginate argument. When using --output text and the --query argument on a paginated response, the --query argument must extract data from the results of the following query expressions: imageScanFindings.findings

Synopsis

  describe-image-scan-findings
[--registry-id <value>]
--repository-name <value>
--image-id <value>
[--cli-input-json | --cli-input-yaml]
[--starting-token <value>]
[--page-size <value>]
[--max-items <value>]
[--generate-cli-skeleton <value>]

Options

--registry-id (string)

The AWS account ID associated with the registry that contains the repository in which to describe the image scan findings for. If you do not specify a registry, the default registry is assumed.

--repository-name (string)

The repository for the image for which to describe the scan findings.

--image-id (structure)

An object with identifying information for an Amazon ECR image.

imageDigest -> (string)

The sha256 digest of the image manifest.

imageTag -> (string)

The tag used for the image.

Shorthand Syntax:

imageDigest=string,imageTag=string

JSON Syntax:

{
  "imageDigest": "string",
  "imageTag": "string"
}

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--starting-token (string)

A token to specify where to start paginating. This is the NextToken from a previously truncated response.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--page-size (integer)

The size of each page to get in the AWS service call. This does not affect the number of items returned in the command’s output. Setting a smaller page size results in more calls to the AWS service, retrieving fewer items in each call. This can help prevent the AWS service calls from timing out.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--max-items (integer)

The total number of items to return in the command’s output. If the total number of items available is more than the value specified, a NextToken is provided in the command’s output. To resume pagination, provide the NextToken value in the starting-token argument of a subsequent command. Do not use the NextToken response element directly outside of the AWS CLI.

For usage examples, see Pagination in the AWS Command Line Interface User Guide .

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

See ‘aws help’ for descriptions of global parameters.

Examples

To describe the scan findings for an image

The following describe-image-scan-findings example returns the image scan findings for an image using the image digest in the specified repository in the default registry for an account.

aws ecr describe-image-scan-findings \
    --repository-name sample-repo \
    --image-id imageDigest=sha256:74b2c688c700ec95a93e478cdb959737c148df3fbf5ea706abe0318726e885e6

Output:

{
    "imageScanFindings": {
      "findings": [
          {
              "name": "CVE-2019-5188",
              "description": "A code execution vulnerability exists in the directory rehashing functionality of E2fsprogs e2fsck 1.45.4. A specially crafted ext4 directory can cause an out-of-bounds write on the stack, resulting in code execution. An attacker can corrupt a partition to trigger this vulnerability.",
              "uri": "http://people.ubuntu.com/~ubuntu-security/cve/CVE-2019-5188",
              "severity": "MEDIUM",
              "attributes": [
                  {
                      "key": "package_version",
                      "value": "1.44.1-1ubuntu1.1"
                  },
                  {
                      "key": "package_name",
                      "value": "e2fsprogs"
                  },
                  {
                      "key": "CVSS2_VECTOR",
                      "value": "AV:L/AC:L/Au:N/C:P/I:P/A:P"
                  },
                  {
                      "key": "CVSS2_SCORE",
                      "value": "4.6"
                  }
              ]
          }
      ],
      "imageScanCompletedAt": 1579839105.0,
      "vulnerabilitySourceUpdatedAt": 1579811117.0,
      "findingSeverityCounts": {
          "MEDIUM": 1
      }
  },
  "registryId": "123456789012",
  "repositoryName": "sample-repo",
  "imageId": {
      "imageDigest": "sha256:74b2c688c700ec95a93e478cdb959737c148df3fbf5ea706abe0318726e885e6"
  },
  "imageScanStatus": {
      "status": "COMPLETE",
      "description": "The scan was completed successfully."
  }
}

For more information, see Image Scanning in the Amazon ECR User Guide.

Output

registryId -> (string)

The registry ID associated with the request.

repositoryName -> (string)

The repository name associated with the request.

imageId -> (structure)

An object with identifying information for an Amazon ECR image.

imageDigest -> (string)

The sha256 digest of the image manifest.

imageTag -> (string)

The tag used for the image.

imageScanStatus -> (structure)

The current state of the scan.

status -> (string)

The current state of an image scan.

description -> (string)

The description of the image scan status.

imageScanFindings -> (structure)

The information contained in the image scan findings.

imageScanCompletedAt -> (timestamp)

The time of the last completed image scan.

vulnerabilitySourceUpdatedAt -> (timestamp)

The time when the vulnerability data was last scanned.

findings -> (list)

The findings from the image scan.

(structure)

Contains information about an image scan finding.

name -> (string)

The name associated with the finding, usually a CVE number.

description -> (string)

The description of the finding.

uri -> (string)

A link containing additional details about the security vulnerability.

severity -> (string)

The finding severity.

attributes -> (list)

A collection of attributes of the host from which the finding is generated.

(structure)

This data type is used in the ImageScanFinding data type.

key -> (string)

The attribute key.

value -> (string)

The value assigned to the attribute key.

findingSeverityCounts -> (map)

The image vulnerability counts, sorted by severity.

key -> (string)

value -> (integer)

nextToken -> (string)

The nextToken value to include in a future DescribeImageScanFindings request. When the results of a DescribeImageScanFindings request exceed maxResults , this value can be used to retrieve the next page of results. This value is null when there are no more results to return.