Skip to main content

Lightweight secrets manager — encrypted vault, env injection, stdout redaction. No Docker, no server, no account.

Project description

ownlock

Lightweight secrets manager — encrypted local vault, .env injection, stdout redaction.

No Docker. No server. No account. Just pip install ownlock.


Quick start

pip install ownlock
ownlock init

Have a plaintext .env? Run ownlock auto to import secrets and rewrite the file to use vault().

Otherwise: set a secret, add one line to .env, then run your app:

ownlock set api-key
# Add to .env: MY_APP_KEY=vault("api-key")
ownlock run -- python app.py

Guided setup (ownlock auto)

ownlock auto discovers .env and common variants (.env.local, etc.), lets you choose which file and keys to import, then optionally rewrites the file so matching keys use vault("..."). After that you can use ownlock run -- your-command without editing .env by hand.

ownlock auto

For CI or non-interactive use:

ownlock auto -f .env --yes

Initialize a vault

Command Effect
ownlock init Project vault at ./.ownlock/vault.db. First run also creates the global vault and stores the passphrase in the keyring.
ownlock init --global Global vault only at ~/.ownlock/vault.db (passphrase in keyring).
ownlock init
# or global only:
ownlock init --global

Store, list, delete

ownlock set my-secret
ownlock set api-key=your-value
ownlock set database-url --env production
ownlock list
ownlock get my-secret
ownlock delete my-secret

set and import overwrite any existing value for the same key (and env).


Which vault is used?

Situation Vault used
Inside a directory with .ownlock/vault.db (or a parent) Project vault
No project vault found Global vault
--global Global vault
--project Project vault at current directory

Commands that accept --global / --project: set, get, list, delete, import, scan. run and export read vault references from your .env file.


.env format

Use vault("name") for secrets; they are resolved when you run commands.

API_KEY=vault("api-key")
DATABASE_URL=vault("database-url")
SUPABASE_SERVICE_KEY=vault("supabase-service-key", env="production")

To force the global vault: vault("name", global=true).


Run and export

ownlock run -- python app.py
ownlock run -f .env.local -- python app.py
ownlock export --format docker

get and export print secrets to stdout. Use only in trusted environments; prefer ownlock run to inject secrets into a process without printing them.


Import, rewrite-env, scan

ownlock import secrets.env
ownlock rewrite-env -f .env
ownlock scan .

Command reference

Command Description
ownlock init Create project vault (first run also creates global + keyring)
ownlock init --global Create global vault only
ownlock set KEY / KEY=VALUE Store secret
ownlock get KEY Print decrypted value
ownlock list List secret names
ownlock delete KEY Remove a secret
ownlock run -- CMD Resolve .env, inject secrets, redact stdout
ownlock export Print resolved KEY=VALUE pairs
ownlock import FILE Bulk import from plaintext .env
ownlock rewrite-env Rewrite env file to use vault()
ownlock auto Guided import + rewrite
ownlock scan DIR Scan for leaked secret values

Add --global or --project to set, get, list, delete, import, scan to override vault selection.


How it works

  • Secrets are encrypted with AES-256-GCM before storage.
  • Key derivation: PBKDF2-HMAC-SHA256 (200,000 iterations).
  • Passphrase is stored in the system keyring when you use init (global or first project init).
  • ownlock run resolves vault() in .env, injects env vars, and redacts secret values from stdout/stderr. No network; everything stays local.

Security

  • Encryption: Each secret is encrypted with AES-256-GCM; the vault stores ciphertext only.
  • Passphrase: Required to decrypt; keep it safe. Keyring avoids typing it every time.
  • get / export: Both print secrets to stdout. Use in trusted environments only; prefer ownlock run to inject without printing.
  • Overwrite: set and import overwrite existing values for the same key (and env); no append.
  • File permissions: Restrict permissions on ~/.ownlock/ and .ownlock/. Project init adds .ownlock/ to .gitignore.

License

MIT

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

ownlock-0.1.4.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

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

ownlock-0.1.4-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file ownlock-0.1.4.tar.gz.

File metadata

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

File hashes

Hashes for ownlock-0.1.4.tar.gz
Algorithm Hash digest
SHA256 661cf27a82e1131a4a1a0a3985154510afed58b173fb2a60a9f7e641c1df8d72
MD5 dd39d1066232fe413e4d8f957993b187
BLAKE2b-256 6cdbb656899973adbfc8c0209e9f44f1f40ef190f8e05e850f75cc0b5aee3b29

See more details on using hashes here.

Provenance

The following attestation bundles were made for ownlock-0.1.4.tar.gz:

Publisher: ci.yml on thebscolaro/ownlock

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

File details

Details for the file ownlock-0.1.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ownlock-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3907cf97fea6f7431a8596713aa2f35d02bc19f3830b7b94d282325fe4592b82
MD5 f3b15f07ea45ad60f64bc69a337d68d8
BLAKE2b-256 4a884c277538e565e45b8fb34df2eb4f9a876c74b9a4370865eb93513e2ec211

See more details on using hashes here.

Provenance

The following attestation bundles were made for ownlock-0.1.4-py3-none-any.whl:

Publisher: ci.yml on thebscolaro/ownlock

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