Skip to main content

A universal secrets manager

Project description

Mind Castle - Build a wall around your secrets

A universal store for your secret data. Don't delay securing you or your customer's data by deliberating over cloud secret stores. Mind Castle makes it easy to get started, and easy to switch between cloud secret stores.

Mind Castle currently supports:

  • HashiCorp Vault
  • AWS Secrets Manager
  • In-memory and JSON stores that should only be used for testing/migration

Architecture

Mind Castle comes in three parts:

  • A unified interface for several secret stores.
  • An SQLAlchemy column type that transparently stores and retrieves secrets for you.
  • A migration tool to convert your existing DB column data into secrets.

Some other notes:

  • Mind Castle is configured and secret stores are initialised at import time. That means env-vars used for configuration need to be defined when Mind Castle is imported.
  • Mind Castle makes no attempt to manage secrets in memory. Memory management in Python is futile, and if you need that level of control it's best to use another language.

Install

pip install mind-castle

Configure

You can configure Mind Castle by setting environment variables for your chosen secret store. To see what configuration options are required for each store:

$ python -m mind_castle

Mind-Castle - Shhhhh
====================
Available secret stores:

memory            - Required env vars: []
awssecretsmanager - Required env vars: ['MIND_CASTLE_AWS_REGION', 'MIND_CASTLE_AWS_ACCESS_KEY_ID', 'MIND_CASTLE_AWS_SECRET_ACCESS_KEY']
hashicorpvault    - Required env vars: ['MIND_CASTLE_VAULT_HOST', 'MIND_CASTLE_VAULT_PORT', 'MIND_CASTLE_VAULT_TOKEN']
json              - Required env vars: []

Use

In your model file:

from mind_castle.sqlalchemy import SecretData

class MyDBModel(Base):
    name = Column(String, nullable=False)
    created_at = Column(DateTime, default=datetime.datetime.now)
    secret_data = Column(SecretData("hashicorpvault"))

Your secrets are now safely stored in Vault (or AWS, or anywhere else)!

TODO

  • Make migration script work for non-json columns
  • Document migration
  • Support deleting secrets when row is deleted
  • Implement prefixes/folders for secrets
  • Explain how secrets are stored
  • Enforce tests on PR / branch protections

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

mind_castle-0.2.5.tar.gz (59.9 kB view details)

Uploaded Source

Built Distribution

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

mind_castle-0.2.5-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file mind_castle-0.2.5.tar.gz.

File metadata

  • Download URL: mind_castle-0.2.5.tar.gz
  • Upload date:
  • Size: 59.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.4

File hashes

Hashes for mind_castle-0.2.5.tar.gz
Algorithm Hash digest
SHA256 22408ef57d802c62361063db1594266616d32f37fc69762049ef56ca9217aa8a
MD5 fe9fe0aab3d8ac5b16fa76f0221111d4
BLAKE2b-256 6a42980e38f8e2c74f2cb7b77880d61aa1cd7a2f8a6b32adabefaea50154cdf4

See more details on using hashes here.

File details

Details for the file mind_castle-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for mind_castle-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2c4c2964fa1eeba711517dee7a01396560ffa789a8d52794da65b4f09323d01d
MD5 ad4dfc0b19bdf412e96ed9a0fb3b62a7
BLAKE2b-256 c7ecf3bf741f4e5cf388a64e974ec59ed3db73f636460c7ce39ec48139b996e5

See more details on using hashes here.

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