Ansible module for CCP Query

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements

Welcome Idira to LIVEcommunity!

Our community just got stronger! Explore new identity security resources, connect with experts, and discover more ways to learn and collaborate.

Meet Idira

Ansible module for CCP Query

L3 Networker

Hi All,

 

Am trying to write Ansible Query for CCP to fetch SSH key from CyberArk.

When I try normally like below its works,

https://cyberark-ccp.com/AIMWebService/api/Accounts?AppID=Elastic-Stack&Safe=CY-SVR-LNX-LOC-MTP-GLP&...” -O ssh.key

 

But When I try to run with Ansible it fails with 404.

 

https://cyberark-ccp.com/AIMWebService/api/Accounts?AppId=Elastic-Stack&Query=CY-SVR-LNX-LOC-MTP-GLP...

 

Can anyone help me with ansible query to get ssh key from CCP. I refer cyberark.pas.cyberark_credential module – Credential retrieval using AAM Central Credential Provider... but this is failing with 404.

 

Thanks,

Subash

1 accepted solution

Accepted Solutions

L7 Applicator

Hi @Subash Jesuraj​ 

 

The issue seems to that the Ansible module

cyberark.pas.cyberark_credential

formats the URL query differently than a manual browser or wget request.

 

Try this in Ansible YAML file.

 

- name: Retrieve SSH Private Key from CyberArk CCP

 cyberark.pas.cyberark_credential:

  api_base_url: "https://cyberark-ccp.com" 

  app_id: "Elastic-Stack"  

  query: "Safe=CY-SVR-LNX-LOC-MTP-GLP;Folder=Root;Object=OperatingSystem-CY-Unix-via-SSH-Keys-accountname-elastic_install" 

output: "Password"  

 

 

Hope it helps !

 

View solution in original post

2 REPLIES 2

L7 Applicator

Hi @Subash Jesuraj​ 

 

The issue seems to that the Ansible module

cyberark.pas.cyberark_credential

formats the URL query differently than a manual browser or wget request.

 

Try this in Ansible YAML file.

 

- name: Retrieve SSH Private Key from CyberArk CCP

 cyberark.pas.cyberark_credential:

  api_base_url: "https://cyberark-ccp.com" 

  app_id: "Elastic-Stack"  

  query: "Safe=CY-SVR-LNX-LOC-MTP-GLP;Folder=Root;Object=OperatingSystem-CY-Unix-via-SSH-Keys-accountname-elastic_install" 

output: "Password"  

 

 

Hope it helps !

 

This Works @Malhar Vora​ 

 

Thank you

  • 1 accepted solution
  • 223 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!