Metasploit scanner reference for STO
You can scan your application instances and ingest results from Metasploit.
Important notes for running Metasploit scans in STO
Docker-in-Docker requirements
The following use cases require a Docker-in-Docker background step in your pipeline:
- Container image scans on Kubernetes and Docker build infrastructures
- Required for Orchestration and Dataload scan modes
- Security steps (not step palettes) on Kubernetes and Docker build infrastructures
- Required for all target types and Orchestration/DataLoad modes
The following use cases do not require Docker-in-Docker:
- Harness Cloud AMD64 build infrastructures
- SAST/DAST/configuration scans that use scanner templates (not Security steps)
- Ingestion scans where the data file has already been generated
Set up a Docker-in-Docker background step
-
Go to the stage where you want to run the scan.
-
In Overview, add the shared path
/var/run
. -
In Execution, do the following:
-
Click Add Step and then choose Background.
-
Configure the Background step as follows:
-
Dependency Name =
dind
-
Container Registry = The Docker connector to download the DinD image. If you don't have one defined, go to Docker connector settings reference.
-
Image =
docker:dind
-
Under Entry Point, add the following:
dockerd
In most cases, using
dockerd
is a faster and more secure way to set up the background step. For more information, go to the TLS section in the Docker quick reference.
If the DinD service doesn't start with
dockerd
, clear the Entry Point field and then run the pipeline again. This starts the service with the default entry point.- Under Optional Configuration, select the Privileged checkbox.
-
-
- Visual setup
- YAML setup

Add a Background step to your pipeline and set it up as follows:
- step:
type: Background
name: background-dind-service
identifier: Background_1
spec:
connectorRef: CONTAINER_IMAGE_REGISTRY_CONNECTOR
image: docker:dind
shell: Sh
entrypoint:
- dockerd
privileged: true
Root access requirements
You need to run the scan step with root access if either of the following apply:
-
You need to run a Docker-in-Docker background service.
-
You need to add trusted certificates to your scan images at runtime.
You can set up your STO scan images and pipelines to run scans as non-root and establish trust for your own proxies using self-signed certificates. For more information, go to Configure STO to Download Images from a Private Registry.
For more information
The following topics contain useful information for setting up scanner integrations in STO:
Security step settings for Metasploit scans in STO
Target and variant
The following settings are required for every Security step:
target_name
A user-defined label for the code repository, container, application, or configuration to scan.variant
A user-defined label for the branch, tag, or other target variant to scan.
Make sure that you give unique, descriptive names for the target and variant. This makes navigating your scan results in the STO UI much easier.
You can see the target name, type, and variant in the Test Targets UI:
For more information, go to Targets, baselines, and variants in STO.
Metasploit scan settings
product_name
=metasploit
scan_type
=instance
policy_type
=orchestratedScan
oringestionOnly
product_config_name
metasploit-weak-ssh
Brute-force test a host for SSH weak ssh/passmetasploit-openssl-heartbleed
Check HTTPS (443) for Heartbleed vulnerabilitydynamic-by-cve
Finds and applies Metaspoit module by CVE
fail_on_severity
- See Fail on Severity.
Instance scan settings
The following settings apply to Security steps where the scan_type
is instance
.
instance_domain
instance_path
instance_protocol
instance_port
instance_username
The username for authenticating with the external scanner.instance_password
You should create a Harness text secret with your encrypted password and reference the secret using the format<+secrets.getValue("project.container-access-id")>
. For more information, go to Add and reference text secrets.
Ingestion file
If the policy_type
is ingestionOnly
:
ingestion_file
= 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 results files 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:
- stage:
spec:
sharedPaths:
- /shared/scan_results
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:
CRITICAL
HIGH
MEDIUM
LOW
INFO
NONE
— Do not fail on severity
The YAML definition looks like this: fail_on_severity : critical # | high | medium | low | info | none