Install Go agent with Debian

To install the Go agent:

  1. Download both of the executable files from https://pkg.contrastsecurity.com. This command registers our package repository in your system:

    curl \
      https://pkg.contrastsecurity.com/api/gpg/key/public | sudo apt-key add -
    
    echo "deb https://pkg.contrastsecurity.com/debian-public/ $(sed -rne 's/^VERSION_CODENAME=(.*)$/\1/p' /etc/*ease) contrast" \
      | sudo tee /etc/apt/sources.list.d/contrast.list
    
    echo "deb https://pkg.contrastsecurity.com/debian-public/ all contrast" \
      | sudo tee -a /etc/apt/sources.list.d/contrast.list
    
  2. Once complete, use this command to install the agent and service:

    sudo yum install contrast-go contrast-service
  3. 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
  4. Build your application:

    contrast-go build -o output-name-of-application
  5. Configure the Go agent using the Go YAML template or environment variables.Configure the Go agentGo YAML template

  6. Install the Contrast service and run it using the command: ./contrast-service.Install the Contrast service

  7. Run your application using the executable from the output above.

  8. Exercise and test your application.

  9. Verify that Contrast sees your application.