Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with CPM permissions in Add-PASSafeMember.ps1 script #349

Closed
Wim-Dams opened this issue May 20, 2021 · 3 comments · Fixed by #351, #354 or #360
Closed

Issue with CPM permissions in Add-PASSafeMember.ps1 script #349

Wim-Dams opened this issue May 20, 2021 · 3 comments · Fixed by #351, #354 or #360
Labels
bug: fixed Contains a bug resolution

Comments

@Wim-Dams
Copy link

Describe the issue
I really love this PsPas module but when we upgrade to version 5.0.0 suddenly all new created safes didn't have the CPM permissions anymore.
When we just use the Add-PASSafeMember script like below it set's all permissions, except InitiateCPMAccountManagementOperations=True; SpecifyNextAccountContent=True;

CommandUsed =
$result = $PermissionObject.Permissions | Add-PASSafeMember -SafeName $SafeName -MemberName $UserName -SearchIn $SearchInValue -ErrorAction Stop

Possible fix
My current quickfix was to add the following to these 2 parameters.
[parameter(
Mandatory = $true,
ValueFromPipelinebyPropertyName = $true,
ParameterSetName = 'Gen2'
)]

In the script itself it uses "{ $PSItem -match '^Gen2' }" so everything that starts with Gen2, like Gen2-CPM is excepted so I guess the issue is in command "ConvertTo-SortedPermission -Gen2" where you only to a case check on the complete value and discard all the rest.

I'm not sure my quickfix was a good one.

Your Environment
Include relevant details about your environment

  • PowerShell Version: 5.1
  • psPAS Version: 5.0.0
  • CyberArk Version: 12.1
@pspete
Copy link
Owner

pspete commented May 20, 2021

Thanks for the report @Wim-Dams , will find some time to take a look.

pspete added a commit that referenced this issue May 22, 2021
Resolves issue where some permissions may not be applied when using the Gen2 API.
Removes redundant parametersets `Gen1-CPM` & `Gen2-CPM`.
#349
@Wim-Dams
Copy link
Author

Wim-Dams commented May 22, 2021 via email

@pspete
Copy link
Owner

pspete commented May 22, 2021

Hi @Wim-Dams - yes, initially I couldn't replicate, but then noticed the same regarding piping an object into the function.
Fix incoming (already present in the issue-349 branch).

Thanks for reporting this, very much appreciated!

@pspete pspete linked a pull request May 22, 2021 that will close this issue
@pspete pspete added the bug: fixed Contains a bug resolution label May 22, 2021
@pspete pspete mentioned this issue May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: fixed Contains a bug resolution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants