Overview
Mend for Azure Repos provides various parameters to customize SCA scans, checks, and issue configurations.
Getting It Done
Configuration at the local repository level is done via the .whitesource file. To set up your configuration file for SCA scans, see the Parameters section provided in this documentation. Below is an example of fine-tuning an SCA scan within a repository’s .whitesource file:
{
"scanSettings": {
"configMode": "AUTO",
"enableLicenseViolations": true,
"baseBranches": []
},
"pullRequestStatusSettings": {
"displayMode": "diff",
"vulnerablePullRequestStatus": "failed",
"useMendStatusNames": true
},
"issueSettings": {
"minSeverityLevel": "LOW"
},
"remediateSettings": {
"workflowRules": {
"enabled": true
}
}
}
Note: For global configuration, parameters are set via the global-config.json or repo-config.json files. See our Set up a global configuration for Mend for Azure Repos documentation for more information.
Reference
Parameters
Scan Settings (scanSettings)
|
Parameter |
Type |
Description |
|---|---|---|
|
configMode |
String |
Optional. Default Value:
Note: whitesource.config can be provided both in the global config and in the repo itself. If it is provided in both places and there are parameters that are set on both levels - the repo level will take precedence. |
|
configExternalURL |
String |
Required only if configMode is set to The following protocols are supported: 'ftp://', 'http://', 'https://'. For example: ‘https://<mydomain.com>/whitesource-settings/wss-unified-agent.config’ Notes:
|
|
projectToken |
String |
Optional. Default Value: N/A. Adds the ability to map an Azure repository to an existing Mend project. The parameter used needs to be the Mend project token. Note: Not supported in the Global Configuration. |
|
baseBranches |
Array |
Optional. Default Value: Example usage: ["master", “integration"] This will set both master and integration branches as base branches. Notes:
|
|
releaseBranches |
Array |
Optional. Default Value: N/A. Upon receiving a valid push to branches matching the releaseBranches value(s), the repository integration will trigger a scan on these branches, creating a check run with the scan results. A project within the Mend UI will also be created for each unique release branch, based on the branch's name. Example:
Notes:
|
|
enableLicenseViolations |
Boolean |
Optional. Default Value: Notes:
|
|
javaVersion |
String |
Optional. Default Value: Available values: Note:
|
|
cloneSubmodules |
Boolean |
Optional. Default Value: Note:
|
|
repoNameSync |
Boolean |
Optional. Default Value: |
|
skipScanningStage |
Object |
Optional. Default Value: The available parameters are:
All package managers for which a pre-step is available can be specified, e.g., Usage example:
|
|
exploitability |
Boolean |
Optional. Default Value: Additional information about exploitability is available in the designated Public Exploits page. |
|
uaConfigMergeSetting |
String |
Optional. Default Value: Note: All other UA settings are always overridden on a local level. |
Pull Request Status Settings (pullRequestStatusSettings)
|
Parameter |
Type |
Description |
|---|---|---|
|
displayMode |
String |
Optional. Default Value:
|
|
vulnerablePullRequestStatus |
String |
Optional. Default Value:
Notes:
|
|
licensePullRequestStatus |
String |
Optional. Default Value:
Notes:
|
|
showWsInfo |
Boolean |
Optional. Default Value: Mend information is only displayed if the commit originated from a base branch.
The following hidden JSON object will also be added inside the Commit Status when this parameter is enabled:
NOTE: Additional Mend data may be added inside the JSON object in the future. |
|
useMendStatusNames |
Boolean |
Optional. Default Value:
Note: When .whitesource is created the value of useMendStatusNames is |
|
strictMode |
String |
Optional. Default Value:
|
|
strictModeInfo |
Boolean |
Optional. Default Value:
|
Issue Settings (issueSettings)
Note: Starting with the release of version 22.12.1 (January 2nd, 2022), to take advantage of the Critical label for vulnerabilities for existing Work Items created by our repo integration, a new scan must be triggered on the repository. If a scan has not been triggered after upgrading to this version, the repo will show only the previous three labels (High, Medium, Low) for existing Work Items. For more information on the Critical setting, please visit our documentation here.
|
Parameter |
Type |
Description |
|---|---|---|
|
minSeverityLevel |
String |
Optional. Default Value: Available values for minSeverityLevel:
Notes:
|
|
minVulnerabilityScore |
String |
Optional. Default Value: For more information on CVSS 3 Scores, click here. Notes:
|
|
maxVulnerabilityScore |
String |
Optional. Default Value: For more information on CVSS 3 Scores, click here. Notes:
|
|
displayLicenseViolations |
Boolean |
Optional. Default Value: Note: This parameter is relevant only if enableLicenseViolations (scanSettings) is set to true. |
|
customLabels |
Array |
Optional. Default Value: N/A. Define labels that will be added to the Azure DevOps Repos issues created after the scan. Usage example:
The following labels are not available for use:
|
|
customFields |
Object |
Optional. Default Value: If a field with a matching name exists in the work item template and the value is a compatible data type, it will be added to the work item. Example of use:
Note:
|
|
issueType |
String |
Optional. Default Value:
|
Remediate Settings (remediateSettings)
|
Parameter |
Type |
Description |
|---|---|---|
|
enableRenovate |
Boolean |
Optional. Default Value See Renovate configuration options for all configuration options. Refer here for parameter usage. |
|
workflowRules |
Object |
Required. Default Value:
This parameter is used to specify the rules that regulate when to open remediation pull requests. Usage examples:
|
|
workflowRules.enabled |
Boolean |
Required. Default Value: Note: Workflow rules can also be set in the Mend application in the Admin → Integration Workflow Rules. But if this parameter is set to |
|
workflowRules.minVulnerabilitySeverity |
String |
Optional. Default Value: E.g. if set to Note: If this parameter is used together with minVulnerabilityScore or maxVulnerabilityScore, only minVulnerabilitySeverity will take effect. |
|
workflowRules.minVulnerabilityScore |
Float |
Optional. Default Value: For more information on CVSS 3 Scores, click here. Note: If this parameter is used together with minVulnerabilitySeverity it will not have any effect. |
|
workflowRules.maxVulnerabilityScore |
Float |
Optional. Default Value: For more information on CVSS 3 Scores, click here. Note: If this parameter is used together with minVulnerabilitySeverity it will not have any effect. |
Languages
Refer to the Mend Languages page to find out if your language and its extensions are supported.
Note: For information on scanning private dependencies, visit our Configure Mend for Azure Repos to resolve your private dependencies documentation.
Below are specific scenarios of language configuration for Mend for Azure Repos:
Python support
The default Python version, as well as the available versions to choose from if you have a Python project incompatible with the default version, are listed here.
To change the Python version, follow these steps:
-
Add a .whitesource configuration file to your repository. Alternatively, you can apply this globally across your repositories by using the Global Repo Configuration.
-
Use the
configModeparameter and set it to either LOCAL or EXTERNAL. -
In the whitesource.config file, add the following:
python.invokePipAsModule=true python.path=python3.9 python.installVirtualenv=true
Note: for python.path specify only the major version number, e.g., python2.7, python3.9, etc.
R Support
The default CRAN Mirror URL used by the integration is https://cloud.r-project.org/ . If you need to change the CRAN Mirror URL, do as follows:
-
Add a .whitesource configuration file to your repository. Alternatively, you can apply this globally across your repositories by using the Global Repo Configuration.
-
Use the configMode parameter and set it to either LOCAL or EXTERNAL.
-
In the whitesource.config file, add the following parameter: r.cranMirrorUrl=<INSERT_URL_HERE>.
Supported Dependency Files
The following dependency files are supported for Mend for Azure Repos SCA scans:
-
bower.json
-
build.gradle
-
build.gradle.kts
-
build.sbt
-
conanfile.py
-
conanfile.txt
-
cargo.toml
-
composer.json
-
dependencies.scala
-
environment.yml
-
Gemfile.lock
-
glide.lock
-
go.mod
-
Godeps.lock
-
gogradle.lock
-
Gopkg.lock
-
gradle.lockfile
-
gradle.properties
-
libs.gradle
-
libs.versions.toml
-
package-lock.json
-
package.json
-
paket.dependencies
-
packages.config
-
packages.lock.json
-
packrat.lock
-
Pipfile
-
pipfile.lock
-
pnpm-lock.yaml
-
Podfile
-
poetry.lock
-
pom.xml
-
pubspec.yaml
-
pyproject.toml
-
requirements.txt
-
settings.gradle
-
setup.cfg
-
setup.py
-
vendor.conf
-
versions.kt
-
yarn.lock
-
Any metafile with one of the following extensions:
-
asp
-
aspx
-
config
-
csproj
-
do
-
gitmodules
-
htm
-
html
-
jsp
-
shtml
-
tf
-
xhtml
-
-
Cargo.lock