Skip to main content

A simple search and replace command line utility for Hashicorp Vault

Reason this release was yanked:

It does not work

Project description

vault-search-replace

Simple Python Script to Search (and replace) secrets content in hashicorp vault.

Rationale

Recently, I have come across the fact that no API allows to simply search for values within secrets. The specific use case I am working on is to change database connection strings for java based microservices.

Running the script

Best option is to install uv and run the script with:

uv run vault_search_replace.py

The script has inline metadata and will run without installation.

Usage

vault_search_replace.py [OPTIONS] 
                      STRING_TO_SEARCH 
                      VAULT_NAMESPACE
                      VAULT_BASE_URL 
                      VAULT_ACCESS_TOKEN
                      [REPLACEMENT_STRING]

Command Line Parameters:

Required:

string_to_search vault_namespace vault_base_url vault_access_token

Optional

string_to_replace

Options

--no-dry-run - confirm the execution

Without the (optional) replace_string argument, the command will execute a (string) search for search_string. With the replace argument, the command will execute a dry-run of the replace operation (no change will be applied). To force the creation of new secrets versions, the --no-dry-run option has to be passed.

As of this release, the search is very simple (python str.find function).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vault_search_replace-0.1.1.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vault_search_replace-0.1.1-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file vault_search_replace-0.1.1.tar.gz.

File metadata

File hashes

Hashes for vault_search_replace-0.1.1.tar.gz
Algorithm Hash digest
SHA256 61fd5f051a75b16f1e56f752b554620e3a980ea85f804b6f06903a9daa8e4c97
MD5 852e3919e6460e41d9135982b26ffdae
BLAKE2b-256 c162bce88c71b6815c3f9d239b58bff5a075c89aea17adffab65c4e48d12d470

See more details on using hashes here.

File details

Details for the file vault_search_replace-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for vault_search_replace-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 359a80eae4a6c65b745a37a647665ae83af7155a49cf9bc5bd16021a4f10927f
MD5 3ac9349842df72e341f8e2a6cd5f7b78
BLAKE2b-256 ec12229b5b9c126fca3aab47586af918e44b2b8fcea342b2bdd8536d0d9e6c66

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page