Vault Management Toolkit 🧰
A collection of CLI tools for managing, comparing, migrating, and rolling out HashiCorp Vault clusters, with support for OIDC authentication and Kubernetes rollouts.
Features
- Secure OIDC Authentication for Vault clusters
- Detailed Secret Comparison between Vault instances
- Full RAFT Snapshot Migration with selective overrides
- Kubernetes Rollout Management for Vault clusters
- CLI entry point:
vault-mgmt
Installation
Using pip (recommended)
pip install .
# or for development
pip install -e .
CLI Usage
The toolkit provides a unified CLI:
vault-mgmt [command] [options]
All commands support --help for more options.
Authentication
OIDC is the default (interactive) auth method. You can also use Kubernetes auth for non-interactive runs.
Kubernetes auth (non-interactive)
vault-mgmt compare \
--source-vault-addr ... \
--destination-vault-addr ... \
--source-auth-method kubernetes \
--source-auth-mount k8s-cluster-a \
--source-auth-role vault-read \
--dest-auth-method kubernetes \
--dest-auth-mount k8s-cluster-b \
--dest-auth-role vault-write
YAML auth config
source:
method: kubernetes
mount: k8s-cluster-a
role: vault-read
jwt_path: /var/run/secrets/kubernetes.io/serviceaccount/token
destination:
method: kubernetes
mount: k8s-cluster-b
role: vault-write
rollout:
method: oidc
role: my-oidc-role
Use it with --auth-config path/to/auth.yml. CLI args and env vars override the file.
Env var prefixes:
VAULT_SRC_*for source (compare/sync)VAULT_DST_*for destination (compare/sync)VAULT_*for rollout
Keys: AUTH_METHOD, AUTH_MOUNT, AUTH_ROLE, AUTH_JWT_PATH.
Example Workflows
Compare Vaults
vault-mgmt compare --source-vault-addr ... --destination-vault-addr ... --mount-point secret --base-path app --output-file differences.csv
Sync Vaults with Overrides
vault-mgmt sync --source-vault-addr ... --destination-vault-addr ... --override-secrets differences.csv
Kubernetes Rollout
vault-mgmt rollout vault-namespace --vault-addr ... --kube-context ... --strict
The --strict flag exits non-zero when rollout steps time out instead of continuing.
The OIDC browser callback listener binds to 127.0.0.1 and waits up to 5 minutes for the auth response.
Development
- Testing:
pytest
- Linting:
ruff check .
- Tox:
tox
Dependencies
| Package | Version | Description |
|---|---|---|
hvac |
2.3.0 | Python client for HashiCorp Vault API |
kubernetes |
33.1.0 | Python client for Kubernetes API |
requests |
2.32.4 | Elegant HTTP library (dependency of hvac) |
tqdm |
4.67.1 | Progress bar for loops and iterables |
certifi |
2025.6.15 | Mozilla's root certificates for SSL/TLS |
charset-normalizer |
3.4.2 | Character set/encoding detection |
idna |
3.10 | Internationalized Domain Names in Applications |
urllib3 |
2.5.0 | HTTP client for Python (dependency of requests) |
Project Structure
vault_mgmt/— Main package with CLI and submodules:cli.py— CLI entry pointcompare.py— Vault comparison logicsync.py— Vault migration/sync logicrollout.py— Kubernetes rollout logicmanager.py— Shared management utilities
Links
License
GPL-3.0-only. See LICENSE.
Metadata
Release files for vault-mgmt 1.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vault_mgmt-1.1.2.tar.gz | 30.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vault_mgmt-1.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.9 kB
Release files / vault_mgmt-1.1.2.tar.gz
| Download URL | vault_mgmt-1.1.2.tar.gz |
|---|---|
| Size | 30.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
137eab1458afb0c22af3fb43137e1d7bc595398280dd25c12705746068aeb73e
|
|
BLAKE2b-256 checksum How to use checksums |
b4ce5144dda45418a4b2da139199e83afc9257b62617d4cad1ead1bc739fb340
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 30, 2026.
Transparency logRelease files / vault_mgmt-1.1.2-py3-none-any.whl
| Download URL | vault_mgmt-1.1.2-py3-none-any.whl |
|---|---|
| Size | 28.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f03998885e359dd79c2e012dbc41d14e0597fdbb5029258f3ca359301400ae1
|
|
BLAKE2b-256 checksum How to use checksums |
3c1f62e14d6b8c24e2b75ce829fba1bebc807deac6bbaeffdcb06a65c2327122
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 30, 2026.
Transparency log