Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

[SecretsManagement] Add-Secret should prompt ... secretly #26

@Jaykul

Description

@Jaykul

Secrets need to be Secret

As a PowerShell user
When I want to add a secret
I should not enter it visibly in the console

If I call Add-Secret Password, I obviously don't want to enter the password visibly in the console, but currently the mandatory Secret parameter prompts for a plain text string. It should prompt for the secret as a SecureString.

Proposed technical implementation details

I understand you want to accept a PSCredential or even a byte array ...

But if we're prompting the user for the value of a mandatory parameter, then it's inherently text, so the prompt should use the SecureString input.

The simplest implementation of this is to just have two parameter sets, where the default one has a mandatory SecureString parameter, and the other one accepts an object so you can pass other types.

Add-Secret [-Name] <string> [-SecureString] <SecureString> [[-Vault] <string>] [-NoClobber]
Add-Secret [-Name] <string> [-Secret] <Object> [[-Vault] <string>] [-NoClobber]

Note that currently, the only option is for the user to actually write all of this:

Add-Secret Password (Read-Host Password -AsSecureString)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions