Fortify ScanCentral SAST Command-Line Options
This appendix provides information about the command-line options that you can use with Fortify ScanCentral SAST. The Fortify ScanCentral SAST options are:
Global Options
This section provides information about the command-line options that you can use with Fortify ScanCentral SAST.
| Global Option | Use to: |
|---|---|
-debug |
Enables debug logging on ScanCentral SAST clients and sensors. For information on how to configure the logging level on the Controller, see Configuring the Logging Level on the Controller. |
|
or
|
Get help for the selected command. To see all command help, type |
-ssctoken <ScanCentralCtrlToken>
|
Specify the Fortify Software Security Center authorization |
-sscurl <url>
|
Specify the Fortify Software Security Center server URL. |
-url <url>
|
Specify the ScanCentral SAST Controller URL. |
-version
|
Get the product version. |
Status Command
Use the status command to check the status of the Controller or a job.
| Option | Description |
|---|---|
-ctrl
|
Verify that the Controller is running. |
-token, --job-token <token>
|
Specify the job token to query. |
Start Command
Use the start command to start a remote scan.
| Option | Description |
|---|---|
-application, --application <name>
|
Specifies the Fortify Software Security Center application |
|
|
For use with Maven, Gradle and MSBuild. Specifies custom build parameters for preparing and building a project. For example, to invoke a Gradle build before packaging: If you use the (Gradle only) If you do not use |
-b, --build-id <id>
|
Specifies the build ID |
-bf, --build-file <file>
|
Specifies the build file, unless it has a default name such as |
-block
|
Waits for the scan to complete, and then downloads the result. |
-bt, --build-tool <name>
|
Specifies the build tool name used for the project. You cannot use this option with the Example: |
-email <address>
|
Specifies the email address for job status notifications. |
-f, --output-file <file>
|
Specifies the name for the local FPR |
-filter <file>
|
Specifies the filter file to use during a scan (repeatable). |
|
|
Specifies the name to use for the FPR files uploaded to Fortify Software Security Center. The file name must not exceed 128 characters in length and must not contain the following invalid characters:
|
-hv, --php-version <version>
|
Specifies the PHP version. |
-log, --log-file <file>
|
Specifies the name for the local log file output. |
-mbs <file>
|
Specifies the mobile build session |
-o, --overwrite
|
Overwrites the existing FPR or log with new data. |
-p, --package <file>
|
Specifies the project package file to upload. |
-pool, --submit-to-pool <uuid>
|
Specifies the sensor pool |
-projroot, --project-root <dir>
|
Specifies the project directory for the mobile build session export. |
-projtl, --project-template <file>
|
Specifies the issue template |
-pyr, --python-requirements <file>
|
Specifies the Python project requirements file to install and collect dependencies. |
-pyv, --python-virtual-env <directory>
|
Specifies the Python virtual environment location. |
-q, --quiet
|
Prevents the printing of stdout from the build execution. |
-rules <file/dir>
|
Specifies custom rules |
-sargs, --scan-args
|
Fortify Static Code Analyzer scan arguments (repeatable) Takes a single string argument. For multiple scan arguments, use multiple Note: You cannot use the |
-scan
|
Sets the point beyond which all arguments are for sourceanalyzer. You cannot use this option with the
|
-snm, --scan-node-modules
|
Specifies node_modules dependencies in the package. If you set
Tip: Because including node_modules dependencies in a package does not greatly improve type resolution or dataflow, and can result in an excessive number of false positives, Fortify recommends that you exclude them from scans. By default, node_modules are not applied to a package unless you apply the |
-skipBuild
|
Disables the project preparation build step before packaging. If you use Caution! You can apply this option to Gradle and Maven build tools, but not to MSBuild. |
-sp, --save-package <file>
|
Specifies the package file to save after uploading. The file extension must be |
-sto, --scan-timeout
|
Specifies the maximum amount of time (in minutes) a scan job can be processed (and prevent a sensor from doing other work). Note: Use of this worker |
-t, --include-test
|
Includes test source set (Gradle) or test scope (Maven) to scan (for Java projects only). |
-targs, --translation-args
|
Fortify Static Code Analyzer translation arguments (repeatable) Takes a single string argument. For multiple translation arguments, use multiple Note: You cannot use the |
-upload, --upload-to-ssc
|
Uploads the FPR to Fortify Software Security Center upon completion. |
-uptoken, --ssc-upload-token <token>
|
Specifies the Fortify Software Security Center file upload token. Note: If the |
-version, --application-version <name>
|
Specifies the Fortify Software Security Center application version |
-versionid, --application-version-id <id>
|
Specifies the Fortify Software Security Center application version ID. |
-yv, --python-version <version>
|
Specifies the Python version to automatically find the installed Python. Allowed values: 2 or 3. This flag is ignored if the ScanCentral SAST client |
Retrieve Command
Use the retrieve command to download the result of a remote scan job.
| Option | Description |
|---|---|
-block
|
Wait for the job to complete and download the result. |
-f, --output-file <file>
|
Specify the file name for local FPR output. |
-log, --log-file <file>
|
Specify the file name for local log output. |
-o, --overwrite
|
Overwrite the existing FPR or log with new data. |
-token, --job-token <token>
|
Specify the job token to query. |
Cancel Command
Use the cancel command to cancel a remote scan job.
| Option | Description |
|---|---|
-token, --job-token <token>
|
Specify the job token to query. |
Worker Command
Caution! To avoid packaging failure for projects with file paths that contain an umlaut, you must first add the com.fortify.sca.CmdlineOptionsFileEncoding property to the fortify‑sca.properties file (located in the <sca_install_dir>/Core/config directory) and give it a value that is not encoded in ASCII.
Use the worker command to start or test a sensor.
| Option | Description |
|---|---|
-hello
|
Sensor reporting for duty. |
-pool, --assign-to-pool
|
Specifies the sensor pool to which the sensor is to be assigned after It connects to the Controller. If the sensor is already assigned to a pool, this option overrides that assignment. (If an error occurs In sensor pool assignment, the sensor shuts down.) |
-sto, --scan-timeout
|
Specifies the maximum amount of time (in minutes) a scan job can be processed (and prevent a sensor from doing other work). Note: Use of this worker option has a higher priority than the |
Package Command
Use the package command to create a zip package of the specified project.
| Option | Description |
|---|---|
|
|
Specify custom build parameters for preparing and building a project. For example, to invoke a Gradle build before packaging: If you use the (Gradle only) If you do not use You can use this option with Maven, Gradle and MSBuild. |
-bf, --build-file <file>
|
Specify the build file if you are not using a default name such as |
-bt, --build-tool <name>
|
Specify the build tool name used for the project. You cannot use this option with the project. |
-exclude
|
Use the |
-hv, --php-version <version>
|
Specify the PHP version. |
-o, --output <file>
|
Specify the output file name. The file extension must be |
| -oss, --open-source-scan | (Applies only to Fortify on Demand) Used to generate and collect additional files for scanning. For details see Fortify on Demand documentation. |
-pyr, --python-requirements <file>
|
Specify the Python project requirements file to install and collect dependencies. |
-pyv, --python-virtual-env <directory>
|
Specify the Python virtual environment location. |
-q, --quiet
|
Prevent the printing of stdout from the build execution. |
-sargs, --scan-args
|
Fortify Static Code Analyzer scan arguments (repeatable) Takes a single string argument. For multiple scan arguments, use multiple |
-snm, --scan-node-modules
|
Specifies node_modules dependencies in the package. If you set Tip: Because including node_modules dependencies in a package does not improve type resolution or dataflow results, and because they degrade translation and scan speed, Fortify recommends that you exclude them from scans. By default, node_modules are not applied to a package unless you apply the |
-skipBuild
|
Disables the project preparation build step before packaging. |
-t, --include-test
|
Include the test source set (Gradle) or test scope (Maven) to scan (for Java projects only). |
-targs, --translation-args
|
Fortify Static Code Analyzer translation arguments (repeatable) Takes a single string argument. For multiple translation arguments, use multiple |
-yv, --python-version <version>
|
Specify the Python version to automatically find the installed Python. Allowed values: 2 or 3. This flag is ignored if the ScanCentral SAST client is started under a Python virtual environment or if |
Arguments Command
Use the arguments command to generate a settings file for additional Fortify Static Code Analyzer command-line options. The settings file must reside in the same directory you specify ScanCentral SAST commands for remote translation and scanning.
| Option | Description |
|---|---|
-o, --overwrite
|
Overwrite the existing arguments file. |
-p, --project-dir <directory>
|
Specify the project directory in which to create the Fortify Static Code Analyzer translation and scan additional arguments file. |
-sargs, --scan-args
|
Fortify Static Code Analyzer scan arguments (repeatable) |
-targs, --translation-args
|
Fortify Static Code Analyzer translation arguments (repeatable) |
Important! The -targs and -sargs options take a single string argument. To specify multiple translation or scan arguments, use multiple -targs and (or) -sargs options. If the translation or scan option has a path parameter that includes a space, enclose the path in single quotes.
Example: The following generates a fortify-sca.settings file in the current directory.
scancentral.bat arguments -o -targs "-Xmx4G" -targs "-cp 'myProject Dir/path to/lib/*.jar'" -targs "-exclude 'myProject Dir/path to/src/*.js'" -sargs "-Xms256M" -sargs "-analyzers controlflow,dataflow"
The resulting fortify-sca.settings file looks similar to the following:
{
"translationArgs": [
"-Xmx4G",
"-cp",
"myProject Dir/path to/lib/*.jar",
"-exclude",
"myProject Dir/path to/src/*.jar"
],
"scanArgs": [
"-Xms256M","-analyzers", "controlflow,dataflow" ]
}
Progress Command
Use the progress command to get the progress of a Fortify Static Code Analyzer scan.
Important! If your projects are based on Java 11, and you want to use the progress command to check the progress of your scans, some minor sensor configuration is required. For instructions, see Configuring Sensors to Use the Progress Command when Starting on Java.
Update Command
Use the update command to update a client or sensor to the latest version available on the Controller. This updates a standalone client
ScanCentral SAST client that runs outside of SCA and Apps. to the latest available client version. It updates an embedded client
ScanCentral client that comes with SCA and Apps. or sensor to the latest available patch version, but does not update these to the next major version.