insomnia-plugin-hashicorp-vault-secrets

1.0.11 • Public • Published

HashiCorp Vault Secrets for Insomnia plugin

Vault

About

This plugin retrieves the KV secret values from HashiCorp Vault. KV secrets engine v1 and v2 are supported. Once the value has been retrieved from HashiCorp, the plugin puts it in a cache. Please restart Insomnia for refreshing the values.

If you like this plugin, leave it a ⭐ on Github!

Plugin Installation

Plugin Hub

You can install it directly from the Insomnia Plugin Hub

Insomnia Preferences

Go to Application -> Preferences -> Plugins and enter insomnia-plugin-hashicorp-vault-secrets in the npm package name field and click on the button Install Plugin.

This will download and install the plugin. After installation, you will see the plugin in the list of installed plugins and the action "HashiCorp Vault Secrets" will be available in the context menu of a folder, no restart required.

Insomnia Preferences

How to Use

Add the following environment variables in Insomnia (see here). Adapt the values regarding your HashiCorp environment and select the right release of KV secrets engine ('1' or '2' see here).

{
  "HASHICORP_URL": "https://hashicorp.client.net",
  "HASHICORP_KV_VERSION": "2",
  "HASHICORP_TOKEN": "** TO_BE_REPLACED **"
}

In HashiCorp: create a KV secret (or mount), a secret and a JSON.

For instance:

  • KV secret (or mount): keycloak_v2
  • secret: dev
  • JSON:
{
  "client_id": "client2",
  "client_secret": "$my_secret!"
}
Vault KV 2

Press Ctrl + Space in any place where an environment variable is available and pick HashiCorp Vault Secret

Insomnia Ctrl + Space

Set in KV Secret Name a path to the Vault Secret. The syntax is /mount/secret/jsonName For instance: /keycloak_v2/dev/client_id. The client2 value is retrieved from HashiCorp Vault

Insomnia Edit Tag

Repeat the same action for the client_secret (with /keycloak_v2/dev/client_secret path)

Insomnia All Secrets

How to Debug

  1. Open the Log folders (Insomnia Menu: Help -> Show App Log Folders)
  2. Open the file: renderer.log
  3. See log with [hashicorp-vault-secrets]

Credits

Thanks to insomnia-plugin-azure-keyvault-secrets built by Gianluigi Conti

Package Sidebar

Install

npm i insomnia-plugin-hashicorp-vault-secrets

Weekly Downloads

175

Version

1.0.11

License

MIT

Unpacked Size

590 kB

Total Files

11

Last publish

Collaborators

  • jeromeguillaume