PowerShell / SecretManagement

PowerShell module to consistent usage of secrets through different extension vaults
MIT License
335 stars 47 forks source link

Creating additional vault duplicates secrets #101

Closed MaximoTrinidad closed 3 years ago

MaximoTrinidad commented 3 years ago

I thought that I could create(register) a different vault. Unless I'm have missed something, every time I register a new vault all of my secrets get duplicated.

So, how can I have separate vaults to hold a different set of secrets?

SecretVaultIssue_0`1_2021-02-01_13-15-50

JustinGrote commented 3 years ago

I don't think the builtin secretstore was currently designed with multiple vaults in mind. https://github.com/PowerShell/SecretStore

Other vaults support multiple targets, like my Chromium vault or Keepass vault or the Azure Keyvault vault

MaximoTrinidad commented 3 years ago

@JustinGrote,

So, it a bug? Or, can it support having multiple Vaults in the future? that would be my feature request.

PaulHigin commented 3 years ago

This is by design. The Microsoft.PowerShell.SecretStore extension vault stores secrets locally based on the current user account. For more information please see the design document: https://github.com/PowerShell/SecretStore/tree/master/Docs

We decided to allow an extension vault to be registered multiple times because some vault types may allow different configurations (unlike SecretStore). For example an AzKeyVault based vault may allow different remote vaults based on subscription id.

But both SecretStore and CredMan vaults store secrets based on current user account and so should only be registered once per user.

PaulHigin commented 3 years ago

Closing this because I believe this is answered. Feel free to reopen if you have more concerns.