CPM plugin - PostGreSQL - Multi-statement commands with a single CPM action

CPM plugin - PostGreSQL - Multi-statement commands with a single CPM action

111
Created On 11/10/26 10:59 AM - Last Modified 11/10/26 15:50 PM


Symptom


By default, it uses the following single command to change and reconcile the password.

ALTER ROLE "%USER%" PASSWORD '%NEWPASSWORD%';

In some situations, customers may need to execute multi-statement commands with a single line of code. For example:

SET log_statement = 'none'; ALTER ROLE "%USER%" PASSWORD '%NEWPASSWORD%';



Environment


12.6 Privileged Access Manager (PAM, self-hosted) Central Policy Manager (CPM)

CPM - 12.6

Target - PostgresSQL



Cause


CPM will execute both commands separately.



Resolution


Use the syntax below in the ChangeCommand and ReconcileCommand

DO $$ BEGIN SET log_statement = 'none'; ALTER ROLE "%USER%" PASSWORD '%NEWPASSWORD%';END;$$;

*NOTE: Additional white space in the command will cause the CPM to flag out an error with a forbidden character. Be careful when typing the command manually.



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000k4XCAQ&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail