cyberark / epv-api-scripts

These API scripts enable CyberArk users to automate privileged account management task like account creation, user management, and more.
https://www.cyberark.com/best
Apache License 2.0
203 stars 176 forks source link

Fixing remoteMachineAddresses parsing in AOU #261

Closed sebokmarton closed 2 years ago

sebokmarton commented 2 years ago

Desired Outcome

This is to fix the parsing of the remoteMachines and accessRestrictedToRemoteMachines fields in AOU. Previously, an empty $_Account.remoteMachinesAccess object was created even if the fields were missing from the CSV, resulting in the script reseting these fields in CyberArk for every account:

[{"op":"remove","path":"/remoteMachinesAccess/remoteMachines"},{"op":"remove","path":"/remoteMachinesAccess/accessRestrictedToRemoteMachines"}]

Implemented Changes

Parsing logic was modified to only create the $_Account.remoteMachinesAccess object when there are corresponding fields in the CSV. This prevents unintentional account updates.

Connected Issue/Story

N/A

Definition of Done

Changelog

Test coverage

Documentation

Behavior

Security