Skip to main content

Install Go agent with direct download

To download, build, and install the Go agent from a direct download:

  1. Download the executable files from https://pkg.contrastsecurity.com.

    The contrast-go executables can be downloaded directly for Mac and Linux, on AMD64 and ARM64. You can see available versions in the go-agent-release user interface. Replace <version> with the version number you want, or latest. Replace <os>-<arch> with darwin-amd64, darwin-arm64, linux-amd64, or linux-arm64.

    wget https://pkg.contrastsecurity.com/go-agent-release/<version>/<os>-<arch>/contrast-go

    or

    curl -L https://pkg.contrastsecurity.com/go-agent-release/<version>/<os>-<arch>/contrast-go > contrast-go
  2. After download, verify that the agent is executable. For example:

    chmod u+x contrast-go
  3. Make sure the application is a Go module. If the application source directory has no go.mod file, run the following command in that directory, replacing <module-path> with the path of your module:

    go mod init <module-path>
  4. Build your application:

    ./contrast-go build -o output-name-of-application
  5. Configure the Go agent. A connection token is the recommended method. Set CONTRAST__API__TOKEN in the environment where you run your application.

    You can also use other environment variables or the Go YAML template Go YAML template.

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

Verify the agent deployment

Interact with your application as you normally would. For example, interact with your application's web interface or send API commands.

  1. In the Agent Wizard, select View agent activity to verify that your agent appears in the agents list.

  2. Verify that you see the name of your application in the applications list.

    • In Northstar, select Applications from the left navigation.

    • In Contrast, select Applications from the header.

  3. Verify that you see the name of your local server in the servers list.

    • In Northstar, select Servers from the left navigation.

    • In Contrast, select Servers from the header.