Skip to main content

Vault for storing locally encrypted data in S3 using KMS keys

Project description

nitor-vault

Python vault implementation using the Rust vault library.

See the repo root readme for more general information.

Vault CLI

Encrypted AWS key-value storage utility

Usage: vault [OPTIONS] [COMMAND]

Commands:
  all, -a, --all            List available secrets [aliases: a, list, ls]
  completion, --completion  Generate shell completion
  delete, -d, --delete      Delete an existing key from the store [aliases: d]
  describe, --describe      Print CloudFormation stack parameters for current configuration
  decrypt, -y, --decrypt    Directly decrypt given value [aliases: y]
  encrypt, -e, --encrypt    Directly encrypt given value [aliases: e]
  exists, --exists          Check if a key exists
  info, --info              Print vault information
  id                        Print AWS user account information
  status, --status          Print vault stack information
  init, -i, --init          Initialize a new KMS key and S3 bucket [aliases: i]
  update, -u, --update      Update the vault CloudFormation stack [aliases: u]
  lookup, -l, --lookup      Output secret value for given key [aliases: l]
  store, -s, --store        Store a new key-value pair [aliases: s]
  help                      Print this message or the help of the given subcommand(s)

Options:
  -b, --bucket <BUCKET>    Override the bucket name [env: VAULT_BUCKET=]
  -k, --key-arn <ARN>      Override the KMS key ARN [env: VAULT_KEY=]
  -p, --prefix <PREFIX>    Optional prefix for key name [env: VAULT_PREFIX=]
  -r, --region <REGION>    Specify AWS region for the bucket [env: AWS_REGION=]
      --vaultstack <NAME>  Specify CloudFormation stack name to use [env: VAULT_STACK=]
      --id <ID>            Specify AWS IAM access key ID
      --secret <SECRET>    Specify AWS IAM secret access key
      --profile <PROFILE>  Specify AWS profile name to use [env: AWS_PROFILE=]
  -q, --quiet              Suppress additional output and error messages
  -h, --help               Print help (see more with '--help')
  -V, --version            Print version

Install

From PyPI

Use pipx or uv to install the Python vault package from PyPI globally in an isolated environment.

pipx install nitor-vault
# or
uv tool install nitor-vault

The command vault should now be available in path.

From source

Build and install locally from source code using pip. This requires a Rust toolchain to be able to build the Rust library. From the repo root:

cd python-pyo3
pip install .
# or with uv
uv pip install .

Check the command is found in path. If you ran the install command inside a virtual env, it will only be installed inside the venv, and will not be available in path globally.

which -a vault

Vault library

This Python package can also be used as a Python library to interact with the Vault directly from Python code.

Add the nitor-vault package to your project dependencies, or install directly with pip.

Example usage:

from n_vault import Vault

if not Vault().exists("key"):
    Vault().store("key", "value")

keys = Vault().list_all()

value = Vault().lookup("key")

if Vault().exists("key"):
    Vault().delete("key")

# specify vault parameters
vault = Vault(vault_stack="stack-name", profile="aws-credentials-name")
value = vault.lookup("key")

Development

Uses:

  • PyO3 for creating a native Python module from Rust code.
  • Maturin for building and packaging the Python module from Rust.

Workflow

You can use uv or the traditional Python and pip combo.

First, create a virtual env:

# uv
uv sync --all-extras
# pip
python3 -m venv .venv
source .venv/bin/activate
pip install '.[dev]'

After making changes to Rust code, build and install module:

# uv
uv run maturin develop
# venv
maturin develop

Run Python CLI:

# uv
uv run python/n_vault/cli.py -h
# venv
python3 python/n_vault/cli.py -h

Install and run vault inside virtual env:

# uv
uv pip install .
uv run vault -h
# venv
pip install .
vault -h

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

nitor_vault-2.3.0.tar.gz (57.3 kB view details)

Uploaded Source

Built Distributions

nitor_vault-2.3.0-cp39-abi3-win_amd64.whl (5.1 MB view details)

Uploaded CPython 3.9+ Windows x86-64

nitor_vault-2.3.0-cp39-abi3-win32.whl (4.4 MB view details)

Uploaded CPython 3.9+ Windows x86

nitor_vault-2.3.0-cp39-abi3-musllinux_1_2_x86_64.whl (6.7 MB view details)

Uploaded CPython 3.9+ musllinux: musl 1.2+ x86-64

nitor_vault-2.3.0-cp39-abi3-musllinux_1_2_i686.whl (6.4 MB view details)

Uploaded CPython 3.9+ musllinux: musl 1.2+ i686

nitor_vault-2.3.0-cp39-abi3-musllinux_1_2_aarch64.whl (6.8 MB view details)

Uploaded CPython 3.9+ musllinux: musl 1.2+ ARM64

nitor_vault-2.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.4 MB view details)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ x86-64

nitor_vault-2.3.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl (5.5 MB view details)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ i686

nitor_vault-2.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.1 MB view details)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ ARM64

nitor_vault-2.3.0-cp39-abi3-macosx_11_0_arm64.whl (5.7 MB view details)

Uploaded CPython 3.9+ macOS 11.0+ ARM64

nitor_vault-2.3.0-cp39-abi3-macosx_10_12_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.9+ macOS 10.12+ x86-64

File details

Details for the file nitor_vault-2.3.0.tar.gz.

File metadata

  • Download URL: nitor_vault-2.3.0.tar.gz
  • Upload date:
  • Size: 57.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.4

File hashes

Hashes for nitor_vault-2.3.0.tar.gz
Algorithm Hash digest
SHA256 1a15ad4d40ea1d8ff68121af1fce07575f6f698d9a86bd6c8c8d40a9fa8446dd
MD5 8cca2a3dfbae62e293c12eb25f9190f0
BLAKE2b-256 006d14e359e4ebc763eb9615e92e43930620b5ebdcd1778e967efb4675948499

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7804297ecdc180e3dd52a6c76fcd41f941ef0515b3d020c2a4fd12e5a771ccfe
MD5 f1a7515b5a809d002a16c959f609cef6
BLAKE2b-256 4f991702ed6b8a12c2daa9d453c28834ab2b5628e5ffb3bc586abdb23a289f6f

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-win32.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 0a694c437ed9c7fe65dcb36228296d91457110eaeb458849887661225b439cb2
MD5 04da164a01884cfff1f2b49a0275aa09
BLAKE2b-256 46c3b6743ac989b583614b08b60d02be8159bdfabb4d70f3ce0334c9c4e389d5

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f2d67adee90f8da399ea0da80ddeabebe0b29e52e962dcddadb297512eed98f3
MD5 90626df50dcdaa8362ee83ebae6b4495
BLAKE2b-256 2d411d5e0d8a10541a2a5f0e29efb4c95ecdff44bf8ae6660ce8c2f9dfbceebf

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 c2a28491de59a06ca2545401f1276e27059790e5d061281759cd205058fbd935
MD5 d616dec108a1f8563bee43578f2012c8
BLAKE2b-256 586c2bf42922bbe66075240ff26299c716ed8bbb6f61feb788ce49820a252fc9

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c2ffbda092ff33c87a27e6f0cf956367247f43246a6237c1abaaef9444c0c98d
MD5 131a217af9f73b970a5cf4407cdf61d0
BLAKE2b-256 8ecb727cfd1586cc650d6de6d47f56b0f9886f557ef3de1c80e52652726e1aff

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb69f8af05f584e5cf4403fe6e81e772a4da6b2d248283cb41bf3c6c4cb03319
MD5 2c58f3a341359d5bcf210126868ada05
BLAKE2b-256 148eba9d46713f080cb5b787aecebaf7658e37b7c0be5537adbdc2eda37f4bc8

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6a381321bb952dc586c7700e7f6b6edffc832f2f3c6a74c3082cae3904abe46f
MD5 4a4aa13a007b37ae08a95a0c03623c93
BLAKE2b-256 f76d29686c99c4b774b9c93f6f3db6a55ac11ee9532b820104a5863c045afc0c

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1b50203d9231ff714592cd76f18a80f1a947b2b4c7d3420701c92de8ff1c7750
MD5 a0728d10d5f51be77c234cb06f455e39
BLAKE2b-256 8e9794e06c29f256d625df6ca460fb6f0c2527685aa58a915996be3c766256a1

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b2ce4bf0a0d9f14d6d23abfd6489ba8228fa9ea44a12727241e57cf0e78dfda7
MD5 163ece5968839e83d8c94ce132fcbe0b
BLAKE2b-256 510700d2cb9de870fff2aa9a745cdbf68dcd0fcc67bbbb50521db0f700205625

See more details on using hashes here.

File details

Details for the file nitor_vault-2.3.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for nitor_vault-2.3.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ae2db78ec83c3f437a3ad7acd07068c9acb11cc380533eaf666c2de5da808565
MD5 250e90cfc5c0065be04a554de4d0ff2a
BLAKE2b-256 5305fb4a32082cf024f013010d178a029c9126d8ca5ab0bcb6bd94735c7d5614

See more details on using hashes here.

Supported by

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