Skip to main content

envault

Client-side envelope encryption for files using AWS KMS, with DynamoDB state tracking and a full audit trail.

CI PyPI Python License

Beta Software — This project is under active development and is not yet recommended for production use. APIs, CLI flags, and storage formats may change between releases. Use at your own risk.


How it works

  • Files are encrypted locally using AES-256-GCM via the AWS Encryption SDK
  • The data encryption key (DEK) is wrapped by your KMS customer-managed key (CMK) — plaintext never leaves your machine
  • Encrypted files are stored in S3; state and audit events are tracked in DynamoDB
  • Decryption requires AWS credentials with kms:Decrypt on the CMK

Installation

pip install envault-cli

Requires Python 3.10+.


Quick start

# Set required environment variables
export ENVAULT_KEY_ID=alias/my-kms-key
export ENVAULT_BUCKET=my-encrypted-files-bucket
export ENVAULT_TABLE=envault-state
# Accounts trusted to have encrypted your data — required for every read
export ENVAULT_ALLOWED_ACCOUNT_IDS=123456789012

# Encrypt a file
envault encrypt ./secret.txt --tag project=finance

# Check state
envault dashboard

# Run a command with the secret in its environment — never written to disk
envault exec -s secret.txt=API_TOKEN -- ./my-app

# Or decrypt to a file, by filename or SHA256 hash
envault decrypt secret.txt -o ./

Configuration

All config via environment variables — no config files with secrets.

Variable Required Default Description
ENVAULT_KEY_ID Yes — KMS key alias (e.g. alias/my-key)
ENVAULT_BUCKET Yes — S3 bucket for encrypted files
ENVAULT_TABLE Yes — DynamoDB table name
ENVAULT_ALLOWED_ACCOUNT_IDS For reads — Comma-separated AWS account IDs trusted to have encrypted the data. Required by decrypt, exec, and rotate-key: it constrains KMS discovery so a ciphertext header cannot name a key outside your control.
ENVAULT_REGION No us-east-1 AWS region
ENVAULT_AUDIT_TTL_DAYS No 365 Days to retain audit events

CLI reference

# Encrypt a file (or directory) and store in S3
envault encrypt INPUT_PATH [--tag KEY=VALUE]... [--force]

# Run a command with secrets supplied in memory, never on disk
envault exec -s IDENTIFIER=VAR [-f IDENTIFIER=VAR]... [--clean-env] -- COMMAND [ARGS]...

# Decrypt by filename or SHA256 hash
envault decrypt IDENTIFIER [-o OUTPUT_DIR] [--version N]

# List all encrypted/decrypted files
envault status [--state encrypted|decrypted|all]

# Show state for a specific file
envault status --file SHA256

# View audit events
envault audit [--since YYYY-MM-DD] [--file SHA256]

# Summary dashboard
envault dashboard

# Re-encrypt all files with a new KMS key
envault rotate-key --new-key-id alias/new-key [--dry-run]

# Migrate from legacy output.json (NDJSON format)
envault migrate FROM_PATH [--dry-run]

Running commands with secrets

envault exec decrypts into a process and nothing else. There is no temporary file to clean up and no plaintext left behind if the command crashes.

# As an environment variable
envault exec -s db.env=DATABASE_URL -- ./server

# As a file, for programs that insist on a path (certs, keystores, kubeconfigs)
envault exec -f server.pem=TLS_CERT -- curl --cert {TLS_CERT} https://api.internal

# Both, from a minimal environment that drops your ambient AWS credentials
envault exec --clean-env -s db.env=DATABASE_URL -f server.pem=TLS_CERT -- ./server

--file writes the plaintext to an anonymous in-memory descriptor (memfd), seals it once the checksum and encryption context verify, and passes $VAR as /proc/self/fd/N. No directory entry ever exists, so no other process can open it by name. A {VAR} token anywhere in the command is replaced with that path.

Before decrypting, envault disables core dumps and sets PR_SET_DUMPABLE=0 so a same-uid process cannot ptrace it or read /proc/<pid>/mem while the secret is in flight, and attempts to lock its pages out of swap.

What this does not protect against. PR_SET_DUMPABLE is reset by execve, so it covers the envault process, not the command it launches — a same-uid attacker can still read that child's /proc/<pid>/environ. Nothing here stops root. CPython cannot reliably zero plaintext it has already copied, so --file is the stronger mode wherever the consumer accepts a path.

Access is recorded in the audit trail, attributed to the calling AWS principal, before the command starts. If that write fails the command does not run: an unlogged secret read is treated as a failure, not a warning.


AWS infrastructure (CDK)

The infra/cdk/ directory contains a CDK Python stack that provisions:

  • KMS CMK with automatic annual key rotation
  • S3 bucket — versioned, SSE-KMS, block-public-access enforced
  • DynamoDB table — on-demand billing, KMS encryption, PITR, all GSIs
  • IAM managed policy — least-privilege, ready to attach to users/roles
cd infra/cdk
pip install -r requirements.txt
cdk synth
cdk deploy

Development

# Install with dev dependencies
python -m venv .venv
source .venv/bin/activate
PIP_USER=false pip install -e ".[dev]"

# Run unit tests (no AWS credentials required)
pytest tests/unit/ -v

# Lint and type check
ruff check src/ tests/
mypy src/envault/

Security

  • KMS alias only in config — ARN is never stored or committed
  • detect-secrets pre-commit hook prevents credential leaks
  • Encryption context and SHA256 checksum are both verified before any plaintext is written or handed to a command — a substituted ciphertext never materialises
  • KMS discovery is constrained to explicitly trusted account IDs, so a ciphertext header cannot direct a decrypt at a key outside your control
  • DynamoDB events are append-only, enforced by a write condition rather than convention, and record the AWS principal responsible
  • S3 bucket policy enforces SSE-KMS on all objects
  • envault exec keeps plaintext out of the filesystem entirely (see above for the limits)

License

Apache 2.0 — see LICENSE.

Metadata

Release files for envault-cli 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for envault-cli 0.2.0
File Size Uploaded Provenance Actions
envault_cli-0.2.0.tar.gz 136.4 kB With provenance Details for envault_cli-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for envault-cli 0.2.0
File Interpreter ABI Platform Actions
envault_cli-0.2.0-py3-none-any.whl Python 3 none any Details for envault_cli-0.2.0-py3-none-any.whl

Total release size: 178.0 kB

Release files / envault_cli-0.2.0.tar.gz

Download URL envault_cli-0.2.0.tar.gz
Size 136.4 kB
Tags Source
SHA-256 checksum
How to use checksums
434efb2361b6c95e94eb22dec1c5e6ffd05d5b876dba2791cdfea90d34b3bb11
BLAKE2b-256 checksum
How to use checksums
22fd6d65a7366f5ffd00bccae2d51272def9bfc05eb81c481a400f8da0bcf88b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 26, 2026.

Transparency log

Release files / envault_cli-0.2.0-py3-none-any.whl

Download URL envault_cli-0.2.0-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15018257b41ef496d648d496dac4e5eae1e64fc7b1729c73a317c523be60b447
BLAKE2b-256 checksum
How to use checksums
6235f3bfe688a014d4a448f2bc2d62cec57ea4759f6eb676ce9cda97d10f3cef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

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 Jul 26, 2026.

Transparency log

Security for envault-cli 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for envault_cli-0.2.0.tar.gz

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 Jul 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page