Issue short-lived Azure credentials | Pathfinder
A workflow for Workload Credentials on BeyondTrust Pathfinder
Long-lived client secrets for Azure service principals are easy to leak and hard to track. Short-lived credentials limit the damage: each secret works for a set time, and you can revoke it the moment a workload is done with it. This workflow shows you how to set that up in Workload Credentials.
Scope of this guide
This guide covers setting up Microsoft Entra ID app registrations, creating an Azure connector and an Azure dynamic secret, and generating and revoking short-lived credentials. A dynamic secret is the setting that tells Workload Credentials how to issue temporary credentials for one target app. This guide does not cover Amazon Web Services (AWS) connectors or static secrets.
Prerequisites
- You have a Workload Credentials role assigned to your group in the BeyondTrust Pathfinder platform.
- You can create app registrations and grant admin consent in your Microsoft Entra ID tenant.
- You have the Azure CLI installed and signed in to the same tenant.
Steps
Step 1: Set up the integration app registration in Azure
Workload Credentials signs in to Azure as this app registration.
- In the Azure portal, go to Microsoft Entra ID > App registrations, then select New registration.
- Enter a name, for example, beyondtrust-secrets-integration, then select Register.
- Copy the Application (client) ID and the Directory (tenant) ID.
- Go to Certificates & secrets > Client secrets, then select New client secret.
- Enter a description, choose an expiry, then select Add.
- Copy the secret Value right away. Azure does not display it again.
- Go to API permissions, then select Add a permission.
- Select Microsoft Graph > Application permissions.
- Search for and add Application.ReadWrite.OwnedBy.
- Select Grant admin consent for [tenant], and confirm the status shows Granted.
Application.ReadWrite.OwnedBy is the least privilege the integration needs. It lets the integration manage only the app registrations it owns. You set ownership of each target app in Step 2.
Step 2: Set up a target app registration in Azure
The target app is the identity your workloads sign in as when they use a generated credential.
-
In the Azure portal, go to Microsoft Entra ID > App registrations, then select New registration.
-
Enter a name, for example, db-readonly-target, then select Register.
-
Copy the Object ID of the app registration. Use the Object ID, not the Application (client) ID.
-
Give the target app the access your workloads need:
- For Microsoft Graph or other API access, go to API permissions, add the required application permissions, then select Grant admin consent for [tenant].
- For Azure resource access, open the resource's Access control (IAM) page and assign a role to this app's service principal.
-
Run this Azure CLI command to find the object ID of the integration service principal:
az ad sp show --id <integration-app-client-id> --query id -o tsv -
Run this Azure CLI command to add the integration service principal as an owner of the target app:
az ad app owner add --id <target-app-object-id> --owner-object-id <integration-sp-object-id>
ImportantOnly owners can manage an app's password credentials when the integration has Application.ReadWrite.OwnedBy. The owners picker in the Azure portal accepts only users, so you must add the owner from the Azure CLI.
Step 3: Create an Azure connector
A connector stores the sign-in details Workload Credentials uses to reach your Azure tenant.
- In Pathfinder, select Menu > Workload Credentials.
- Select Integrations in the sidebar.
- On the Azure card, select Manage Connectors.
- Select the Add another Azure connector card.
- Enter a unique Name.
- Enter the Tenant ID, Client ID, and Client Secret of the integration app registration from Step 1.
- Select Create connector.
Workload Credentials checks the connector by requesting a Microsoft Graph token. If the check fails, confirm the tenant ID, client ID, and client secret. Also confirm the integration app has Application.ReadWrite.OwnedBy with admin consent granted.
Step 4: Create an Azure dynamic secret
- In Pathfinder, select Menu > Workload Credentials.
- Select Create > Dynamic secret.
- Select the Azure connector you created in Step 3.
- Enter a unique Name.
- Enter the Application Object ID of the target app from Step 2.
- Enter the TTL Hours and TTL Minutes. Time to live (TTL) is how long each generated credential stays valid. The total must be between 1 and 24 hours.
- Select Create Dynamic Secret.
The Dynamic secret option is unavailable until at least one connector exists.
Step 5: Generate and revoke short-lived credentials
- In Pathfinder, select Menu > Workload Credentials.
- Find the dynamic secret you created in Step 4.
- In the Actions column, select View Details.
- Select Generate credentials. The Generated Credentials dialog box displays the Client ID, Client Secret, and Tenant ID.
- Select Copy as environment variables, and store the values where your workload can use them.
- Close the dialog box. The new lease appears in the Active Leases panel.
- When the workload no longer needs the credential, find the lease in the Active Leases panel and select Revoke.
ImportantThe dialog box shows the credentials only once. You can't recover them after you close it. If you don't revoke a lease, Workload Credentials revokes it automatically when the TTL expires.
Verify the results
Confirm that your workload can sign in to Azure with the generated client ID, client secret, and tenant ID. After you revoke the lease, confirm that it no longer appears in Active Leases and that the next sign-in with that client secret fails.
Next steps
- Automate credential requests from your workloads with the Workload Credentials CLI or Workload Credentials API.
- Control who can generate credentials with role-based access control (RBAC) policies. For more information, see RBAC policies in Workload Credentials.
Related resources
Updated 6 days ago