Install the Go agent with direct download
To install the Go agent:
Download both of the executable files from
https://pkg.contrastsecurity.com
.The
contrast-go
andcontrast-service
executables can be downloaded directly for Mac and Linux operating systems. You can see available versions in the contrast-service-release and go-agent-release user interface. Replace<version>
with the version number you want, orlatest
.For Mac:
wget https://pkg.contrastsecurity.com/contrast-service-release/<version>/darwin-amd64/contrast-service wget https://pkg.contrastsecurity.com/go-agent-release/<version>/darwin-amd64/contrast-go
or
curl -L https://pkg.contrastsecurity.com/contrast-service-release/<version>/darwin-amd64/contrast-service > contrast-service curl -L https://pkg.contrastsecurity.com/go-agent-release/<version>/darwin-amd64/contrast-go > contrast-go
For Linux:
wget https://pkg.contrastsecurity.com/contrast-service-release/<version>/linux-amd64/contrast-service wget https://pkg.contrastsecurity.com/go-agent-release/<version>/linux-amd64/contrast-go
or
curl -L https://pkg.contrastsecurity.com/contrast-service-release/<version>/linux-amd64/contrast-service > contrast-service curl -L https://pkg.contrastsecurity.com/go-agent-release/<version>/linux-amd64/contrast-go > contrast-go
After download, verify that the agent and service are executable. For example:
chmod u+x contrast-service 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.
Install and run the Contrast service through the command:
./contrast-service
.Run your application using the executable from the output above.
Exercise and test your application.
Verify that Contrast sees your application.