Objective
How to download an agents contrast_security.yaml
via CURL commands from the Contrast UI.
Process
-
Login to the Contrast UI --> click on your name in the top right --> select User Settings and gather the following:
-
Organization ID
-
API Key
-
Authorization Header
-
-
Construct the CURL command using the information gathered:
curl --location --request GET '{host}/Contrast/api/ng/organizations/{org_id}/agent/config' \
-o {output_file} \
-H 'Authorization: {authorization}' \
-H 'API-Key: {api_key}' \
-H 'Content-Type: application/x-yaml' \
-H "Accept: application/x-yaml"
For example, the following command would download a contrast_security.yaml
file, which sets the application m:
curl --location --request GET 'https://app.contrastsecurity.com/Contrast/api/ng/organizations/05f247b3-a388-4928-90f6-15a0dd2d997f/agent/config' \
-o contrast_security.yaml \
-H 'Authorization: XXXXXXXXX' \
-H 'API-Key: XXXXXXXXXXX' \
-H 'Content-Type: application/x-yaml' \
-H 'Accept: application/x-yaml'
KEY:
{host}
The URL you use to login the Contrast UI (for example: https://app.contrastsecurity.com){org_id}
UUID of the organization{authorization}
https://docs.contrastsecurity.com/en/personal-keys.html
{output_file}
Where to save, file ending with .yamlA pre-populated CURL command can also be obtained through the + Add new > Application agent wizard found in the banner of the Contrast UI.