Set up target baselines in STO
How to set up baselines. Every scanned target needs one.
Every scanned target should have a baseline, which represents the root variant, such as the main branch of a Git repository, the latest tag or a digest (e.g., @sha256:abc123...) of a container image. Baselines make it easy to identify issues in the baseline vs. issues in a downstream variant derived from that baseline.
To view and edit the current baseline for a target, go to Test Targets:

Target baselines
You can specify baselines for individual targets.
Fixed target baselines
You can specify a fixed value if you know that the baseline for a target will not change.
Scan the target with the baseline variant if you haven't yet done so.
Go to Test Targets.
In Baseline for Comparison, set the value type to Fixed and select the baseline from the menu of scanned variants.

Add shared path for scan results
RegEx target baselines
You can specify a RegEx baseline if the baseline changes over time and you can capture it using a regular expression.
Go to Test Targets.
Set the value type for the target to RegEx and enter the regular expression.

Add shared path for scan results
Default baselines based on regular expressions
You can specify default baselines for specific target types: code repositories, container images, web/API instances, and infrastructure configurations. STO includes a set of predefined defaults for repository and container image targets.
For repositories, the baseline is
masterormain.For container images, the baseline is
latestor the most recently scanned Semantic Version number if it can be detected, such as1.2.3v1.15.4
STO does not include predefined default RegEx baselines for application instances and configurations.
To specify default RegExes:
Go to the Default settings page for the scope you want:
Account settings — all targets in the account
Organization settings — overrides account defaults
Project settings — overrides organization defaults

Select scope Go to Default Settings > Security Testing Orchestration.

Add shared path for scan results Enter the regular expression you want in the Value field.
Regex baselines reference
Regex baselines: important notes
You must use a consistent naming scheme for your scanned variants. This is necessary to ensure that your regular expression captures your baselines consistently and predictably.
Carefully consider which targets you want to use for your baselines. In general, the baseline should be the root element for all your current variants.
When you specify a regular expression, the baseline is the most recently scanned target that matches the expression.
Use re2 format for your expressions.
Defining regular expressions is outside the scope of this documentation. Harness recommends that you test any regular expressions thoroughly to ensure that the expression matches any variant name that might be used for the scan target.
RegEx baseline examples
The following table shows a few simple examples of expressions for specific use cases.
main master
^(main|master)$
If the scanned variant is
mainormaster, set the baseline.
Useful as the default baseline for code repositories.
latest 1.2.3 v2.3.4
^(v?\d+.\d+.\d+([+-][a-zA-Z0-9.+-]+)?|latest)$
If the scanned variant is either
latestor a Semantic Version release number, set the baseline.Useful as the default baseline for container images.
release-20230420 release-20230427 release-20230504 release-20230511
^(release-\d+)$
Start with
release, dash.Follow with one or more digits.
code-v1.1 code-v1.2 code-v1.3 code-v2.1 code-v2.2 code-v20.31
^(code-v\d+.\d*)$
Start with
code, dash,v.Follow with one or more digits, dot, one or more digits.
1.14.6-linux-amd64 1.14.11-linux-amd64 1.15.4-linux-amd64
^(\d*.\d*.\d*-linux-amd64)$
Start with one or more digits, dot, one or more digits, dot, one or more digits.
Follow with hyphen,
linux-amd64
3 3.17 3.17.3 3.18 3.18.12 30.142.1 30
^([\d.]+)$
Any combination of digits and dots.
2023-02-11, 17:59:12 2023-02-17, 11:17:23 2023-02-23, 08:36:47
^(\d{4}-\d{2}-\d{2},\s\d{2}:\d{2}:\d{2}$)
This is the timestamp format used for scanned variants when auto-detect for targets and variants is enabled for instance scanners such as ZAP.
2023-02-11 2023-02-17 2023-02-23
^(\d{4}-\d{2}-\d{2})$
Simple date format.
Last updated
Was this helpful?
