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

Add user/group filtering to `cybr safes list` #143

Closed infamousjoeg closed 2 years ago

infamousjoeg commented 2 years ago

Is your feature request related to a problem? Please describe. The cybr safes list command currently just lists all safes the logged in user has access to.

Describe the solution you'd like A filter added to cybr safes list that allows filtering based on user/group membership.

For example, cybr safes list -f jgarcia would return all safes the current logged in user can see that has jgarcia user as a member. Or, cybr safes list -f CyberArkVaultAdmins would return all safes the current logged in user can see that has CyberArkVaultAdmins Active Directory security group as a member.

Describe alternatives you've considered None.

Additional context None.

infamousjoeg commented 2 years ago

Rather than adding a filter to cybr safes list, the query parameters available for cybr safes list-members should be added. This will support filter=memberType%20eq%20user or filter=memberType%20eq%20group as well as search=<user/group name>.

By doing something like cybr safes list-members --user -s jgarcia or cybr safes list-members --group -s CyberArkVaultAdmins the same end result can be achieved and still fall in line with what the PAM REST API provides natively.

infamousjoeg commented 2 years ago

Actually, upon further thought, it won't be the same experience since it has to target a specific safe for safe members. However, the previous comment's functionality has to be added in order to support the original issue's request.

infamousjoeg commented 2 years ago

Rather than adding a filter to cybr safes list, the query parameters available for cybr safes list-members should be added. This will support filter=memberType%20eq%20user or filter=memberType%20eq%20group as well as search=<user/group name>.

By doing something like cybr safes list-members --user -s jgarcia or cybr safes list-members --group -s CyberArkVaultAdmins the same end result can be achieved and still fall in line with what the PAM REST API provides natively.

This is now supported on branch 143-add-usergroup-filtering-to-cybr-safes-list.