Coverity step configuration
Scan code repositories with Coverity.
You can ingest scan results from Coverity Scan into Harness STO.
Important notes for running Coverity scans in STO
Root access requirements
You need to run the scan step with root access if either of the following apply:
You need to add trusted certificates to your scan images at runtime.
For more information
The following topics contain useful information for setting up scanner integrations in STO:
Coverity step configuration
The following steps outline the recommended workflow:
Add a Build or Security stage to your pipeline.
Add a Run step to upload your Coverity scan results to the pipeline workspace.
Add a Coverity step after the Run step and then configure it as described below.
Scan
Scan Mode
Ingestion Configure the step to read scan results from a data file and then ingest, normalize, and deduplicate the data.
Scan Configuration
The predefined configuration to use for the scan. All scan steps have at least one configuration.
Target
Type
The target type to scan for vulnerabilities.
Repository Scan a codebase repo.
In most cases, you specify the codebase using a code repo connector that connects to the Git account or repository where your code is stored. For information, go to Configure codebase.
Target and variant detection
When Auto is enabled for code repositories, the step detects these values using git:
To detect the target, the step runs
git config --get remote.origin.url.To detect the variant, the step runs
git rev-parse --abbrev-ref HEAD. The default assumption is that theHEADbranch is the one you want to scan.
Note the following:
Auto is not available when the Scan Mode is Ingestion.
By default, Auto is selected when you add the step. You can change this setting if needed.
Name
The identifier for the target, such as codebaseAlpha or jsmith/myalphaservice. Descriptive target names make it much easier to navigate your scan data in the STO UI.
It is good practice to specify a baseline for every target.
Variant
The identifier for the specific variant to scan. This is usually the branch name, image tag, or product version. Harness maintains a historical trend for each variant.
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:
Log Level
The minimum severity of the messages you want to include in your scan logs. You can specify one of the following:
DEBUG
INFO
WARNING
ERROR
Fail on Severity
Every STO scan 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:
CRITICALHIGHMEDIUMLOWINFONONE— 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:
YAML pipeline example
The following pipeline example illustrates an ingestion workflow. It consists of two steps:
A Run step that generates a simple Coverity data file.
A Coverity step that ingests the XML data.

Last updated
Was this helpful?