pspete / psPAS

PowerShell module for CyberArk Privileged Access Security REST API
https://pspas.pspete.dev
MIT License
293 stars 91 forks source link

Get-PASAccount -filter is not returning any results but is receiving body #304

Closed AndrewCopeland closed 4 years ago

AndrewCopeland commented 4 years ago

Describe the issue Currently if I perform just Get-PASAccount I can retrieve all the accounts inside of Cyberark. However when I attempt to filter on SafeName I am not receiving any accounts.

To Reproduce Steps to reproduce the behavior:

  1. Install Module
  2. Import Module
  3. Create new pssession
  4. then run `Get-PASAccount -filter "SafeName eq safeName"

Expected behavior I expect to a get a list of accounts that exists within the safe provded.

Console Output Code Block:

PS C:\Users\andco> $VerbosePreference = "continue"
PS C:\Users\andco> Get-PASAccount -filter "SafeName eq WindowsDualAccount"
VERBOSE: GET https://[redacted]/PasswordVault/api/Accounts?filter=SafeName eq
WindowsDualAccount with 0-byte payload
VERBOSE: received 1059-byte response of content type application/json; charset=utf-8
PS C:\Users\andco> Get-PASAccount -filter "SafeName eq DevOps_Safe"
VERBOSE: GET https://[redacted]/PasswordVault/api/Accounts?filter=SafeName eq
DevOps_Safe with 0-byte payload
VERBOSE: received 2663-byte response of content type application/json; charset=utf-8
PS C:\Users\andco> Get-PASAccount -filter "SafeName eq NotReal"
VERBOSE: GET https://[redacted]/PasswordVault/api/Accounts?filter=SafeName eq NotReal
with 0-byte payload
VERBOSE: received 22-byte response of content type application/json; charset=utf-8

Your Environment Include relevant details about your environment

Additional context

pspete commented 4 years ago

🙏 Thanks for reporting @AndrewCopeland - this is related to a recent update to the internal logic ofGet-PASAccount - missed this before it made it into the release. Fix identified & incoming. In the meantime, you should be able to get the results like this:

Get-PASAccount -SafeName WindowsDualAccount
pspete commented 4 years ago

Fixed in psPAS 4.3.65