Interface ImageScanningConfiguration.Builder

  • Method Details

    • imageScanningEnabled

      ImageScanningConfiguration.Builder imageScanningEnabled(Boolean imageScanningEnabled)

      Specifies whether Amazon Inspector scans for vulnerabilities when you create a new image. You must also enable image tests. For AMI output, imageScanningTypes sets whether Amazon Inspector scans the test instance or the output AMI. For container output, Amazon Inspector scans the container image that Image Builder pushes to the Amazon ECR repository from your ecrConfiguration settings.

      To use container image scans, you must activate Amazon Inspector for Amazon ECR scanning in your account. The Image Builder ListImageScanFindings operation returns the findings of these scans.

      Parameters:
      imageScanningEnabled - Specifies whether Amazon Inspector scans for vulnerabilities when you create a new image. You must also enable image tests. For AMI output, imageScanningTypes sets whether Amazon Inspector scans the test instance or the output AMI. For container output, Amazon Inspector scans the container image that Image Builder pushes to the Amazon ECR repository from your ecrConfiguration settings.

      To use container image scans, you must activate Amazon Inspector for Amazon ECR scanning in your account. The Image Builder ListImageScanFindings operation returns the findings of these scans.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • ecrConfiguration

      ImageScanningConfiguration.Builder ecrConfiguration(EcrConfiguration ecrConfiguration)

      Contains Amazon ECR settings for vulnerability scans.

      Parameters:
      ecrConfiguration - Contains Amazon ECR settings for vulnerability scans.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • ecrConfiguration

      default ImageScanningConfiguration.Builder ecrConfiguration(Consumer<EcrConfiguration.Builder> ecrConfiguration)

      Contains Amazon ECR settings for vulnerability scans.

      This is a convenience method that creates an instance of the EcrConfiguration.Builder avoiding the need to create one manually via EcrConfiguration.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to ecrConfiguration(EcrConfiguration).

      Parameters:
      ecrConfiguration - a consumer that will call methods on EcrConfiguration.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • imageScanningTypesWithStrings

      ImageScanningConfiguration.Builder imageScanningTypesWithStrings(Collection<String> imageScanningTypes)

      The type of vulnerability scan that Image Builder runs for AMI output when imageScanningEnabled is true. Specify a single value. If you omit imageScanningTypes, Image Builder uses TEST_INSTANCE_CVE. The scan types work as follows:

      • With TEST_INSTANCE_CVE, Amazon Inspector scans the test instance during image tests. To use this scan, you must activate Amazon Inspector for Amazon EC2 scanning in your account. The Image Builder ListImageScanFindings operation returns the findings.

      • With ON_DEMAND_AMI_CVE, Amazon Inspector starts an on-demand scan of the output AMI during image tests. To use this scan, you must build from an image recipe, but you do not need to activate Amazon Inspector in your account. The Amazon EC2 GetImageFindings operation returns the findings.

      Parameters:
      imageScanningTypes - The type of vulnerability scan that Image Builder runs for AMI output when imageScanningEnabled is true. Specify a single value. If you omit imageScanningTypes, Image Builder uses TEST_INSTANCE_CVE. The scan types work as follows:

      • With TEST_INSTANCE_CVE, Amazon Inspector scans the test instance during image tests. To use this scan, you must activate Amazon Inspector for Amazon EC2 scanning in your account. The Image Builder ListImageScanFindings operation returns the findings.

      • With ON_DEMAND_AMI_CVE, Amazon Inspector starts an on-demand scan of the output AMI during image tests. To use this scan, you must build from an image recipe, but you do not need to activate Amazon Inspector in your account. The Amazon EC2 GetImageFindings operation returns the findings.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • imageScanningTypesWithStrings

      ImageScanningConfiguration.Builder imageScanningTypesWithStrings(String... imageScanningTypes)

      The type of vulnerability scan that Image Builder runs for AMI output when imageScanningEnabled is true. Specify a single value. If you omit imageScanningTypes, Image Builder uses TEST_INSTANCE_CVE. The scan types work as follows:

      • With TEST_INSTANCE_CVE, Amazon Inspector scans the test instance during image tests. To use this scan, you must activate Amazon Inspector for Amazon EC2 scanning in your account. The Image Builder ListImageScanFindings operation returns the findings.

      • With ON_DEMAND_AMI_CVE, Amazon Inspector starts an on-demand scan of the output AMI during image tests. To use this scan, you must build from an image recipe, but you do not need to activate Amazon Inspector in your account. The Amazon EC2 GetImageFindings operation returns the findings.

      Parameters:
      imageScanningTypes - The type of vulnerability scan that Image Builder runs for AMI output when imageScanningEnabled is true. Specify a single value. If you omit imageScanningTypes, Image Builder uses TEST_INSTANCE_CVE. The scan types work as follows:

      • With TEST_INSTANCE_CVE, Amazon Inspector scans the test instance during image tests. To use this scan, you must activate Amazon Inspector for Amazon EC2 scanning in your account. The Image Builder ListImageScanFindings operation returns the findings.

      • With ON_DEMAND_AMI_CVE, Amazon Inspector starts an on-demand scan of the output AMI during image tests. To use this scan, you must build from an image recipe, but you do not need to activate Amazon Inspector in your account. The Amazon EC2 GetImageFindings operation returns the findings.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • imageScanningTypes

      ImageScanningConfiguration.Builder imageScanningTypes(Collection<ImageScanningType> imageScanningTypes)

      The type of vulnerability scan that Image Builder runs for AMI output when imageScanningEnabled is true. Specify a single value. If you omit imageScanningTypes, Image Builder uses TEST_INSTANCE_CVE. The scan types work as follows:

      • With TEST_INSTANCE_CVE, Amazon Inspector scans the test instance during image tests. To use this scan, you must activate Amazon Inspector for Amazon EC2 scanning in your account. The Image Builder ListImageScanFindings operation returns the findings.

      • With ON_DEMAND_AMI_CVE, Amazon Inspector starts an on-demand scan of the output AMI during image tests. To use this scan, you must build from an image recipe, but you do not need to activate Amazon Inspector in your account. The Amazon EC2 GetImageFindings operation returns the findings.

      Parameters:
      imageScanningTypes - The type of vulnerability scan that Image Builder runs for AMI output when imageScanningEnabled is true. Specify a single value. If you omit imageScanningTypes, Image Builder uses TEST_INSTANCE_CVE. The scan types work as follows:

      • With TEST_INSTANCE_CVE, Amazon Inspector scans the test instance during image tests. To use this scan, you must activate Amazon Inspector for Amazon EC2 scanning in your account. The Image Builder ListImageScanFindings operation returns the findings.

      • With ON_DEMAND_AMI_CVE, Amazon Inspector starts an on-demand scan of the output AMI during image tests. To use this scan, you must build from an image recipe, but you do not need to activate Amazon Inspector in your account. The Amazon EC2 GetImageFindings operation returns the findings.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • imageScanningTypes

      ImageScanningConfiguration.Builder imageScanningTypes(ImageScanningType... imageScanningTypes)

      The type of vulnerability scan that Image Builder runs for AMI output when imageScanningEnabled is true. Specify a single value. If you omit imageScanningTypes, Image Builder uses TEST_INSTANCE_CVE. The scan types work as follows:

      • With TEST_INSTANCE_CVE, Amazon Inspector scans the test instance during image tests. To use this scan, you must activate Amazon Inspector for Amazon EC2 scanning in your account. The Image Builder ListImageScanFindings operation returns the findings.

      • With ON_DEMAND_AMI_CVE, Amazon Inspector starts an on-demand scan of the output AMI during image tests. To use this scan, you must build from an image recipe, but you do not need to activate Amazon Inspector in your account. The Amazon EC2 GetImageFindings operation returns the findings.

      Parameters:
      imageScanningTypes - The type of vulnerability scan that Image Builder runs for AMI output when imageScanningEnabled is true. Specify a single value. If you omit imageScanningTypes, Image Builder uses TEST_INSTANCE_CVE. The scan types work as follows:

      • With TEST_INSTANCE_CVE, Amazon Inspector scans the test instance during image tests. To use this scan, you must activate Amazon Inspector for Amazon EC2 scanning in your account. The Image Builder ListImageScanFindings operation returns the findings.

      • With ON_DEMAND_AMI_CVE, Amazon Inspector starts an on-demand scan of the output AMI during image tests. To use this scan, you must build from an image recipe, but you do not need to activate Amazon Inspector in your account. The Amazon EC2 GetImageFindings operation returns the findings.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • scanResultCondition

      ImageScanningConfiguration.Builder scanResultCondition(ScanResultCondition scanResultCondition)

      The condition that the output AMI's scan results must meet for the image to pass. You can set scanResultCondition only when imageScanningTypes is ON_DEMAND_AMI_CVE. If you omit it, Image Builder starts the scan but does not wait for it or use its results to pass or fail the image.

      When you set scanResultCondition, the test phase waits for the scan to finish. Then Image Builder checks the findings against the condition. By default, Image Builder counts only findings that have a fix available. To count every finding, set fixAvailable to false. If a counted finding exceeds maximumSeverityLabel, Image Builder fails the image in the test phase and does not distribute the AMI.

      Parameters:
      scanResultCondition - The condition that the output AMI's scan results must meet for the image to pass. You can set scanResultCondition only when imageScanningTypes is ON_DEMAND_AMI_CVE. If you omit it, Image Builder starts the scan but does not wait for it or use its results to pass or fail the image.

      When you set scanResultCondition, the test phase waits for the scan to finish. Then Image Builder checks the findings against the condition. By default, Image Builder counts only findings that have a fix available. To count every finding, set fixAvailable to false. If a counted finding exceeds maximumSeverityLabel, Image Builder fails the image in the test phase and does not distribute the AMI.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • scanResultCondition

      default ImageScanningConfiguration.Builder scanResultCondition(Consumer<ScanResultCondition.Builder> scanResultCondition)

      The condition that the output AMI's scan results must meet for the image to pass. You can set scanResultCondition only when imageScanningTypes is ON_DEMAND_AMI_CVE. If you omit it, Image Builder starts the scan but does not wait for it or use its results to pass or fail the image.

      When you set scanResultCondition, the test phase waits for the scan to finish. Then Image Builder checks the findings against the condition. By default, Image Builder counts only findings that have a fix available. To count every finding, set fixAvailable to false. If a counted finding exceeds maximumSeverityLabel, Image Builder fails the image in the test phase and does not distribute the AMI.

      This is a convenience method that creates an instance of the ScanResultCondition.Builder avoiding the need to create one manually via ScanResultCondition.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to scanResultCondition(ScanResultCondition).

      Parameters:
      scanResultCondition - a consumer that will call methods on ScanResultCondition.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: