Update session management policy of platform deletes connectors settings on target platform
Symptom
You are using the REST API PUT call to update the PSM policy on the target platform.
The PSM policy ID is updated successfully but it overwrites the current connectors settings, and causes them to become empty. This may affect PSM server services.
Example API call:
#!/usr/bin/bash logon_password="pwd" /usr/bin/curl -X PUT -H "Content-Type: application/json" -H "Authorization: $logon_password" -d '{"PSMServerId":"test"}' https://<pvwa-url>.com/PasswordVault/api/Platforms/Targets/<target-d>/PrivilegedSessionManagement
Example Response Body:
{
"PSMConnectors":[],
"PSMServerId": "PSMServer"
}
You would like to know why it causes the PSMConnectors settings on the target platform to become an empty array for the above call.
Environment
12.1;12.2;12.4;12.3;12.5;12.6;13.0 Privileged Access Manager (PAM, self-hosted) Cyber-Ark API/SDK Cyber-Ark API/SDK REST API
Cause
The issue described is valid by design.
REST API standards dictates that in PUT requests the full request body is required. This means that any property excluded from the request is treated as "deleted".
https://docs.cyberark.com/Product-Doc/OnlineHelp/PAS/Latest/en/Content/SDK/Session%20Mngmnt%20-%20Update_Session_Management_Policy_Platform.htm?tocpath=Developer%7CREST%20APIs%7CSession%20Management%7C_____5
Resolution
In the PUT request for this PrivilegedSessionManagement endpoint, enter the full request body with all desired properties including any existing connectors.