Configure an agent

When you download and install an agent, you will need to configure the agent so it works properly with your application and your agent language. To configure the agent:

  1. Download the agent-specific YAML configuration file from Contrast. This file is already populated with the API configuration values needed to connect Contrast.

  2. In addition to the standard configuration for your agent that appears in this file, each agent has unique properties that may need to be configured individually.

    For example, you can use a YAML template unique to your agent language to adapt the config file to your particular situation.

    Select the language to access the YAML template and learn more about agent-specific configuration: Java, .NET, .NET Core, Node.js, Python, Ruby).

  3. Be sure the config file is called contrast_security.yaml and is in the proper place for your agent. Read more about load path and order of precedence.

Important

You can use environment variables to specify every configuration option supported by the contrast_security.yaml file.

Environment variable names are derived from the YAML path by replacing path segment delimiters (.) with double underscores (__).

For example:

YAML path

Environment variable

contrast.server.name

CONTRAST__SERVER__NAME

contrast.api.api_key

CONTRAST__API__API_KEY

Tip

Since YAML is a natural superset of JSON you can configure your agent using JSON in your YAML file.