AWS ECR scanner reference
You can scan your container images using Amazon Elastic Container Registry (ECR).
AWS ECR step configuration
The recommended workflow is add an AWS ECR step to a Security Tests or CI Build stage and then configure it as described below. You can also configure scans programmatically by copying, pasting, and editing the YAML definition.
- UI configuration support is currently limited to a subset of scanners. Extending UI support to additional scanners is on the Harness engineering roadmap.
- Each scanner template shows only the options that apply to a specific scan. If you're setting up a repository scan, for example, the UI won't show Container Image settings.
- Docker-in-Docker is not required for these steps unless you're scanning a container image. If you're scanning a repository using Bandit, for example, you don't need to set up a Background step running DinD.
- Support is currently limited to Kubernetes and Harness Cloud AMD64 build infrastructures only.
- Extraction A partially-orchestrated scan. The Security step pulls scan results from an external SaaS service and then normalizes and compresses the data.
The predefined configuration to use for the scan. All scan steps have at least one configuration.
- Container Image Scan the layers, libraries, and packages in a container image.
The Identifier that you want to assign to the target you’re scanning in the pipeline. Use a unique, descriptive name such as
An identifier for a specific variant to scan, such as the branch name or image tag. This identifier is used to differentiate or group results for a target. Harness maintains a historical trend for each variant.
Container Image settings
The registry type where the image is stored:
Docker v2 A registry that uses the Docker Registry v2 API such as Docker Hub, Google Container Registry, or Google Artifact Registry.
The URL of the artifact repository that contains the image to scan. Examples:
The image name. For non-local images, you also need to specify the image repository. Example:
The image tag. Examples:
The region where the image to scan is located, as defined by the cloud provider such as AWS.
Access ID (orchestration)
Username to log in to the scanner.
The access token to log in to the scanner. In most cases this is a password or an API key.
You should create a Harness text secret with your encrypted token and reference the secret using the format
<+secrets.getValue("project.container-access-id">. For more information, go to Add and Reference Text Secrets.
The AWS region of the image to scan.
The results data file to use when running an Ingestion scan. STO steps can ingest scan data in SARIF and Harness Custom JSON format. Generally an Ingestion scan consists of a scan step (to generate the data file) and an ingestion step (to ingest the data file).
Log Level, CLI flags, and Fail on Severity
The minimum severity of the messages you want to include in your scan logs. You can specify one of the following:
Fail on Severity
Every Security step has a Fail on Severity setting. If the scan finds any vulnerability with the specified severity level or higher, the pipeline fails automatically. You can specify one of the following:
NONE— Do not fail on severity
The YAML definition looks like this:
fail_on_severity : critical # | high | medium | low | info | none
In the Additional Configuration settings, you can use the following options:
In the Advanced settings, you can use the following options: