Skip to main content

Zed Attack Proxy (ZAP) Scanner Reference

Zed Attack Proxy (ZAP) is a free, open-source penetration tool for testing web applications. ZAP runs as a “man-in-the-middle proxy” between the tester’s browser and the web app. You can use ZAP to run penetration testing to simulate a malicious external attack and use the results to protect your app from unauthorized access and denial-of-service attacks.

Zap step configuration

The recommended workflow is add a ZAP step to a Security Tests or CI Build stage and then configure it as described below. You can also configure ZAP scans programmatically by copying, pasting, and editing the YAML definition.

  • UI configuration support is currently limited to the following scanners: Aqua Trivy, Bandit, Black Duck, Checkmarx, Grype, Mend, Prisma Cloud, Snyk, SonarQube, and ZAP.
  • Each step palette 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.
Step Palette


Scan Mode

The orchestration mode to use for the scan. The following list includes the UI and YAML values for the supported options.

  • Orchestrated A fully-orchestrated scan. A Security step in the Harness pipeline orchestrates a scan and then normalizes and compresses the results.
  • Ingestion Ingestion scans are not orchestrated. The Security step ingest results from a previous scan (for a scan run in an previous step) and then normallizes and compresses the results.

Scan Configuration

The predefined configuration to use for the scan. All scan steps have at least one configuration.

The following options are supported for Zap scans:

  • Default
  • StandardscanMode = active, scanType = atandard
  • AttackscanMode = active, scanType = attack
  • QuickscanMode = active, scanType = standard, quickMode = true



  • Instance Scan a running application.


The Identifier that you want to assign to the target you’re scanning in the pipeline. Use a unique, descriptive name such as codebaseAlpha or jsmith/myalphaservice.


An identifier for a specific target 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.


The workspace path on the pod running the Security step. The workspace path is /harness by default.

You can override this if you want to scan only a subset of the workspace. For example, suppose the pipeline publishes artifacts to a specific subfolder. You can specify the workspace path as /harness/path/to/artifacts/subfolder.

Ingestion File

The results data file to use when running an Ingestion scan. Generally an Ingestion scan consists of a scan step (to generate the data file) and an ingestion step (to ingest the data file).



Domain of the application instance to scan. You can include the full path to the app in this field, or split the full path between the Domain and the Path fields. Example:


HTTPS (default) or HTTP.


The TCP port used by the scanned app instance.


Path to append to the application instance domain, if you're splitting the full path between the Domain and Path settings. For example, you might specify the domain as and the path as /portal/us.

Log Level, CLI flags, and Fail on Severity

Log Level

The minimum severity of the messages you want to include in your scan logs. You can specify one of the following:

  • INFO

Additional CLI flags

You can use this field to customize the scan with specific command-line arguments supported by that scanner.

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. It is good practice to include this setting in every Security step in an integrated pipeline. You can specify one of the following:

  • HIGH
  • LOW
  • INFO
  • NONE — Do not fail on severity

The YAML definition looks like this: fail_on_severity : critical # | high | medium | low | info | none

Additional Configuration

In the Additional Configuration settings, you can use the following options:

Advanced settings

In the Advanced settings, you can use the following options:

Security step configuration (deprecated)

Set up a ZAP scan in a Security step

Scan policy types

STO supports the following scan policy types for ZAP:

  • orchestratedScan  — A Security step in the pipeline runs the scan and ingests the results. This is easier to set up and supports scans with default or predefined settings.
  • ingestionOnly — Run the scan in a Run step, or outside the pipeline, and then ingest the results. This is useful for advanced workflows that address specific security needs. See Ingest scan results into an STO pipeline.

Required Settings

  • product_name = zap
  • scan_typeinstance
  • product_config_name— Specify one of the following:
    • standard (scanMode = active, scanType = standard)
    • attack(scanMode = active, scanType = attack)
    • quick(scanMode = active, scanType = standard, quickMode = true)
  • instance_identifier— The target Id that will appear in the Test Targets page of the Harness UI.
  • instance_environment — The instance environment, such as dev, qa, pre-qa, or prod.
  • instance_domain — The app domain to scan, for example
  • instance_protocol — The protocol of the site to scan. Generally this is http or https.
  • instance_typewebsite
  • fail_on_severity - See Fail on Severity.

Optional Settings

  • instance_path — Specify if the app URL includes a path beyond the domain. If you want to scan, the instance path is myModule/myApp.
  • instance_port — Specify if the site is accessed using a non-default port.

YAML configuration

The following YAML pipeline includes example stages for scanning a repository (Bandit step), an image (AquaTrivy step), and an app (ZAP step).


If you want to set up scan steps programmatically using YAML, the best practice is to set up your step in a pipeline using the Visual Editor and then copy, paste, and edit the YAML definition.

name: sto-step-palette-example
identifier: stosteppaletteexample
projectIdentifier: my_sto_project
orgIdentifier: default
tags: {}
build: <+input>
- stage:
name: runSecurityTestsStage
identifier: runSecurityTestsStage
type: SecurityTests
cloneCodebase: true
- step:
type: Background
name: docker_dind
identifier: Background_1
image: docker:dind
shell: Sh
privileged: true
- step:
type: Bandit
name: banditScanRepo
identifier: banditScanRepo
mode: orchestration
config: default
name: dvpwa
type: repository
variant: <+codebase.branch>
level: info
fail_on_severity: none
- step:
type: AquaTrivy
name: aquaTrivyScanContainerImage
identifier: aquaTrivyScanContainerImage
mode: orchestration
config: default
name: myAlphaService
type: container
variant: latest
level: info
privileged: true
type: docker_v2
name: jsmith/myalphaservice
tag: latest
- step:
type: Zap
name: zapScanInstance
identifier: zapScanInstance
mode: orchestration
config: default
name: my-gruyere
type: instance
variant: test
level: info
protocol: https
type: KubernetesDirect
connectorRef: MY_K8S_CONNECTOR
namespace: harness-delegate-ng
automountServiceAccountToken: true
nodeSelector: {}
os: Linux
- /var/run