Avoid SecretNameInSecretStore Duplicate Accounts in Target

Avoid SecretNameInSecretStore Duplicate Accounts in Target

146
Created On 11/10/26 10:55 AM - Last Modified 11/10/26 15:57 PM


Objective


Overview

Secrets Hub normally creates target secrets using its default naming convention:

 

<SafeName>-<AccountName>

 

The optional SecretNameInSecretStore account property allows an organization to replace this default convention with a custom distributed external target secret store's (e.g. AWS Secrets Manager, Azure Key Vault, Google Cloud Secret Manager, HashiCorp Vault, etc.) secret name.

 

When custom naming is implemented correctly, one PAM account should correspond to one target secret whose name matches the value of SecretNameInSecretStore.

 

Expected Result

For each PAM account:

      • One secret should be created in the target secret store.
      • The target secret name should exactly match SecretNameInSecretStore.
      • Future password changes should update the existing custom-named secret.
      • Secrets Hub should not create an additional <SafeName>-<AccountName> secret.

The custom secret name must be unique within the target secret store.



Environment


Secrets Hub Other (Technical)

Procedure


Important Prerequisite

The SecretNameInSecretStore property must be added to the account’s actual platform before:

 

1. The PAM account is created.

2. The target secret store is created in Secrets Hub.

 

The Secrets Hub platform imported into PAM supplies the custom property definition. The account itself should continue to use its normal functional platform, such as a Windows, Unix, database, or application platform.

 

The imported Secrets Hub platform should not be assigned to the account.

 

Correct Implementation Order

Use the following sequence when enabling custom secret naming for a new target secret store integration.

 

Step 1: Import the Secrets Hub platform

Import the Secrets Hub platform into PAM if it has not already been imported.

 

The imported platform makes the SecretNameInSecretStore property available for use with other platforms.

 

Step 2: Add the property to the actual account platform

Edit the platform that will be assigned to the PAM accounts.

 

Add the property using the exact internal property name:

 

SecretNameInSecretStore

 

Use the documented display name:

 

Secret Name In Target Secret Store

 

Confirm that:

      • The internal name is spelled exactly as documented.
      • The property is added to the actual platform assigned to the account.
      • The platform change is saved and activated.
      • The property is visible when creating a new account using that platform.

 

Step 3: Create or register the target secret store

After the custom property has been added to all applicable account platforms, create the target secret store in Secrets Hub.

 

Important! Do not reuse a target secret-store registration that was created before custom naming was configured when performing the initial validation.

 

Note: A new empty target secret store provides the cleanest validation, but it is not strictly necessary when the existing vault contains unrelated secrets.

 

Step 4: Create the synchronization policy

Create the synchronization policy that maps the required PAM Safe to the target secret store.

 

Confirm that:

      • The correct Safe is selected.
      • The correct target secret store is selected.
      • Secrets Hub has the required access to the Safe.
      • Secrets Hub has the required target permissions.
      • The policy is enabled and healthy.

 

Step 5: Create the PAM account

Create a new PAM account using the platform modified in Step 2.

 

During the initial account creation, populate:

 

Secret Name In Target Secret Store

 

Enter the exact target secret name that should be used.

 

For example:

 

prod-sql-service-password

 

Important! Do not create the account and add the property afterward. The property should be populated as part of the initial account-creation operation.

 

Step 6: Verify the saved account properties

Before evaluating the synchronization result, confirm that the PAM account contains the expected value.

 

Verify:

  • Safe name
  • Account name
  • Assigned platform
  • SecretNameInSecretStore value

 

When available, the account can also be checked through the PAM Accounts REST API to confirm that the custom property was saved.

 

Step 7: Verify the target secret store result

Allow the normal synchronization process to run.

 

The expected result is one target secret named exactly as specified in SecretNameInSecretStore.

 

For example:

 

prod-sql-service-password

 

Important! A second secret using the following default format should not be created:

 

<SafeName>-<AccountName>

 

Step 8: Test password synchronization

Change or reconcile the PAM account password and allow Secrets Hub to synchronize it.

 

Confirm that:

      • The existing custom-named target secret is updated.
      • A new default-named secret is not created.
      • The consuming application can retrieve the updated value.

 

 

Why Configuration Order Matters

Secrets Hub uses the target secret’s name as part of the mapping between the PAM account and the secret-store object.

 

If the target secret store and synchronization policy already exist before custom naming is configured, Secrets Hub may initially process the account using the default naming convention.

 

When a later synchronization detects SecretNameInSecretStore, the custom name may be treated as another target object instead of an in-place rename. This can result in:

 

1. An immediately created default-named secret.

2. A custom-named secret created during a later synchronization.

3. Two target secrets representing one PAM account.

 

Secrets Hub does not generally rename an existing target secret when the source identifier changes. For example, Idira documents that renaming a PAM account creates a new target secret while the original secret is not renamed or deleted.

 

 

Cleaning Up Existing Duplicate Secrets

 

Example Duplicate Condition

A single PAM account may have created both:

 

    • ProductionSafe-SQLServiceAccount
    • prod-sql-service-password

 

The custom-named secret should normally be retained, but neither secret should be deleted until its use and synchronization state have been verified.

 

Cleanup Precautions

Before deleting anything:

 

    • Do not delete the PAM account as a cleanup method.
    • Do not assume that the custom-named secret is already the active one.
    • Do not remove a secret that is still used by an application.
    • Do not run cleanup during a password rotation or reconciliation.
    • Record the existing secret names, identifiers, tags and timestamps.
    • Confirm that the current secret value can be recovered from PAM if necessary.

 

Current Secrets Hub versions may automatically delete the related target secret when a PAM account is deleted. Therefore, deleting and recreating the PAM account could affect the valid custom-named secret and should not be used as the first cleanup method.

 

Step 1: Identify the Duplicate Pair

In the target secret store, locate both secrets.

 

Record the following for each secret:

    • Secret name
    • Creation timestamp
    • Last updated timestamp
    • Enabled or disabled state
    • Current version identifier
    • Tags applied by Secrets Hub
    • Expiration settings
    • Application dependencies
    • Recent access activity, when target logging is available

 

Also review the Secrets Hub Secrets and Activity views for the same entries.

 

Step 2: Identify the Intended Secret

The intended target secret is normally the secret whose name matches:

 

SecretNameInSecretStore

 

Confirm the value directly on the PAM account.

 

Important! Do not rely only on the names observed in the target secret store.

 

Step 3: Determine Which Secret is Actively Synchronized

Perform a controlled validation.

 

1. Record the current version and update time of both target secrets.

2. Change or reconcile the PAM account password during an approved test window.

3. Allow Secrets Hub synchronization to complete.

4. Check which target secret received a new version or updated value.

 

Possible results:

Only the custom-named secret updates

This is the preferred state. The default-named secret is likely stale and can be considered for removal after dependency checks.

 

Only the default-named secret updates

Do not delete the default-named secret. The custom-name mapping has not become authoritative and the configuration requires further investigation.

 

Both secrets update

Do not delete either secret yet. Secrets Hub may still have two active mappings, and the case should be escalated with synchronization evidence.

 

Neither secret updates

Investigate the synchronization policy, Safe permissions, target-store connectivity and retrieval activity before performing cleanup.

 

Step 4: Check Application and Automation Dependencies

Determine which target secret name or path is currently referenced by workloads, applications, infrastructure definitions, deployment systems and automation.

 

Important! Do not assume that the custom-named secret is the object currently being consumed. Applications may still reference the original default-named secret directly by name, resource identifier, ARN, URI or Vault path.

 

Search for references to both:

 

    • The default secret name, such as <SafeName>-<AccountName>
    • The value configured in SecretNameInSecretStore

 

Check the following dependency locations.

    • General Application Dependencies
    • Application configuration files
    • Environment variables
    • Connection strings
    • Application source code
    • SDK and API calls
    • Secret names stored in databases or configuration services
    • Startup scripts and service definitions
    • Windows services and scheduled tasks
    • Linux systemd units and shell scripts
    • Container images, entrypoint scripts and runtime configuration
    • Serverless application configuration
    • Batch jobs and scheduled workloads

 

Kubernetes and Container Platforms

    • Kubernetes Deployments, StatefulSets, DaemonSets, Jobs and CronJobs
    • Kubernetes Secrets and ConfigMaps
    • Secrets Store CSI Driver configurations
    • SecretProviderClass resources
    • External Secrets Operator resources
    • Container environment-variable definitions
    • Mounted secret volumes
    • Helm charts and values files
    • Kustomize overlays
    • Operators and custom resources
    • Argo CD and Flux GitOps repositories
    • Amazon EKS workloads
    • Azure Kubernetes Service workloads
    • Google Kubernetes Engine workloads
    • Kubernetes applications using HashiCorp Vault Agent, Vault CSI Provider or Vault Secrets Operator

 

Note: AWS, Google Cloud and HashiCorp all provide supported mechanisms for exposing secret-store values to Kubernetes workloads, including CSI-mounted files, synchronized Kubernetes Secrets and Vault-specific injection mechanisms.

 

Infrastructure-as-Code and Configuration Management

    • Terraform configurations, modules, state and variable files
    • OpenTofu configurations
    • Azure Bicep templates
    • Azure Resource Manager templates
    • AWS CloudFormation templates
    • AWS CDK applications
    • Google Cloud deployment configurations
    • Pulumi projects
    • Ansible playbooks and roles
    • Chef recipes
    • Puppet manifests
    • Salt states

 

Caution! Pay particular attention to templates that reference secrets dynamically during deployment. For example, CloudFormation can reference AWS Secrets Manager objects, while Bicep and ARM deployments can retrieve values from Azure Key Vault.

 

CI/CD and Build Systems

    • Azure DevOps pipelines and variable groups
    • GitHub Actions workflows and repository or environment secrets
    • AWS CodeBuild, CodeDeploy and CodePipeline
    • Google Cloud Build
    • Jenkins jobs and credentials
    • GitLab CI/CD variables
    • CircleCI, Bamboo and TeamCity configurations
    • Argo Workflows
    • Tekton pipelines
    • HCP Terraform or Terraform Enterprise workspaces
    • Deployment scripts and release automation

 

Important! Google Cloud Build, for example, can expose Google Secret Manager values to build steps, while Vault and Terraform integrations may store secret paths or mount names in workspace and pipeline configuration.

 

AWS Secrets Manager Dependencies

Check for the original secret name or ARN in:

 

      • AWS Lambda environment variables and application code
      • Amazon ECS task definitions
      • Amazon EKS SecretProviderClass resources
      • EC2 application configuration
      • AWS Batch job definitions
      • AWS Systems Manager Parameter Store references
      • CloudFormation dynamic references
      • AWS CDK stacks
      • CodeBuild and CodePipeline configurations
      • IAM policies and resource policies
      • Secret rotation Lambda configurations
      • EventBridge rules and automation
      • Applications using AWS SDK GetSecretValue calls
      • Database or service integrations that reference a secret ARN

 

Important! AWS workloads may identify a secret using its name, full ARN or a partial ARN. Update all applicable references before deleting the obsolete object. ECS, EKS and CloudFormation can consume Secrets Manager secrets directly.

 

Azure Key Vault Dependencies

Check for the original secret name or secret URI in:

 

      • Azure App Service application settings
      • Azure Functions settings
      • Azure Logic Apps Standard settings
      • Azure Container Apps
      • Azure Kubernetes Service workloads
      • Azure Virtual Machine applications and extensions
      • Azure Automation runbooks
      • Azure DevOps variable groups
      • Key Vault references using @Microsoft.KeyVault(...)
      • Managed identity integrations
      • Bicep and ARM templates
      • Terraform configurations
      • APIM named values and policies
      • Data Factory linked services
      • Synapse configurations
      • Logic Apps connectors
      • Applications using Azure SDK or REST API calls
      • Scripts using Azure CLI or PowerShell
      • Configuration containing a versioned or versionless Key Vault secret URI

 

App Service, Azure Functions and Logic Apps Standard can use Key Vault references directly in application settings or connection strings.

 

Review whether the application references:

 

      • Only the secret name
      • A versionless secret URI
      • A URI containing a specific secret version

 

Caution! A versioned URI may continue retrieving an old version even after the custom-named secret is correctly synchronized.

 

Google Cloud Secret Manager Dependencies

Check for the original secret ID or resource name in:

 

      • Cloud Run services and jobs
      • Cloud Run functions
      • Google Kubernetes Engine workloads
      • Compute Engine applications
      • App Engine applications
      • Google Cloud Build configurations
      • Workflows
      • Composer or Airflow environments
      • Vertex AI workloads
      • Terraform configurations
      • Deployment Manager or other deployment automation
      • GitHub Actions or external CI/CD systems
      • Applications using Google Cloud client libraries
      • Scripts using gcloud secrets
      • IAM policies and service-account permissions
      • Secret Manager CSI or Kubernetes synchronization resources

 

Google Cloud services may reference a secret using a resource similar to:

 

projects/<ProjectID>/secrets/<SecretID>/versions/<Version>

 

Cloud Run, Cloud Run functions, GKE and Cloud Build can consume Secret Manager values through native integrations or runtime configuration.

 

Confirm whether consumers use:

 

      • The secret ID
      • The complete resource name
      • The latest version alias
      • A fixed numeric version

 

Caution! A workload pinned to a numeric version may not automatically consume a newly synchronized version.

 

HashiCorp Vault KV v2 Dependencies

Check for the original secret path in:

 

      • Application Vault API calls
      • Vault Agent templates
      • Vault Agent Injector annotations
      • Vault Secrets Operator resources
      • Vault CSI Provider configurations
      • Kubernetes service-account integrations
      • AppRole configurations
      • Terraform Vault provider resources and data sources
      • HCP Terraform workspace variables
      • Jenkins Vault plugin configuration
      • GitLab Vault integration
      • Nomad job specifications
      • Consul Template configurations
      • Shell scripts using the Vault CLI
      • Configuration-management systems
      • Custom applications using Vault SDKs
      • Policy path statements
      • Vault namespaces and mount-path definitions

 

Note: For HashiCorp Vault, the dependency may include more than the visible secret name. Record the complete combination of:

 

      • Vault namespace
      • KV v2 mount path
      • Secret path
      • Key within the secret
      • Version, when explicitly requested

 

For example, these may refer to different locations:

 

secret/application/database

 

shared/application/database

 

Important! The KV v2 HTTP API also inserts /data/ into the API path even though that segment is not normally included in the CLI path. Do not change application paths based solely on the API representation.

 

Important! Also review Vault policies. A workload may have authorization to read the original path but not the new custom path.

 

Monitoring, Security and Governance Dependencies

Check for references in:

 

      • SIEM correlation rules
      • Cloud audit-log queries
      • Alerting and monitoring rules
      • Secret-expiration monitors
      • Rotation monitoring
      • Compliance reports
      • CMDB records
      • Service catalogs
      • Asset inventories
      • Backup and disaster-recovery procedures
      • Incident-response runbooks
      • Access-review documentation
      • Data-loss-prevention rules
      • Cost-allocation tags or labels

 

These systems may not retrieve the secret value, but they may identify or monitor it by name, ARN, URI or Vault path.

 

Dependency Validation

Important! Before deleting the obsolete duplicate:

 

      • Search source-control repositories for both secret names.
      • Search cloud-resource configurations and deployment templates.
      • Review secret access logs where available.
      • Identify all identities that accessed each secret.
      • Update consumers to use the intended custom-named secret.
      • Redeploy or restart workloads when required.
      • Test secret retrieval from each affected workload.
      • Monitor for authentication, authorization and secret-not-found errors.
      • Disable the obsolete secret temporarily when the target supports a reversible disable operation.
      • Delete the obsolete secret only after confirming that it is no longer accessed.

 

The final validation must confirm both that the custom-named secret receives updates from Secrets Hub and that all dependent workloads successfully retrieve it.

 

Important! If an application still uses the default-named secret, migrate it to the custom-named secret before deleting the duplicate.

 

Step 5: Stabilize Synchronization

Before deleting the obsolete secret, confirm that:

    • SecretNameInSecretStore is still populated on the PAM account.
    • The account uses the correct actual platform.
    • The custom-named secret receives password updates.
    • No new default-named secret is being recreated.
    • The synchronization policy is healthy.
    • At least one controlled password update has completed successfully.

 

Where organizational procedures permit, disabling the obsolete target secret before deleting it can provide a safer validation period.

 

Important! Monitor the environment for failed workload retrievals during the disabled period.

 

Step 6: Remove the Obsolete Target secret

After confirming that the default-named secret is stale and unused:

 

1. Export or record any metadata required for audit purposes.

2. Disable the obsolete target secret when a validation period is required.

3. Monitor applications for retrieval failures.

4. Delete the obsolete secret from the target secret store.

5. Retain the recoverable deleted secret until the organization’s normal retention period expires.

6. Confirm that Secrets Hub does not recreate it during subsequent synchronization cycles.

 

Note: Deleting the obsolete secret directly from the target secret store is preferable to deleting the PAM account.

 

Step 7: Confirm the Final State

The final environment should contain:

  • One PAM account.
  • One target secret.
  • A target secret name matching SecretNameInSecretStore.
  • A healthy Secrets Hub synchronization policy.
  • Successful password updates to the custom-named secret.
  • No recreation of the default-named duplicate.
  • Applications retrieving the custom-named secret successfully.

 

Remediating an Existing Integration Created in the Wrong Order

When the target secret store registration existed before SecretNameInSecretStore was added to the applicable platforms, use the following process during an approved maintenance window.

 

1. Identify all synchronization policies connected to the target secret store.

2. Record the existing policy and secret-store settings.

3. Remove or disable the applicable synchronization policies as required.

4. Confirm that SecretNameInSecretStore exists on every applicable account platform.

5. Confirm that each affected PAM account contains the desired custom name.

6. Remove the target secret store registration from Secrets Hub.

7. Re-register the target secret store after custom naming is fully configured.

8. Recreate the required synchronization policies.

9. Test first with a new PAM account and a unique custom name.

10. Confirm that only the custom-named target secret is created.

11. Revalidate existing accounts.

12. Clean up obsolete default-named secrets only after completing the dependency and synchronization checks described above.

 

Caution! Removing a secret-store registration from Secrets Hub should not be assumed to remove the physical secrets from target. Nevertheless, all current mappings, policies and production dependencies should be documented before making changes.

 

Summary

 

To Prevent Duplicates

 

1. Import the Secrets Hub property definition.

2. Add SecretNameInSecretStore to the actual account platform.

3. Create the target secret store.

4. Create the synchronization policy.

5. Create the PAM account with the custom name populated initially.

6. Verify that only the custom-named target secret is created.

 

To Clean Up Duplicates

 

1. Identify which secret is actively synchronized.

2. Confirm which secret applications consume.

3. Migrate applications to the intended custom-named secret.

4. Disable and monitor the obsolete secret when appropriate.

5. Delete only the obsolete target secret.

6. Confirm that Secrets Hub does not recreate it.

 

References

 



Actions
  • Print
  • Copy Link

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