A simple search and replace command line utility for Hashicorp Vault
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vault_search_replace-0.1.2.tar.gz.
File metadata
- Download URL: vault_search_replace-0.1.2.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2750dc96fd983a30ee79da2507d08bd766895ddb9ac0da06787572c84d84eb1b
|
|
| MD5 |
b6078d9f50118dce163951c7a6cf16a6
|
|
| BLAKE2b-256 |
fa3e38e088dd5cc8a3f520ef4d64ac18a4812d9a4dc13371179938e76600db29
|
File details
Details for the file vault_search_replace-0.1.2-py3-none-any.whl.
File metadata
- Download URL: vault_search_replace-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed726926121afc4b18c086cd03fdb7abf3b821934575780c8d5e394d79f781f3
|
|
| MD5 |
79ed5dc8660685313ffc9d3d6c060c18
|
|
| BLAKE2b-256 |
43bf46b7593cdfa3e368d0c75ff2cd2edca14f57baeb1c5aae8284439ed78a60
|