For the complete documentation index, see llms.txt. This page is also available as Markdown.

Anchore Enterprise step configuration

Scan container images with Anchore Enterprise.

The Anchore Enterprise step in Harness STO lets you scan your container images using Anchore Enterprise. This step supports the following scan modes: Orchestration, Extraction, and Ingestion.

Before running Anchore Enterprise scans in STO, make sure the following requirements are met:

  • Anchore API and Version Compatibility: Use the Anchore v2 API and Anchore Enterprise Server v5.0 or later when running Orchestration or Extraction scan modes.

  • Server Configuration: When deploying your Anchore Enterprise server, ensure that port 8228 is exposed. Harness uses this port to communicate with the Anchore server.

  • Air-Gapped Environments: If you’re using this step in an air-gapped setup, review the following Anchore documentation for setup and feed synchronization guidance:

Anchore Enterprise step settings

The recommended workflow is to add an Anchore Enterprise step to a Build or Security stage and then configure it as described below.

Scan

Scan mode

Refer to the Orchestration setup section below to learn how to configure the Orchestration scan mode.

Scan configuration

This option allows you to set the Anchore's VULN_TYPE parameter. This setting filters the records returned to STO; it does not change how Anchore analyzes images.

  • Default or All: Combination report containing both OS and Non-OS vulnerability records.

  • OS: Vulnerabilities against operating system packages (RPM, DPKG, APK, etc.).

  • Non-OS: Vulnerabilities against language packages (NPM, GEM, Java Archive (jar, war, ear), Python PIP, .NET NuGet, etc.).

Target

Type

Target and Variant Detection

Name

Variant

Container image

Type (orchestration)

Domain

Name

Tag/Digest

Access ID

Access Token

Ingestion File

Authentication

Domain

The fully-qualified URL to the scanner API, for example https://anchore.company.io/api or http://192.0.2.1:8228.

Access ID

Access Token

Scan Tool

Use Raw Scanner Severity

Image Name (for Extraction Scan Mode)

This field appears only when you select Extraction as the Scan Mode. The name of the image that you want to extract from Anchore. In Extraction mode, the image to scan must be located on the Anchore server. You should include both the image name and tag, for example, ubuntu:20.04.

Log Level

Additional CLI flags

Use this field to run the Anchore Enterprise CLI with flags such as --force. This flag resets the image analysis status to not_analyzed.

Fail on Severity

Settings

Additional Configuration

Advanced settings

View Anchore policy failures

Anchore policy failures will appear in scan results as Info severity issues, with the issue type set to EXTERNAL_POLICY. Successfully passed policies will not be included in the scan results. Additionally, you can apply an OPA policy to fail the pipeline based on the policy failures. This can be achieved using the Security Tests - External Policy Failures policy from the security tests policy samples.

Configure External Policy Failures

You can configure Harness STO to treat external policy failures as vulnerabilities. To do this, navigate to Account Settings, go to the Default Settings page, select Security Test Orchestration, and click the External Policy Failures setting.

Enable the external policy failures setting to map them to a selected severity level — Critical, High, Medium, or Low to treat them as vulnerabilities instead of Info level issues. This setting takes effect from the next pipeline execution.

This feature is behind the Feature flag STO_EXTERNAL_POLICY_FAILURES_AS_VULNS. Contact Harness Support to enable this flag.

Proxy settings

Anchore Enterprise orchestration example

This example uses an Anchore step in Orchestration mode to scan a repository. The pipeline has one Security stage with two steps:

  1. A Background step that runs Docker-in-Docker. This is required to scan container images.

  2. An Anchore step that does the following:

    1. Extracts the owasp/nettacker:latest image from Anchore Enterprise.

    2. Logs in to the Anchore Enterprise API based on the product_domain, product_access_id, product_access_token settings.

    3. Launches an orchestration scan of the owasp/nettacker project in Anchore Enterprise and gets the scan results from the Anchore server.

    4. Deduplicates and normalizes the scan data and ingests it into STO.

Note that in this example, the resource limits for the Docker-in-Docker step are increased to ensure that the step has enough memory to store the scanned image.

Anchore Enterprise orchestration pipeline example

Last updated

Was this helpful?