/kvsecrets

wrapper around azure cli for azure keyvault

Primary LanguageGo

Azure Key Vault Secrets Utility

This utility provides a command-line interface to interact with Azure Key Vault secrets. It allows you to list, show, get, and compare secrets stored in different Azure Key Vaults.

Features

  • List Secrets: List all secrets in a specified Key Vault.
  • Show Secrets: Display all secrets and their values in a specified Key Vault.
  • Get Secret: Retrieve the value of a specific secret from a Key Vault.
  • Diff Secrets: Compare secrets between two Key Vaults and display the differences.

Prerequisites

  • Azure CLI installed and configured.
  • Valid Azure subscription with access to the Key Vaults.

Installation

  1. Clone the repository:

    git clone https://github.com/cmdctl/kvsecrets.git
    cd kvsecrets
  2. Build the project:

    go build -o secrets

Usage

List Secrets

List all secrets in a specified Key Vault.

./secrets list <vault-name>

Show Secrets

Display all secrets and their values in a specified Key Vault.

./secrets show <vault-name>

Get Secret

Retrieve the value of a specific secret from a Key Vault.

./secrets get <vault-name> <key-name>

Diff Secrets

Compare secrets between two Key Vaults and display the differences.

./secrets diff <vault-name1> <vault-name2>

Examples

List Secrets

./secrets list my-vault

Show Secrets

./secrets show my-vault

Get Secret

./secrets get my-vault my-secret

Diff Secrets

./secrets diff my-vault1 my-vault2

Contributing

Contributions are welcome! Please open an issue or submit a pull request for any changes.

License

This project is licensed under the MIT License. See the LICENSE file for details.