Skip to content

Instantly share code, notes, and snippets.

@infamousjoeg
Last active January 21, 2022 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infamousjoeg/7c1466a9163d90ee6e04a37fad2dfb25 to your computer and use it in GitHub Desktop.
Save infamousjoeg/7c1466a9163d90ee6e04a37fad2dfb25 to your computer and use it in GitHub Desktop.
This example demonstrates how to utilize CURL to make a REST API call to CyberArk Application Identity Manager's (AIM) Centralized Credential Provider to securely fetch a privileged account.
curl -k 'https://components.joe-garcia.local/AIMWebService/api/Accounts?AppID=AIM-CCP-Test&Safe=T-APP-CYBR-RESTAPI&Folder=Root&Object=Operating%20System-WinDomain-joe-garcia.local-Svc_CyberArkREST'
@infamousjoeg
Copy link
Author

image

@C3RB3RUS0869
Copy link

Awesome work as always! Just wanted to share using your code as the sample to use variables which could be helpful possibly (obviously this may be a little different depending on the setup of CyberArk and your environment)

BASEURL="https://components.joe-garcia.local/AIMWebService/api/Accounts"
APPID="AIM-CCP-Test"
SAFE="T-APP-CYBR-RESTAPI"
FOLDER="Root"
OBJECTNAME="Operating%20System-WinDomain-joe-garcia.local-Svc_CyberArkREST"

curl -s -k
"${BASEURL}"'?AppID='"${APPID}"'&Safe='"${SAFE}"'&Folder='${FOLDER}'&Object='"${OBJECTNAME}" | cut -f2 -d":" | tr -d '"' | cut -f1 -d","

@cschokke
Copy link

Do you know how to do this while using certificates?

@infamousjoeg
Copy link
Author

@cschokke Yeah, you include --cacert <file>.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment