JustinGrote / JustinGrote/SecretManagement.KeePass
Master-Key only queried once, not after a resave of the Keepass file
- Dominant language
- PowerShell
- Stars
- 123
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
### How to reproduce?
- Query a secret (MasterKey is required)
- Save the database file from within the app
- Query the secret again
- An exception is thrown
- To access the database again you have to restart the powershell session or use Unlock-SecretVault
```Powershell
C:\> get-secret hubba
Keepass Master Password
Enter the Keepass Master password for: *****\KeepassDatabase.kdbx
Password for user Keepass Master Password: **********
UserName Password
-------- --------
user System.Security.SecureString
C:\> # Save the file from the app
C:\> get-secret hubba
WARNING: [14:18:19][Test-SecretVault] Database file on disk has changed, starting a new connection
WARNING: [14:18:19][Get-SecretInfo] There appears to be an issue with the vault (Test-SecretVault returned false)
Get-Secret: A valid password is required to access the Microsoft.PowerShell.SecretStore vault.
Use the Unlock-SecretStore cmdlet to provide the required password to access the store.
Get-Secret: The secret hubba was not found.
C:\>
```
## Expected behavior
Either use the cached password again or ask for it a second time.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the Test-SecretVault and Get-Secret flow shown in the reproduction, especially the handling after the database file changes. Reproduce the sequence in a PowerShell session; done means querying the secret after saving the Keepass file succeeds by reusing the cached password or prompting for it again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell
- Domain
- cli, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100