Install the Go agent with direct download
To install the Go agent:
Download the executable files from
https://pkg.contrastsecurity.com
.The
contrast-go
executables can be downloaded directly for Mac and Linux operating systems. You can see available versions in the go-agent-release user interface. Replace<version>
with the version number you want, orlatest
.For Mac:
wget https://pkg.contrastsecurity.com/go-agent-release/<version>/darwin-amd64/contrast-go
or
curl -L https://pkg.contrastsecurity.com/go-agent-release/<version>/darwin-amd64/contrast-go > contrast-go
For Linux:
wget https://pkg.contrastsecurity.com/go-agent-release/<version>/linux-amd64/contrast-go
or
curl -L https://pkg.contrastsecurity.com/go-agent-release/<version>/linux-amd64/contrast-go > contrast-go
After download, verify that the agent is executable. For example:
chmod u+x contrast-go
Be sure the application has a
go.mod
file to indicate required dependencies. In the application source directory run the following command:go mod init
Build your application:
./contrast-go build -o output-name-of-application
Configure the Go agent using the Go YAML template or environment variables.
Run your application using the executable from the output above.
Exercise and test your application.
Verify that Contrast sees your application.