Scanning Go projects
To enable Fortify ScanCentral SAST clients to package Go projects for remote translation and scan, the following requirements must be met:
The Go compiler must be installed on the client to resolve project dependencies.
The Go compiler executable location must be available in the PATH variable.
Configure the Go environment variables. For example, to use a specific Go proxy, configure it as follows:
set GOPROXY=.... (Windows)export GOPROXY=... (Linux)Sensors do not require a connection to a Go proxy website to resolve dependencies because they run Go translation with
GOPROXY=offconfigured. Also, the vendor directory under the project root has all the required dependencies. The sensor rewrites theGOFLAGSsystem variable withGOFLAGS=-mod=vendorwhen it runs an OpenText SAST translation.The Go project must include a
go.modfile.OpenText recommends that the Go project includes a
go.sumfile to ensure that dependencies restored withgo mod vendorworks successfully.
To prevent Fortify ScanCentral SAST from automatically restoring dependencies using go mod vendor, include the -skipBuild option in the scan request command. If dependencies were already restored before running Fortify ScanCentral SAST, they are included in the project package that is sent to the Controller.