SecretManager

MIT License Last Commit Repo Size PyPI Build Status

Important note!

With no gymnastics, this works with Python 3.12 and earlier. It may fail with Python 3.13 (or later) — see details for a fix here

Why SecretManager?

Where does the first secret live?

Kubernetes provides mechanisms for working with secrets—but not securely storing or transporting them. Traditional approaches often leave “Secret Zero” exposed in environment variables, mounted volumes, or static keys.

This project implements a Zero Trust, ephemeral authentication solution for managing your Kubernetes secrets securely, leveraging HashiCorp Vault as an encryption-as-a-service backend.

Originally built to harden my homelab, this is a practical tool for anyone facing that lingering security question: “How do I bootstrap secrets without leaking them?”

Design Principles

Project Components

All connection and secret metadata are defined in config dictionaries. Policies follow a least-privilege model (see encryptonator/my-app-policy.hcl).

A Brief History of Failing Forward

This repo evolved through a series of failed or insecure (but educational) strategies:

  1. Secrets in image: wildly insecure, but good for offline dev.
  2. Encrypted SecureDicts: better, but required bundling an AES key.
  3. "One secret to rule them all": stored whole dict in Kubernetes, loaded at runtime, then wiped—still shaky.
  4. YAML-based env config split: functional and easy but insecure.
  5. This: Vault + short-lived auth + encryption-as-a-service + automatic key rotation = peace of mind.