PowerShell / Modules

MIT License
111 stars 25 forks source link

[SecretManagement] Support for persistence levels #95

Open EvrenJG opened 4 years ago

EvrenJG commented 4 years ago

Summary of the new feature/enhancement

As a PowerShell developer I want to set the persistence on secrets so I can align with the security requirements of my application.

Proposed technical implementation details

In Windows Credentials Manager, secrets can be stored with three levels of persistence: Local Computer, Session and Enterprise. In the Preview 2 of Microsoft.PowerShell.SecretManagement, credentials are created with Local Computer persistence level, and this is not configurable as per this line: https://github.com/PowerShell/Modules/blob/1db9ddf3241b9b02e4e0b7d8d58a24606f39bdba/Modules/Microsoft.PowerShell.SecretManagement/src/code/Utils.cs#L677

If this feature makes only sense for the Windows implementation, then maybe this could be implemented as a free text parameter? I don't believe there are parameters to secrets yet but one could for instance have it as a vault parameter? i.e. Register-SecretVault [...] -VaultParameters @{Persistence='Session'}