pspete / psPAS

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

Guru Meditation - HTML Response Received #533

Closed bast1en closed 2 months ago

bast1en commented 2 months ago

Hi,

I'm using the following test code to get accounts in a Safe:

$cred = Get-Credential
New-PASSession -IdentityTenantURL https://abc123.id.cyberark.cloud -PrivilegeCloudURL https://blabla.cyberark.cloud -Credential $Cred -IdentityUser
Get-PASAccount -SafeName "TheSafeName"

Authentication with CyberArk Identity seems OK (with Mobile authn for MFA), as I don't have an error at this tage. However when I add the "Get-PASAccount" command, then I get this error "Guru Meditation - HTML Response Received".

Thanks for your help.

bast1en commented 2 months ago

Get-IDSession works fine, so authn is OK I think

image

varuns29 commented 2 months ago

I'm also getting the same error while running Get-PASSafe. Any Idea to resolve this error? image

pspete commented 2 months ago

Completion of the complete issue template helps with timely response and investigation.

The following method should work without issue.

New-PASSession -tenantSubdomain yourPCloudTenant -Credential $cred -IdentityUser

pspete commented 2 months ago

Had some time to look into this and can replicate the issue. Currently no idea why it is happening, but using the command/method in previous response does not exhibit the behaviour. So continue to suggest using New-PASSession -tenantSubdomain yourPCloudTenant -Credential $cred -IdentityUser until the issue is fixed

pspete commented 2 months ago

Correction - this is due to an incorrect value for privilege cloud URL being specified.

Refer to the docs here: https://pspas.pspete.dev/commands/New-PASSession#example-30

@bast1en , in your example code the value provided for PrivilegeCloudURL needs to be updated as per the example:

$cred = Get-Credential
New-PASSession -IdentityTenantURL https://abc123.id.cyberark.cloud -PrivilegeCloudURL https://blabla.privilegecloud.cyberark.cloud -Credential $Cred -IdentityUser
Get-PASAccount -SafeName "TheSafeName"

@varuns29 - am assuming you just need to follow the example in the docs also?

bast1en commented 4 days ago

Hello @pspete, I had a chance to test again. Although authentication works (including MFA), the rest is not working for me:

The code:

$cred = Get-Credential
New-PASSession -IdentityTenantURL https://abc1234.id.cyberark.cloud -PrivilegeCloudURL https://mypcloudtenant.privilegecloud.cyberark.cloud -Credential $Cred -IdentityUser

Write-Host -ForegroundColor Yellow "- Trying Get_IDSession:"
Get-IDSession
Write-Host -ForegroundColor Yellow "- End."
Write-Host -ForegroundColor Yellow "- Trying Get-PASAccount -SafeName ""TheSafeName"":"
Get-PASAccount -SafeName "TheSafeName"
Write-Host -ForegroundColor Yellow "- End."
Write-Host -ForegroundColor Yellow "- Closing session with Close-PASSession:"
Close-PASSession
Write-Host -ForegroundColor Yellow "- End."

The result: image