Getting Started with Workload Secrets Vault

This feature is currently available only to customers participating in a Private Preview. If you'd like to participate and be among the first to try this feature, ask our support or account team for details.

This walkthrough takes about 15 minutes. You sign in to the CLI, give yourself access to a test path, store and read a secret, roll back a change, and then let a pipeline read the secret.

Before You Begin

  • Workload Secrets Vault is enabled for your tenant. During the preview, your Delinea account team enables it.

  • You have the Platform Admin role, which includes every Workload Secrets Vault permission. Alternatively, you have a role with the Create Secret, Read Secret, Update Secret, Delete Secret, Create Authorization Policy, Read Authorization Policy, and Delete Authorization Policy permissions. For step 6, you also need the Delinea Platform rights to create service users, roles, and groups.

  • The Delinea CLI is installed. See Installing the CLI.

  • jq is installed, for working with JSON output.

Step 1: Sign In

Copy
delinea start
delinea login --tenant <your-tenant>.delinea.app
delinea status

Complete the sign-in in the browser window that opens. delinea status confirms who you're signed in as.

Step 2: Give Yourself Access to a Test Path

There's no default policy, so even an administrator can't use secrets until a policy allows it. Create a policy that gives you full access to everything under getting-started/. Replace <your-login-name> with the name you sign in with:

Copy
delinea --json workload policy create \
  --name getting-started \
  --description "Full access to the getting-started test path" \
  --status enabled \
  --effect allow \
  --actions '["create", "read", "list", "update", "delete", "restore", "destroy"]' \
  --subjects '["upn:<your-login-name>"]' \
  --targets '["secret/getting-started/*"]'

Note the id in the response; you'll use it to clean up. The policy usually takes effect right away, but it can take up to 5 minutes.

Step 3: Store a Secret

Copy
delinea --json workload secret create getting-started/demo-db --data '{"username":"demo","password":"first-password"}'

The response shows "version": 1.

Step 4: Read the Secret

Copy
delinea --json workload secret get getting-started/demo-db
delinea --json workload secret get getting-started/demo-db | jq -r '.data.data.password'

The first command shows the whole secret with its version information. The second prints only the password, the way a script would read it.

Step 5: Change the Secret and Roll Back

  1. Write a new version with a different password:

    Copy
    delinea --json workload secret create getting-started/demo-db --data '{"username":"demo","password":"second-password"}'
  2. Suppose the new password was a mistake. Roll back to version 1:

    Copy
    delinea --json workload secret rollback getting-started/demo-db --version 1
    delinea --json workload secret describe getting-started/demo-db

    The rollback creates version 3 with the data of version 1. Version 2 stays in the history.

Step 6: Let a Pipeline Read the Secret

  1. Create a service user for the pipeline, for example getting-started-pipeline. See Service Users.

  2. Create a role that has only the Read Secret permission. Assign the role to a group, and add the service user to the group. See Roles and Permissions.

  3. Create a policy that lets the service user read just this one secret:

    Copy
    delinea --json workload policy create \
      --name getting-started-pipeline \
      --status enabled \
      --effect allow \
      --actions '["read"]' \
      --subjects '["upn:<service-user-login-name>"]' \
      --targets '["secret/getting-started/demo-db"]'
  4. Store the service user's username and password as protected variables in your CI system. In the pipeline, sign in and read the secret:

    Copy
    delinea start
    echo "$WS_CLIENT_SECRET" | delinea login --tenant "$WS_TENANT" --client-id "$WS_CLIENT_ID" --client-secret-file -
    DB_PASSWORD=$(delinea --json workload secret get getting-started/demo-db | jq -r '.data.data.password')

    Signing in as a service user needs a recent version of the CLI. If delinea login doesn't accept --client-id, update the CLI.

    If the read fails with a permission error, check the role, the group membership, and the policy, and allow up to 5 minutes for a new group membership to take effect. See Troubleshooting Access.

Step 7: Clean Up

Copy
delinea workload secret metadata delete getting-started/demo-db
delinea workload policy list
delinea workload policy delete <policy-id>

Purging the secret removes all its versions permanently. Delete both policies you created, and the service user, role, and group if you don't need them.

Next Steps