infamousjoeg / cybr-cli

A "Swiss Army Knife" command-line interface (CLI) for easy human and non-human interaction with @CyberArk suite of products.
Apache License 2.0
71 stars 15 forks source link

Username (-f) not recognized by `cybr ccp get-account` #103

Closed infamousjoeg closed 3 years ago

infamousjoeg commented 3 years ago

Describe the bug When executing the command cybr ccp get-account and providing a username -f instead of object name -o, the username is not appended to the URI as a query parameter.

Command: cybr ccp get-account -b https://cyberark.joegarcia.dev -i test-cli -s D-Win-SvcAccts -f Svc_CybrCLI

Response:

2021/03/29 09:37:28 Invalid response from CCP url 'https://cyberark.joegarcia.dev/AIMWebService/api/Accounts?AppID=test-cli&FailRequestOnPasswordChange=false&Safe=D-Win-SvcAccts'. Status Code: 400 Bad Request. {"ErrorCode":"APPAP229E","ErrorMsg":"Too many password objects matching query [Safe=D-Win-SvcAccts] were found: (Safe=D-Win-SvcAccts;Folder=Root;Object=Operating System-WinDomain-10.0.4.48-Svc_CybrCLI, Safe=D-Win-SvcAccts;Folder=Root;Object=Operating System-WindowsDomainAccount-DualAccounts-10.0.4.48-dualaccount1 and more. See trace log for more information). (Diagnostic Info: 41)"}

To Reproduce Steps to reproduce the behavior:

  1. Execute cybr ccp get-account while providing a username using the -f flag.
  2. See error

Expected behavior What should happen is the CCP should return the account object data in a JSON response. At the very least, it should not complain about too many password objects matching query and when running --verbose the Username= parameter should be appended to the URI query.

Desktop (please complete the following information):

infamousjoeg commented 3 years ago

Was using -f wrong... it is to denote output. -f Content works to return only password.