Skip to main content

Install Go agent with Debian

To install the Go agent:

  1. Download 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:

    sudo apt-get update && sudo apt-get install contrast-go
  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.

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

  7. Exercise and test your application.

  8. Verify that Contrast sees your application.