Skip to main content

Client-side envelope encryption for files using AWS KMS, with DynamoDB state tracking

Project description

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

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

# Check state
envault dashboard

# Decrypt 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_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]

# 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]

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
  • SHA256 checksum verified before encrypt and after decrypt
  • DynamoDB events are append-only (never updated)
  • S3 bucket policy enforces SSE-KMS on all objects

License

Apache 2.0 — see LICENSE.

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

envault_cli-0.1.2.tar.gz (79.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

envault_cli-0.1.2-py3-none-any.whl (26.8 kB view details)

Uploaded Python 3

File details

Details for the file envault_cli-0.1.2.tar.gz.

File metadata

  • Download URL: envault_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 79.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for envault_cli-0.1.2.tar.gz
Algorithm Hash digest
SHA256 558396a701584947746ff3ec39e58a88d055aa24c3eb7ee8d0699d49bcf145f7
MD5 f9c5634f402fef6bad294a4a4e4cd46c
BLAKE2b-256 f8574599bc622c2f3cb81b0f5138d270d95d75c05f14f42f08500e5e42cea3ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for envault_cli-0.1.2.tar.gz:

Publisher: publish.yml on Specter099/envault-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file envault_cli-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: envault_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 26.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for envault_cli-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 268d3a2406dcea98570a8e7ad06cfdcfb93d4a8c6b6bd1c9c53ec385ab1e6162
MD5 94878bce6e94cc33cd3595b0fd35044c
BLAKE2b-256 43b125b93ead25c5ab893cf047397211d7d560e8a1661d05dd60d5ae1830eac4

See more details on using hashes here.

Provenance

The following attestation bundles were made for envault_cli-0.1.2-py3-none-any.whl:

Publisher: publish.yml on Specter099/envault-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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