Configure the Mend CLI for SCA
Overview
Configuring the Mend CLI for an SCA scan can be done via command line parameters.
Tip: For inline assistance, use the mend dep||dependencies -h
or mend dep||dependencies --help
commands.
Getting it done
Configure the Mend CLI SCA scan via command line parameters
You can configure the Mend CLI SCA scan at runtime by adding flags to the mend dep
or( || ) the mend
dependencies
command. The usage of the mend dep|dependencies
command is as follows:
mend dep||dependencies [flags]
Note: Backwards compatibility is supported for the previously used mend sca
command. However, we recommend switching to the updated command at your earliest availability.
Reference
Mend CLI SCA parameters
The Mend CLI SCA parameters provided below are organized alphabetically within each of their relevant contexts.
Mend CLI SCA - General scan parameters
Parameter | Description | Mend CLI Default Behavior |
---|---|---|
Command Line: | Optional. Specify the target directory for the Mend CLI SCA scan. | Current directory (“ |
Command Line: | Optional. Perform a file system scan for source files, in addition to the package manager-based dependencies resolution. Note: The Mend CLI SCA file system scan does not support the scanning of binaries (i.e. JAR, ZIP, DLL). | Only the package manager dependency resolution is enabled. |
Command Line: Environment Variable: | Optional. Disable the Mend pre-defined folder exclusions, allowing these folders to be included in the Mend CLI SCA scan. | Mend pre-defined folder exclusions: |
Environment Variable: | Optional. Define directories to be excluded from the Mend CLI scan via a comma-separated list using glob format. These directories will append the default exclusions (unless --no-default-exclusions is in use). Note: Using this variable will append the default exclusions. The default exclusions remain in effect unless --no-default-exclusions is used. | No additional folders are excluded except for the default exclusions. |
Command Line: | Optional. Fail the Mend CLI SCA command if any resolution step fails. | Scan will complete regardless of the resolution steps' success. |
Command Line: | (Beta) Optional. Compute reachability for each CVE. Reachability will be computed for supported programming languages only. The scan may take longer. | No reachability scan will be performed. Minimal CLI version: 24.3.1 |
Mend CLI SCA - Log parameters
Tip: The Mend CLI SCA scan logs can be found locally in the .mend/logs/sca
directory.
Parameter | Description | Mend CLI Default Behavior |
---|---|---|
Environment Variable: | Optional. Define the verbosity of the Mend CLI SCA scan log files. The available values are:
Note:
| The Mend CLI log files are set to the |
Mend CLI SCA - Policy parameters
Parameter | Description | Mend CLI Default Behavior |
---|---|---|
Command Line: | Optional. Enable the Mend CLI policy check to fail the scan if an open-source component is found that violates a policy defined within your Mend organization, returning an | The policy check is enabled and findings are provided, however, the Mend CLI scan does not fail even if a violation occurs. |
Mend CLI SCA - Terminal view parameters
Parameter | Description | Mend CLI Default Behavior |
---|---|---|
Command Line: | Optional. Set the scan result format within the terminal. The supported formats are:
| Mend CLI outputs scan results within the terminal in |
Command Line: | Optional. Display the available parameters for the | Use this parameter on-demand to display the available parameters for the |
Command Line: | Optional. Mend CLI will run in non-interactive mode, suppressing use of colors, progress bar and any other graphic features in STDOUT. | Mend CLI output to STDOUT includes use of colors and progress bars, which are irrelevant in non-interactive session and may cause issues in some environments. |
Mend CLI SCA - Upload parameters
Parameter | Description | Mend CLI Default Behavior |
---|---|---|
Command Line: | Optional. Set the scan scope for your project by specifying the hierarchy for the Mend Core. The The supported formats are:
Examples of
The wild card character “*” can be used for any of the hierarchy levels. The default Mend CLI behavior will be used for any “*”.
CODE
“CLI” will be the product used or created in place of the “*”.
CODE
The organization currently logged into from the
For Mend CLI scans that do not update the Mend Core, the Note:
| Within the Mend Core, scans are tiered under an organization → product → project hierarchy. If
Tip: Use the Mend CLI
|
Command Line: | Optional. Update the inventory of the project within the Mend Core. | Scan results are not sent to the Mend SCA Core application. |
Command Line: | Optional. Add a Mend Platform project label to the scanned project. Set of comma-separated labels is also supported. Note:
| No label applied |
Command Line: | Optional. Add a Mend Platform application label to the scanned application. Set of comma-separated labels is also supported. Note:
| No label applied |
Command Line: | Optional. The scan output will be saved to a local file and won't update your project in the application. The local file will be saved in the same directory as your Mend CLI with a default name. You may select a different location or filename by specifying it using --export-results.
| The scan output will not be saved locally.
|
Mend CLI SCA - Supported Languages
Mend CLI SCA dependency resolution
Language | Package Manager | Details |
---|---|---|
C# | NuGet | Prerequisites:
Supported dependency file(s): One of the following sets:
Notes:
|
Go | Go Modules | Prerequisites:
Supported dependency file(s): go.mod |
Java | Gradle | Prerequisites:
Supported dependency file(s): build.gradle Specifications:
|
Java | Maven | Prerequisites:
Supported dependency file(s): pom.xml Specifications:
|
JavaScript | NPM | Prerequisites:
Supported dependency file(s): One of the following sets:
Specifications:
|
JavaScript | Yarn | Prerequisites:
Supported dependency file(s): package.json and yarn.lock |
PHP | Composer | Prerequisites:
Supported dependency file(s): composer.json and composer.lock |
Python | pip | Prerequisites:
Supported dependency file(s): requirements.txt |
Ruby | Bundler | Prerequisites:
Supported dependency file(s): Gemfile and Gemfile.lock |
Scala | SBT | Prerequisites:
Supported dependency file(s): sbt files Specifications:
NOTE: SBT has various known and well documented GitHub issues. Some of these issues might also affect the success and/or accuracy of the Mend SCA scan. |
Swift | SPM | Prerequisites:
Supported dependency file(s): Package.swift Specifications:
|
Mend CLI SCA file system scan
Note: The Mend CLI SCA file system scan does not support the scanning of binaries (i.e. JAR, ZIP, DLL).
The Mend CLI scan supports the following languages and their source files for the SCA file system scan: Supported File Formats - Source.
Mend CLI SCA exit codes
Note: For a comprehensive overview of Mend CLI SCA exit codes, please refer to our Mend CLI Exit Codes article.