Install Go agent with Red Hat Package Manager (RPM)

To install the Go agent:

  1. Download both of the executable files from https://pkg.contrastsecurity.com. Use this script in your shell to configure your RPM-based system for our package repository. You may need sudo permissions.

    tee /etc/yum.repos.d/contrast.repo <<-"EOF"
    [contrast]
    name=Contrast centos-$releasever repo
    baseurl=https://pkg.contrastsecurity.com/rpm-public/centos-$releasever/
    gpgcheck=0
    enabled=1
    EOF
  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 and run the Contrast service through the command: ./contrast-service.Install the Contrast service

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

  8. Exercise and test your application.

  9. Verify that Contrast sees your application.