Custom Scan step for supported scanners
Set up scanners using key-value pairs.
The Custom Scan step enables you to configure supported scanners that don't yet have their own dedicated step in the Harness Step Library.
Important notes for Custom Scan steps
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_nameandorchestratedScan, are case-sensitive.You need to add a Docker-in-Docker background step if you're running an
orchestratedScanordataLoadscan in a Kubernetes or Docker build infrastructure.You need to run the Custom Scan step with root access 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:
Workflow descriptions
Custom Scan settings reference
To set up a scanner, you add key-value pairs under Settings. The following sections describe the different settings and requirements.
Scanner settings
These settings are required for most scanners. For more information, go to the reference for the scanner integration you're setting up.
Product name
The scanner name. This is required for all Custom Scan steps.
Key
Value
Go to the relevant step configuration.
Scan type
The target type to scan.
Key
Value
Must be one of the following. For supported values, go to the relevant step configuration.
Policy type
The scan mode to use.
Key
Value
Must be one of the following. For supported values, go to the relevant step configuration.
Product config name
Required for most scanner integrations.
Key
Value
For supported values, go to the relevant step configuration.
Target and variant
Every Custom Scan step needs a target and baseline.
Target name
Key
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
Value
A user-defined label for the branch, tag, or other target variant to scan.
Code repositories
These settings apply to Custom Scan steps when both of these conditions are true:
The
policy_typeisorchestratedScanordataLoad.The
scan_typeisrepository.
Repository project
Key
Value
The name of the repo to scan. To specify the repo URL, edit the Codebase Config object in the Harness pipeline.
In most cases, this should match the repo name used in your Git provider.
Repository branch
Key
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.
Container image
These settings apply to Custom Scan steps when both of these conditions are true:
The
policy_typeisorchestratedScanordataLoad.The
scan_typeiscontainerImage.
Container type
Key
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).
A registry that uses the Docker Registry v2 API such as Docker Hub, Google Container Registry, or Google Artifact Registry.
Container domain
Key
Value
The URL of the registry that contains the image to scan. Examples include:
Container project
Key
Value
The image name. For non-local images, you also need to specify the image repository. Example: jsmith/myalphaservice
Container tag
Key
Value
The image tag. Examples: latest, 1.2.3
Container access Id
Key
Value
Your access Id to the image registry.
Container access token
Key
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.
AWS region
Key
Value
The region where the image to scan is located, as defined by the cloud provider such as AWS.
Application instances
These settings apply to Custom Scan steps when both of these conditions are true:
The
policy_typeisorchestratedScanordataLoad.The
scan_typeisinstance.
Instance domain
Key
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
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
Value
One of the following: HTTPS is the default.
Instance port
Key
Value
The TCP port used by the scanned app.
Instance username
Key
Value
The username for authenticating with the scanned app.
Instance password
Key
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.
Configurations
The following settings apply to scanners where the scan_type is configuration.
Configuration type
Key
Value
Configuration access
You can use these settings to access your configuration.
You should create Harness text secrets with your encrypted access token and access it using the format <+secrets.getValue("my-secret")>.
Ingestion file
This setting applies to Custom Scan steps when the policy_type is ingestionOnly.
Key
Value
The path to your scan results when running an Ingestion scan, for example /shared/scan_results/myscan.latest.sarif.
The data file must be in a supported format 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 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:
Fail on Severity
If the scan finds any vulnerability with the specified severity level or higher, the pipeline fails automatically. NONE means do not fail on severity.
For more information, go to:
Key
Value
Additional Configuration
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
Advanced settings
In the Advanced settings, you can use the following options:
Last updated
Was this helpful?