> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/security-testing-orchestration/use-sto/sto-custom-scanning-and-ingestion/custom-scan-reference.md).

# Custom Scan step for supported scanners

The **Custom Scan** step enables you to configure supported scanners that don't yet have their own dedicated step in the Harness Step Library.

<details>

<summary>Supported scanners that use a Custom Scan step</summary>

* [Clair](/security-testing-orchestration/use-sto/sto-scanner-configuration/clair-scanner-reference.md)
* [Data Theorem](/security-testing-orchestration/use-sto/sto-scanner-configuration/data-theorem-scanner-reference.md)
* [Docker Content Trust](/security-testing-orchestration/use-sto/sto-scanner-configuration/docker-content-trust-dct-scanner-reference.md)
* [Fortify Static Code Analyzer](/security-testing-orchestration/use-sto/sto-scanner-configuration/fortify-scanner-reference.md)
* [Fortify on Demand](/security-testing-orchestration/use-sto/sto-scanner-configuration/fortify-on-demand-scanner-reference.md)
* [HCL AppScan](/security-testing-orchestration/use-sto/sto-scanner-configuration/hql-appscan-scanner-reference.md)
* [Metasploit](/security-testing-orchestration/use-sto/sto-scanner-configuration/metasploit-scanner-reference.md)
* [Nessus](/security-testing-orchestration/use-sto/sto-scanner-configuration/nessus-scanner-reference.md)
* [Nexus](/security-testing-orchestration/use-sto/sto-scanner-configuration/nexus-scanner-reference.md)
* [OpenVAS](/security-testing-orchestration/use-sto/sto-scanner-configuration/openvas-scanner-reference.md)
* [Qualys Web Application Scanning](/security-testing-orchestration/use-sto/sto-scanner-configuration/qualys-web-app-scanner-reference.md)
* [Reapsaw](/security-testing-orchestration/use-sto/sto-scanner-configuration/reapsaw-scanner-reference.md)
* [ScoutSuite](/security-testing-orchestration/use-sto/sto-scanner-configuration/scoutsuite-scanner-reference.md)
* [Tenable](/security-testing-orchestration/use-sto/sto-scanner-configuration/tenable-scanner-reference.md)
* [Veracode](/security-testing-orchestration/use-sto/sto-scanner-configuration/veracode-scanner-reference.md)
* [JFrog Xray](/security-testing-orchestration/use-sto/sto-scanner-configuration/xray-scanner-reference.md)

</details>

### Important notes for Custom Scan steps <a href="#important-notes-for-custom-scan-steps" id="important-notes-for-custom-scan-steps"></a>

* To configure a Custom Scan step, you add a set of key-value pairs in the **Settings** field. The key and value strings you need to specify, such as `product_name` and `orchestratedScan`, are case-sensitive.
* You need to [add a Docker-in-Docker background step](/security-testing-orchestration/use-sto/sto-scanner-configuration/security-step-settings-reference.md#configuring-docker-in-docker-dind-for-your-pipeline) if you're running an `orchestratedScan` or `dataLoad` scan in a Kubernetes or Docker build infrastructure.
* You need to run the [Custom Scan step with root access](/security-testing-orchestration/use-sto/sto-scanner-configuration/security-step-settings-reference.md#root-access-requirements-for-sto) if you need to run a Docker-in-Docker step, or if you need to add trusted certificates to your scan images at runtime.
* The following topics contain useful information for setting up scanner integrations in STO:
  * [What's supported in STO](/security-testing-orchestration/new-to-sto/sto-whats-supported/sto-deployments.md)
  * [Security Testing Orchestration FAQs](/security-testing-orchestration/troubleshooting-and-resources/faqs.md)
  * [Optimize STO pipelines](/security-testing-orchestration/troubleshooting-and-resources/sto-use-cases/set-up-sto-pipelines/optimize-sto-pipelines.md)

### Workflow descriptions <a href="#workflow-descriptions" id="workflow-descriptions"></a>

<details>

<summary>Orchestration/extraction workflows</summary>

This workflow applies to scanner integrations that support [`orchestratedScan`](/security-testing-orchestration/new-to-sto/key-concepts/run-an-orchestrated-scan-in-sto.md) or [`dataLoad`](/security-testing-orchestration/new-to-sto/key-concepts/extraction-scans.md) scan modes.

1. Add a **Build** or **Security** stage to your pipeline.
2. If you're scanning a code repository, set up your [codebase](/continuous-integration/use-harness-ci/use-harness-ci/codebase-configuration/create-and-configure-a-codebase.md).
3. Add a [Custom Scan](/security-testing-orchestration/use-sto/sto-custom-scanning-and-ingestion/custom-scan-reference.md) step.
4. Review the [Important notes for Custom Scan steps](/security-testing-orchestration/use-sto/sto-custom-scanning-and-ingestion/custom-scan-reference.md#important-notes-for-custom-scan-steps) for additional requirements and relevant information.

   If you're setting up a scan on a Kubernetes or Docker build infrastructure, you need to add a [Docker-in-Docker background step](/security-testing-orchestration/use-sto/sto-scanner-configuration/security-step-settings-reference.md#configuring-docker-in-docker-dind-for-your-pipeline) to the stage.
5. Add the relevant `key:value` pairs to **Settings**.

</details>

<details>

<summary>Ingestion workflows</summary>

This workflow applies to scanner integrations that support Ingestion mode.

1. Add a Build or Security stage to your pipeline.
2. Add a Run step and set it up to save your scan results to a shared folder.

   For more information, go to [Run an ingestion scan in an STO Pipeline](/security-testing-orchestration/new-to-sto/key-concepts/ingest-scan-results-into-an-sto-pipeline.md).
3. Add a [Custom Scan](/security-testing-orchestration/use-sto/sto-custom-scanning-and-ingestion/custom-scan-reference.md) step.
4. Review the [Important notes for Custom Scan steps](/security-testing-orchestration/use-sto/sto-custom-scanning-and-ingestion/custom-scan-reference.md#important-notes-for-custom-scan-steps) for additional requirements and relevant information.
5. Add the relevant `key:value` pairs to **Settings**.

</details>

### Custom Scan settings reference <a href="#custom-scan-settings-reference" id="custom-scan-settings-reference"></a>

To set up a scanner, you add key-value pairs under **Settings**. The following sections describe the different settings and requirements.

<details>

<summary>Scanner configuration in a Custom Scan step</summary>

\- step: type: Security name: custom\_scan\_xray identifier: custom\_scan\_xray spec: privileged: true settings: policy\_type: ingestionOnly scan\_type: containerImage product\_name: xray product\_config\_name: default target\_name: YOUR\_REPO/YOUR\_IMAGE target\_variant: YOUR\_TAG ingestion\_file: /shared/scan\_results/xray2.json

</details>

#### Scanner settings <a href="#scanner-settings" id="scanner-settings"></a>

These settings are required for most scanners. For more information, go to the reference for the scanner integration you're setting up.

* [Product name](#product-name)
* [Scan type](#scan-type)
* [Policy type](#policy-type)
* [Product config name](#product-config-name)

<details>

<summary>Supported scanners that use a Custom Scan step</summary>

* [Clair](/security-testing-orchestration/use-sto/sto-scanner-configuration/clair-scanner-reference.md)
* [Data Theorem](/security-testing-orchestration/use-sto/sto-scanner-configuration/data-theorem-scanner-reference.md)
* [Docker Content Trust](/security-testing-orchestration/use-sto/sto-scanner-configuration/docker-content-trust-dct-scanner-reference.md)
* [Fortify Static Code Analyzer](/security-testing-orchestration/use-sto/sto-scanner-configuration/fortify-scanner-reference.md)
* [Fortify on Demand](/security-testing-orchestration/use-sto/sto-scanner-configuration/fortify-on-demand-scanner-reference.md)
* [HCL AppScan](/security-testing-orchestration/use-sto/sto-scanner-configuration/hql-appscan-scanner-reference.md)
* [Metasploit](/security-testing-orchestration/use-sto/sto-scanner-configuration/metasploit-scanner-reference.md)
* [Nessus](/security-testing-orchestration/use-sto/sto-scanner-configuration/nessus-scanner-reference.md)
* [Nexus](/security-testing-orchestration/use-sto/sto-scanner-configuration/nexus-scanner-reference.md)
* [OpenVAS](/security-testing-orchestration/use-sto/sto-scanner-configuration/openvas-scanner-reference.md)
* [Qualys Web Application Scanning](/security-testing-orchestration/use-sto/sto-scanner-configuration/qualys-web-app-scanner-reference.md)
* [Reapsaw](/security-testing-orchestration/use-sto/sto-scanner-configuration/reapsaw-scanner-reference.md)
* [ScoutSuite](/security-testing-orchestration/use-sto/sto-scanner-configuration/scoutsuite-scanner-reference.md)
* [Tenable](/security-testing-orchestration/use-sto/sto-scanner-configuration/tenable-scanner-reference.md)
* [Veracode](/security-testing-orchestration/use-sto/sto-scanner-configuration/veracode-scanner-reference.md)
* [JFrog Xray](/security-testing-orchestration/use-sto/sto-scanner-configuration/xray-scanner-reference.md)

</details>

**Product name**

The scanner name. This is required for all Custom Scan steps.

**Key**

```
product_name
```

**Value**

Go to the relevant step configuration.

**Scan type**

The target type to scan.

**Key**

```
scan_type
```

**Value**

Must be one of the following. For supported values, go to the relevant step configuration.

```
containerImage
```

```
repository
```

```
instance
```

```
configuration
```

**Policy type**

The [scan mode](/security-testing-orchestration/new-to-sto/key-concepts/sto-workflows-overview.md) to use.

**Key**

```
policy_type
```

**Value**

Must be one of the following. For supported values, go to the relevant step configuration.

```
orchestratedScan
```

```
ingestionOnly
```

```
dataLoad
```

**Product config name**

Required for most scanner integrations.

**Key**

```
product_config_name
```

**Value**

For supported values, go to the relevant step configuration.

#### Target and variant <a href="#target-and-variant" id="target-and-variant"></a>

Every Custom Scan step needs a [target and baseline](/security-testing-orchestration/new-to-sto/key-concepts/targets-and-baselines.md).

* [Target name](#target-name)
* [Target variant](#target-variant)

**Target name**

**Key**

```yaml
target_name
```

**Value**

A user-defined label for the code repository, container, application, or configuration to scan. Specify a unique, descriptive name. This makes it much easier to navigate your scan results in the STO UI.

**Target variant**

**Key**

```yaml
target_variant
```

**Value**

A [user-defined label](/security-testing-orchestration/new-to-sto/key-concepts/targets-and-baselines.md) for the branch, tag, or other target variant to scan.

#### Code repositories <a href="#code-repositories" id="code-repositories"></a>

These settings apply to Custom Scan steps when both of these conditions are true:

1. The `policy_type` is `orchestratedScan` or `dataLoad`.
2. The `scan_type` is `repository`.

* [Repository project](#repository-project)
* [Repository branch](#variant)

**Repository project**

**Key**

```
repository_project
```

**Value**

The name of the repo to scan. To specify the repo URL, edit the [Codebase Config object](/continuous-integration/use-harness-ci/use-harness-ci/codebase-configuration/create-and-configure-a-codebase.md) in the Harness pipeline.

In most cases, this should match the repo name used in your Git provider.

**Repository branch**

**Key**

```
repository_branch
```

**Value**

The branch that gets reported in STO for the ingested results. In most cases, this field should match the name of the Git branch that is getting scanned.

You can specify a hardcoded string or use a variable such as `<+codebase.branch>` to specify the branch at runtime. For more information, go to [CI codebase variables reference](/continuous-integration/use-harness-ci/use-harness-ci/codebase-configuration/built-in-cie-codebase-variables-reference.md).

#### Container image <a href="#container-image" id="container-image"></a>

These settings apply to Custom Scan steps when both of these conditions are true:

1. The `policy_type` is `orchestratedScan` or `dataLoad`.
2. The `scan_type` is `containerImage`.

* [Container type](#container-type)
* [Container domain](#container-domain)
* [Container project](#container-project)
* [Container tag](#container-tag)
* [Container access Id](#container-access-id)
* [Container access token](#container-access-token)
* [AWS region](#aws-region)

**Container type**

**Key**

```
container_type
```

**Value**

The registry type where the image is stored. Specify one of the following:

Scan a local image built and stored within the context of the current stage (via `/var/run/docker.sock` registered as a stage level volume mount).

```
local_image
```

A registry that uses the Docker Registry v2 API such as [Docker Hub](https://docs.docker.com/registry/spec/api/), [Google Container Registry](https://cloud.google.com/container-registry), or [Google Artifact Registry](https://cloud.google.com/artifact-registry).

```
docker_v2
```

[JFrog Docker Registry](https://jfrog.com/container-registry/).

```
jfrog_artifactory
```

[Amazon Container Registry](https://aws.amazon.com/ecr/).

```
aws_ecr
```

**Container domain**

**Key**

```
container_domain
```

**Value**

The URL of the registry that contains the image to scan. Examples include:

```
docker.io
```

```
app.harness.io/registry
```

```
us-east1-docker.pkg.dev
```

**Container project**

**Key**

```
container_project
```

**Value**

The image name. For non-local images, you also need to specify the image repository. Example: `jsmith/myalphaservice`

**Container tag**

**Key**

```
container_tag
```

**Value**

The image tag. Examples: `latest`, `1.2.3`

**Container access Id**

**Key**

```
container_access_id
```

**Value**

Your access Id to the image registry.

**Container access token**

**Key**

```
container_access_token
```

**Value**

The password or access token used to log in to the image registry. 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("container-access-id")>`. For more information, go to [Add and Reference Text Secrets](/harness-ai/use-harness-platform/secrets/add-use-text-secrets.md).

**AWS region**

**Key**

```
container_region
```

**Value**

The region where the image to scan is located, as defined by the cloud provider such as AWS.

#### Application instances <a href="#application-instances" id="application-instances"></a>

These settings apply to Custom Scan steps when both of these conditions are true:

1. The `policy_type` is `orchestratedScan` or `dataLoad`.
2. The `scan_type` is `instance`.

* [Instance domain](#instance-domain)
* [Instance path](#instance-path)
* [Instance protocol](#instance-protocol)
* [Instance port](#instance-port)
* [Instance username](#instance-username)
* [Instance password](#instance-password)

**Instance domain**

**Key**

```
instance_domain
```

**Value**

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 `instance_domain` and the `instance_path` settings. Example: `https://myapp.io/portal/us`

**Instance path**

**Key**

```
instance_path
```

**Value**

Path to append to the application instance domain, if you're splitting the full path between the `instance_domain` and the `instance_path` settings. For example, you might specify the domain as `https://myapp.io` and the path as `/portal/us`.

**Instance protocol**

**Key**

```
instance_protocol
```

**Value**

One of the following: `HTTPS` is the default.

```
HTTPS
```

```
HTTP
```

**Instance port**

**Key**

```
instance_port
```

**Value**

The TCP port used by the scanned app.

**Instance username**

**Key**

```
instance_username
```

**Value**

The username for authenticating with the scanned app.

**Instance password**

**Key**

```
instance_password
```

**Value**

You should create a Harness text secret with your encrypted password and reference the secret using the format `<+secrets.getValue("container-access-id")>`. For more information, go to [Add and reference text secrets](/harness-ai/use-harness-platform/secrets/add-use-text-secrets.md).

#### Configurations <a href="#configurations" id="configurations"></a>

The following settings apply to scanners where the `scan_type` is `configuration`.

**Configuration type**

**Key**

```
configuration_type
```

**Value**

```
aws_account
```

**Configuration access**

You can use these settings to access your configuration.

You should create [Harness text secrets](/harness-ai/use-harness-platform/secrets/add-use-text-secrets.md) with your encrypted access token and access it using the format `<+secrets.getValue("my-secret")>`.

```
configuration_region
```

```
configuration_environment
```

```
configuration_access_id
```

```
configuration_access_token
```

#### Ingestion file <a href="#ingestion-file" id="ingestion-file"></a>

This setting applies to Custom Scan steps when the `policy_type` is [`ingestionOnly`](/security-testing-orchestration/new-to-sto/key-concepts/ingest-scan-results-into-an-sto-pipeline.md).

**Key**

```
ingestion_file
```

**Value**

The path to your scan results when running an [Ingestion scan](/security-testing-orchestration/new-to-sto/key-concepts/ingest-scan-results-into-an-sto-pipeline.md), for example `/shared/scan_results/myscan.latest.sarif`.

* The data file must be in a [supported format](/security-testing-orchestration/new-to-sto/sto-whats-supported/scanners.md#supported-ingestion-formats) for the scanner.
* The data file must be accessible to the scan step. It's good practice to save your scan results to a [shared path](/continuous-integration/new-to-harness-ci/key-concepts.md#stages) in your stage. In the visual editor, go to the stage where you're running the scan. Then go to **Overview** > **Shared Paths**. You can also add the path to the YAML stage definition like this:

  ```yaml
      - stage:
        spec:
          sharedPaths:
            - /shared/scan_results
  ```

#### Fail on Severity <a href="#fail-on-severity" id="fail-on-severity"></a>

If the scan finds any vulnerability with the specified [severity level](/security-testing-orchestration/new-to-sto/key-concepts/severities.md) or higher, the pipeline fails automatically. `NONE` means do not fail on severity.

For more information, go to:

* [STO workflows for blocking builds and PRs](/security-testing-orchestration/troubleshooting-and-resources/sto-use-cases/stop-builds-based-on-scan-results/stop-pipelines-overview.md).
* [Exemptions to override Fail on Severity thresholds for specific issues in STO](/security-testing-orchestration/use-sto/sto-exempt-issues/exemption-workflows.md)

**Key**

```
fail_on_severity
```

**Value**

```
CRITICAL
```

```
MEDIUM
```

```
LOW
```

```
INFO
```

```
NONE
```

### Additional Configuration <a href="#additional-configuration" id="additional-configuration"></a>

The fields under **Additional Configuration** vary based on the type of infrastructure. Depending on the infrastructure type selected, some fields may or may not appear in your settings. Below are the details for each field

* Override Security Test Image
  * [Container Registry](/security-testing-orchestration/troubleshooting-and-resources/sto-use-cases/set-up-sto-pipelines/configure-pipeline-to-use-sto-images-from-private-registry.md#step-level-override)
  * [Image Tag](/security-testing-orchestration/troubleshooting-and-resources/sto-use-cases/set-up-sto-pipelines/configure-pipeline-to-use-sto-images-from-private-registry.md#step-level-override)
* [Privileged](/continuous-integration/use-harness-ci/use-harness-ci/manage-dependencies/background-step-settings.md#privileged)
* [Image Pull Policy](/continuous-integration/use-harness-ci/use-harness-ci/manage-dependencies/background-step-settings.md#image-pull-policy)
* [Run as User](/continuous-integration/use-harness-ci/use-harness-ci/manage-dependencies/background-step-settings.md#run-as-user)
* [Set Container Resources](/continuous-integration/use-harness-ci/use-harness-ci/manage-dependencies/background-step-settings.md#set-container-resources)
* [Timeout](/continuous-integration/use-harness-ci/use-harness-ci/run-step-settings.md#timeout)

### Advanced settings <a href="#advanced-settings" id="advanced-settings"></a>

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

* [Conditional Execution](/harness-ai/use-harness-platform/pipelines/step-skip-condition-settings.md)
* [Failure Strategy](/harness-ai/use-harness-platform/pipelines/failure-handling/define-a-failure-strategy-on-stages-and-steps.md)
* [Looping Strategy](/harness-ai/use-harness-platform/pipelines/looping-strategies/looping-strategies-matrix-repeat-and-parallelism.md)
* [Policy Enforcement](/harness-ai/use-harness-platform/governance/policy-as-code/harness-governance-overview.md)
