How to download the contrast_security.yaml file via CURL

  • Updated

Objective

How to download an agents contrast_security.yaml via CURL commands from the Contrast UI.

Process

  1. 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
  2. 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
{output_file} Where to save, file ending with .yaml
 

A pre-populated CURL command can also be obtained through the + Add new > Application agent wizard found in the banner of the Contrast UI.

Was this article helpful?

0 out of 0 found this helpful

Have more questions? Submit a request