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.

[SecretManagement] Get-SecretVaultRegistrationSettings #89

Open
@itfranck

Description

@itfranck

Add a cmdlet to get expected registration setting for a certain provider.

Currently, when you register an external vault, you have to use the -VaultParameters settings, which is great because it is flexible. For that same reason, it make it impossible to know what parameter to pass without referring to some documentation.

Proposed technical implementation details (optional)

It would be nice to be able to get a vault parameter hashtable of all the available settings that can be passed down. Something like

# Return a hashtable of the expected VaultParameters
$Settings = Get-SecretVaultRegistrationSettings -Module 'Az.Keyvault' 

could return for instance the parameters expected for a new vault registration for that provider.
For an az keyvault, you would get the following hashtables stored in the $settings variable

@{ AZKVaultName = ''; SubscriptionId = '' }

Then, all you would do is :

$Settings.AZKVaultName = 'MyKeyvault'
$Settings.SubscriptionId = 'cd7e3201-fa28-4283-8289-8c3bd66f62cf'
Register-SecretVault -Name 'MyAzKeyVault' -ModuleName 'Az.Keyvault' -VaultParameters $Settings

That way, you wouldn't have to necessarily check the documentation for each providers (provided you are familiar with the parameter name) to register a new vault.

As this module gain interest and the number of secret providers grow, it might be a useful addition.

edit:
Just an additional thought.
Maybe the object retunned could be a class so parameter types could be enforced The class could be implemented with an interface to force a [Hashtable]Settings property, that the provider would use to convert the class property values to the proper hashtable format accepted by Register-SecretVault

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions