A Django app to manage the application secrets using hashicorp.
Project description
Hashicorp-vault-python
Hashicorp vault is a Python-Django app for the improvement application security leveraging secrets
Installation
* pip install hashicorp_vault_django
* Add ``hashicorp_vault`` to your ``INSTALLED_APPS``
::
Setup in settings
* make config directory at project root level and create application.yml file inside config directory
* application.yml sample for vault configuration
* vault:
host: vault url # https
secret_engine: mount path # secrests-config
application: application path # secrets-ai
username: username
password: password
* if your secrets stored in `/vault/secrets/secrets-config/kv/secrets-ai/` then use secrets-config as secret_engine and secrets-ai as application in vault configuration
* consume vault secrets in your settings.py file
from HashiCorpVault.HashiCorp import get_vault_secrets
vault_secrets = get_vault_secrets()
DATABASES = {
"default": {
"ENGINE": config["datasource"]["DATABASE_ENGINE"],
"NAME": vault_secrets.get("db_database"),
"USER": vault_secrets.get("db_user"),
"PASSWORD": vault_secrets.get("db_password"),
"HOST": vault_secrets.get("host"),
"PORT": vault_secrets.get("db_port"),
"OPTIONS": {"charset": "utf8mb4"},
},
}
* Use secret keys to access to secret values from vault
::
Compatibility
{py3.8, py3.10}-django{4.* above}
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 hashicorp_vault_django-0.0.2.tar.gz.
File metadata
- Download URL: hashicorp_vault_django-0.0.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b84288ea5d5c830ecfc75d0f4bec69356e9faacd17c5577bb1af571054b0c34a
|
|
| MD5 |
28e70eb31b2ea0177584cb35ec4ab444
|
|
| BLAKE2b-256 |
226ab53415bdd3813161202e0e851e486ebdf38d51f080e6951b36e06b6eeb88
|
File details
Details for the file hashicorp_vault_django-0.0.2-py3-none-any.whl.
File metadata
- Download URL: hashicorp_vault_django-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80524df938629ea8967cae632b493ccaa49e7eba17c3921f350efe66d3c5fc7b
|
|
| MD5 |
05204733e27905792103552a7f0401af
|
|
| BLAKE2b-256 |
7553bea79f15bde89247a06001bb576fb67e10947859871f0eb6f753a566b023
|