Common agent settings
These are the settings most people set. Every agent supports them unless a note says otherwise. To see every setting for an agent, use the Agent configuration editor or the agent's YAML template.
Each setting has a path, such as application.name. You write it differently in each source:
In a YAML file, nest the path.
application:then name:my-appon the next line, indented.As an environment variable, write
CONTRAST__followed by the path in upper case with double underscores between the parts. The settingapplication.namebecomesCONTRAST__APPLICATION__NAME. See Environment variables.As a Java system property, write
-Dcontrast.followed by the path. The settingapplication.namebecomes-Dcontrast.application.name. (Java agents only.)
Connection settings
Set the agent token. Use the other four only with agents that are older than the versions listed in Find the agent keys.
Setting | What it does | Default |
|---|---|---|
| The agent token, a base64 encoded JSON object that holds the URL, API key, service key and user name. See Find the agent keys. | None |
| The Contrast web interface URL. |
The Python and PHP agents have no default, so set the URL or use the agent token. |
| The API key the agent uses to communicate with Contrast. | None |
| The service key. The agent uses it to calculate the Authorization header. | None |
| The user name. The agent uses it to calculate the Authorization header. | None |
Name your application and server
These settings control how Contrast shows your application and server:
Setting | What it does | Default |
|---|---|---|
| Overrides the application name that the agent reports. On Java, when one process serves several applications, this setting makes the agent report all of them as one application with this name. | The agent derives a name from the application |
| The application group to associate the application with in Contrast. | None |
| The application code to use for the application in Contrast. | None |
| Overrides the application version that the agent reports. | None |
| Overrides the server name that the agent reports. | The host name of the machine |
| Overrides the server environment. Use | The host name of the machine |
Organize and filter your data
Tags, application metadata, and session metadata help you find and filter applications, servers, libraries, and vulnerabilities in Contrast:
Setting | What it does | Default |
|---|---|---|
| Labels for the application. | None |
| Labels for the server. | None |
| Labels for vulnerabilities and preflight messages. | None |
| Labels for libraries. | None |
| Your own | None |
| The ID of a session that already exists in Contrast. The agent associates the vulnerabilities it finds with that session. | None |
|
| None |
Note
Write every tag setting as one comma-delimited string, for example label1,label2,label3. Don't use a YAML list. Write metadata as comma-delimited key=value pairs, for example business-unit=accounting,office=Baltimore.
Use either application.session_id or application.session_metadata, not both. Some agents don't start when both are set.
Common session metadata keys are commitHash, committer, branchName, gitTag, repository, testRun, version, and buildNumber. Most agents also add a build fingerprint named artifactHash for you.
To learn what tags, metadata and sessions do in Contrast, see Tag applications, Configure metadata values for individual applications, and Configure session metadata. Use session metadata filters to find the agent versions that add artifactHash.
Turn the agent off
Set the top-level enable setting to false to turn an agent off without removing it.
Note
It is not the same as assess.enable or protect.enable, which switch off only Assess or only Protect.
In a YAML file, write enable: false at the left margin with no parent key. As an environment variable, write CONTRAST__ENABLE=false. The default is true.
Write true or false in lower case. Some agents turn themselves off when they can't read the value, so a value such as True, yes, or 1 can switch an agent off with no message.