Skip to main content

Vault for storing locally encrypted data in S3 using KMS keys

Project description

nitor-vault

Python Vault CLI and library implementation using the Rust vault exposed as a Python extension module.

Encrypt data using client-side encryption with AWS KMS keys.

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.5.0.tar.gz (57.8 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.9+ Windows x86-64

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

Uploaded CPython 3.9+ Windows x86

nitor_vault-2.5.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.5.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.5.0-cp39-abi3-musllinux_1_2_aarch64.whl (6.6 MB view details)

Uploaded CPython 3.9+ musllinux: musl 1.2+ ARM64

nitor_vault-2.5.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.5.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.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.2 MB view details)

Uploaded CPython 3.9+ manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.9+ macOS 11.0+ ARM64

nitor_vault-2.5.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.5.0.tar.gz.

File metadata

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

File hashes

Hashes for nitor_vault-2.5.0.tar.gz
Algorithm Hash digest
SHA256 c8296045e7121938c28df3d2701b09a2e4198736d8f51087439c3976b28b2786
MD5 f811d0c92724e17a2eef7c9f009ee1a1
BLAKE2b-256 aa4469a727a865f629006ca39e838f44d304ea2f96d22b764ea0b07e415107a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3a10494ceda29c2bc3518821f66352a288ebb005122fd7070fe5293e7f95647d
MD5 73633a878b5110955d9f9184c4631e2f
BLAKE2b-256 7a47a7094abc3520518c037e98692a6fa092f190db9398b63f38e6e4dd644673

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-win32.whl
Algorithm Hash digest
SHA256 a6dc36c58906020b5eb6998732831a6bc7168200707cbf49622222c3e56783cc
MD5 83551b9886ad2bf8d472780b5c60a253
BLAKE2b-256 44dcd479e27f1294c8ef79b2dbcdda4dbd855f5d3f466411db6ee506bc3b6a4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b39f219f869ac8167de8e8f8ef78b6e2c40d715c4cf2543129a132473394af0d
MD5 c816b527e0fba435db152d58325bc1cf
BLAKE2b-256 904f344ca5141f03667dc62d077e92430ad261d769a3cb3b874f0358a3145c19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ca1c31bf71294aa66006a311eaf08f54ea0396a4ad1b072e0983e4daf5cedb3d
MD5 f46f3a0150eed4e8a42a9bd23cb1c62e
BLAKE2b-256 d5f078dd5e574511779c0def63c23fd51eafcf4fb15b1f21d6da0976e12cb963

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 a843428bf6ef164e17f82a160afed685c73ea1d9f2ab1bf474f5bcb29db16834
MD5 f0c61a462080b683332f0c0e05720f29
BLAKE2b-256 c3ed4a6bf3f3359c89105b1ce5a56f33e79de08323aa4e862e6c2e39178bf768

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 370e8b5f1aeb29a9e903a558dc96e724cb00a36dee99d9e9d9f7197d6aea7bc2
MD5 1f895e501c6f1548e70536a42f2c3690
BLAKE2b-256 febdcb33562305beb0efc5a58550e139032c9951b5b05bb7f22de313c4b94f8b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 52bbe87164f3e4a9d757de903773da2438146df9f2fdaac76dffa69defce850b
MD5 60e171e7d1154fb3d9f1e54c0cce47a7
BLAKE2b-256 2e490f91e907236134087fc51583990e9c505797ea7b7660e41b4076ea235877

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 65d7dd2b439b5ca9f0d36b53a9ca794114edd6bf620c1af308c58908d2e0b583
MD5 8a9500692338b5d3ad7b9fe322690ff7
BLAKE2b-256 adc6e68f8bda861443bdadb3dd91b062b1c449649728f3c43fb73762b4eeb209

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e6bcc5ba57af865eb8ca5cf3b61dc0d161775734a6b7a269d7028caa7bf69ff5
MD5 fce924b7f09810447c45338abb2c7dd7
BLAKE2b-256 217da4ba263763a118290536d5f7ce11d0efc73ba56c08f9fc49b54baac1d377

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nitor_vault-2.5.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 37f4ba3e9b8499664511dced050c19cbbf66f5ab807192ecbe20e5a7642877fc
MD5 1bc563e13d755e45ea3a2e5b441eae05
BLAKE2b-256 7efeae35fd2e23fa5d5722edb5b16be206c960abdc8e8680e82711d5861bde25

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