pspete / psPAS

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

Get-PASOnboardingRule not returning rule details #449

Closed seswho closed 1 year ago

seswho commented 1 year ago

Describe the issue Get-PASOnboardingRule does not return details of any Onboarding Rules. It only returns the RuleID, RuleName, TargetPlatformId, and TargetSafeName.

According to CyberArk documentation, all information related to an Onboarding Rule should be displayed: https://docs.cyberark.com/Product-Doc/OnlineHelp/PrivCloud-SS/Latest/en/Content/WebServices/GetAutoOnboardingRules.htm

This occurs regardless of calling this function with or without parameters.

To Reproduce Steps to reproduce the behavior:

  1. $OnboardingRules = Get-PASOnboardingRule
  2. $RuleDetails = Get-PASOnboardingRule -Names Rule1

Expected behavior All details related to Onboarding Rules regardless of how the function is called based on the results shown in the CyberArk documentation: https://docs.cyberark.com/Product-Doc/OnlineHelp/PrivCloud-SS/Latest/en/Content/WebServices/GetAutoOnboardingRules.htm#Result

Screenshots & Console Output See the attached file 0505f1a6c048.png for results of the call to Get-PASOnboardingRule


$Credentials = Get-Credential ([Environment]::UserName)
New-Passession -credential $Credentials -type RADIUS -baseuri https://custinfo.privilegecloud.cyberark.com
$LocalSession=Get-PASSession

# Checkout ajg_admin
$AdminCred = New-Object System.Management.Automation.PSCredential -ArgumentList ("admin", (Get-PASAccount -id 35_3 | Get-PASAccountPassword -Reason "Listing Onboarding Rules" ).ToSecureString())

# Create new session
New-PASSession -BaseURI https://ajg.privilegecloud.cyberark.com -Credential $AdminCred
$AdminSession = Get-PASSession

# Get list of Onboarding Rules

$OnboardingRules = Get-PASOnboardingRule 

ForEach($OnboardingRule in $OnboardingRules)
{
    Write-Output $OnboardingRule
}

# Close and unlock ajg_admin
Use-PASSession -Session $LocalSession

#Unlock-PASAccount -AccountID 35_3

$LocalSession = ""
$AdminSession = ""

Close-PASSession

Your Environment Include relevant details about your environment

Additional context Add any other context about the problem here. Annotation 2023-01-27 120404

pspete commented 1 year ago

Hi @seswho,

Thanks for raising this - I don't think the output of this function ever got updated inline with the updates to the documentation/functionality.

While we look into making the output available in the next module release, you can potentially already see/access the information like this:

$OnboardingRules | Select-Object *