Translating without explicitly running OpenText SAST

You have the option to translate your Visual Studio project without invoking OpenText SAST directly. This requires the Fortify.targets file, which is located in <sast_install_dir>\Core\private-bin\sca\MSBuildPlugin in the DotNet and Framework directory. You can specify the file using an absolute or relative path in the build command line that builds your project. Use the path with the Dotnet or Framework directory depending on the build command you are using: dotnet.exe or MSBuild.exe respectively. For example:

dotnet.exe msbuild /t:rebuild /p:CustomAfterMicrosoftCommonTargets=<sast_install_dir>\Core\private-bin\sca\MSBuildPlugin\Dotnet\Fortify.targets Sample.sln

or

msbuild.exe /t:rebuild 
/p:CustomAfterMicrosoftCommonTargets=<sast_install_dir>\Core\private-bin\sca\MSBuildPlugin\Framework\Fortify.targets Sample.sln

There are several environment variables that you can set to configure the translation of your project. Most of them have default values, which OpenText SAST uses if the variable is not set. These variables are listed in the following table.

Environment variableDescriptionDefault value

FORTIFY_MSBUILD_BUILDID

Specifies the OpenText SAST build ID for translation. Make sure that you set this value.

This is equivalent to the OpenText SAST-b option.

None

FORTIFY_MSBUILD_DEBUG

Enables debug mode. This is equivalent to the OpenText SAST–debug option.

False

FORTIFY_MSBUILD_DEBUG_VERBOSE

Enables verbose debug mode. This is equivalent to the OpenText SAST–debug-verbose option. Takes precedence over FORTIFY_MSBUILD_DEBUG variable if both are set to true.

False

FORTIFY_MSBUILD_MEM

Specifies the memory requirements for translation in the form of the JVM -Xmx option. For example, -Xmx2G.

Automatic allocation based on physical memory available on the system

FORTIFY_MSBUILD_SCALOG

Specifies the location (absolute path) of the OpenText SAST log file.

This is equivalent to the OpenText SAST-logfile option.

%LOCALAPPDATA%/Fortify/
sca/log/sca.log