PowerShell / SecretManagement

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

Get-Secret fails to retrieve secrets listed by Get-SecretInfo #172

Closed sba923 closed 2 years ago

sba923 commented 2 years ago

When I process the list of secrets returned by Get-SecretInfo, I hit a few cases where Get-Secret -Name <thename> fails:

image

I'm running PowerShell 7.1.4 on Windows 10.0.18363.1734 with Microsoft.PowerShell.SecretManagement version 1.1.0.

PaulHigin commented 2 years ago

The secret and secret information look up is performed by the registered extension vault. Which extension vault are you using? Are you able to retrieve the secret with 'Get-Secret' by passing in the name directly? Do you have an example of a name and code page where Get-Secret cannot retrieve the secret?

sba923 commented 2 years ago

Oops... should've thought about this. I'm using KeePass.

The whole point is that I can't retrieve the secret using Get-Secret:

PS❯  get-secretinfo | ? { $_.Name -match 'ulti' } | select name, type

Name                       Type
----                       ----
Windows 7 Ultimate PSCredential

PS❯  get-secret -name 'Windows 7 Ultimate'
Get-Secret: The secret Windows 7 Ultimate was not found.

There are no non-ASCII characters in that name, so I don't think it can be an encoding-related issue.

PaulHigin commented 2 years ago

Please create an issue for the KeePass extension vault (https://github.com/JustinGrote/SecretManagement.KeePass). I am thinking it may be having difficulties dealing with white spaces in names. I tried the above repro with SecretStore, but do not see the problem.

sba923 commented 2 years ago

Will do. Note that some of the affected secrets don't have spaces in their names.

sba923 commented 2 years ago

Created https://github.com/JustinGrote/SecretManagement.KeePass/issues/63

PaulHigin commented 2 years ago

Thanks! I'll close this issue.

sba923 commented 2 years ago

You're welcome.