Solution Guide: Primary Secret RPC is Changing the Passwords of Dependent Secrets
You can create multiple secrets for a single username-password combination, each with distinct templates and authorizations. Managing password changes, however, can become challenging due to the singular nature of the user account. To address this issue, you can use a linked password strategy. This approach ensures that any password modifications are made solely to the Primary Secret, with the updated password value automatically propagated to the dependent secrets.
In most environments, we recommend using a separate password for each account for optimal security. Use this linked password strategy only when multiple secrets must share the same credentials for one remote account.
For a different method that uses a PowerShell dependency changer and the Notes field, see Using RPC for Secrets with Shared Credentials.
Prerequisites
The following Delinea permissions are required for the API user's role:
-
Edit Secret
-
View Secret
-
View Advanced Secret Options
The API user will also need edit access to the secrets to be managed.
Procedure
-
Upload this script to the scripts library.
-
Settings:
-
State: Enabled
-
Script Type: PowerShell
-
Category: Dependency
-
Does not need to enable PowerShell Core processing.
-
-
Update the top line(s) of the script to include the URL for your Vault either in the
SecretServerURLorDelineaPlatformURLentry. -
The other URL should be left as
$null.
-
-
Create an account that the script will use to authenticate and perform operations on the dependent secrets:
-
Secret Server: Create a local user with the Application Account checkbox selected. See Creating Users.
-
Delinea Platform: Create a service user. See Adding Service Users in the Delinea Platform documentation.
-
-
Create a secret that stores the username and password of the account you just created. You will select this secret later in the Associated Secrets step, which accepts only secrets, not user accounts. Any secret template with username and password fields will work. See Creating Secrets.
-
Grant the account edit access to each dependent secret whose password will be updated. In the Sharing section of each dependent secret, grant Edit permission to the Application Account (Secret Server) or service user (Delinea Platform):
-
The Primary secret needs a way to include the secret IDs to update in a template field. You can:
-
Create a new template that is a copy of the current template and add a new text field called Linked.
-
Add a new text field to the existing template named Linked.
-
Use an existing text field on the current template (e.g. Notes).
The last argument is this field name, so you will need to customize the argument name to match your selected field.
-
-
Write the secret IDs whose linked password you will change into the Linked field. This field is located on the Overview tab of the Primary secret, by clicking the edit button (a pencil icon) next to it.
The secrets should be entered as a comma-separated list with no spaces, e.g. 15,16,2692 not 15, 16, 2692. -
On the Primary secret, access the Remote Password Changing tab.
-
In the Associated Secrets section, click Edit.
-
Select Add Secret, add the secret you created earlier for the Application Account or service user, and Save.
-
Access the Primary secret’s Dependencies tab.
-
Add a new dependency by selecting New Dependency. The Create Dependency popup appears.
-
From the Type dropdown, select the script from the Run PowerShell Script section. More fields appear that you will need to fill in.
-
Select an existing dependency group or create a new group. If you create a new group:
-
Name the group.
-
Name the new group site from the associated dropdown.
-
-
Name the dependency with an informative name e.g. "Linked Secrets".
-
Optionally provide a description.
-
Make sure the Enabled checkbox is selected.
-
For the Run As option, select a secret that has Delinea permissions to run PowerShell code on the site.
-
For the Arguments field add the following:
$PASSWORD $[1]$USERNAME $[1]$PASSWORD $LINKED. -
Click Save.
Advanced
In some cases you may wish to initiate a password change on the target secrets rather than just updating the password field.
You can enable this by updating the arguments:
Arguments: $PASSWORD$[1]$USERNAME $[1]$PASSWORD $LINKED "RotatePassword"
Older versions of Secret Server may require using individual edits rather than bulk actions. You can enable this behavior by including the value Legacy as the 6th argument:
Arguments: $PASSWORD$[1]$USERNAME $[1]$PASSWORD $LINKED "RotatePassword" "Legacy"or Arguments: $PASSWORD$[1]$USERNAME $[1]$PASSWORD $LINKED "UpdatePassword" "Legacy"