Skip to main content

Fill mustache template(s) with secrets from secret store(s).

Project description

secstache

Fill mustache template(s) with secrets from secret store(s).

Installation

pip install secstache

Usage

$ secstache -h
usage: secstache [-h] [--asm key] [--strict] [file1.mustache ...]

Fill mustache template(s) with secrets from secret store(s).

positional arguments:
  file1.mustache  mustache files to process

optional arguments:
  -h, --help      show this help message and exit
  --asm key       AWS Secret Manager key
  --strict        fail if a tag key is not found

EXAMPLE:
	Create db.conf from db.conf.mustache using secrets in AWS Secret Manager under "prod/db"

		secstache --asm prod/db db.conf.mustache

Example

Say, you have a secret stored in secrets manager under the name of prod/db with the SecretString set to:

{
  "DB_USER": "foo_user",
  "DB_PASS": "foo_pass"
}

You can create a mustache file like this:

$ cat db.conf.mustache
DB_NAME = foo_db
DB_USER = {{DB_USER}}
DB_PASS = {{DB_PASS}}

and run secstache this way:

$ secstache --asm prod/db db.conf.mustache
Rendered db.conf.mustache to db.conf

This creates the db.conf file that looks like this:

$ cat db.conf
DB_NAME = foo_db
DB_USER = foo_user
DB_PASS = foo_pass

Supported secret stores

AWS Secrets Manager

Load secrets from AWS Secrets Manager via --asm key option. Note that your environment must be configured so as to support boto3. (I.e., you must be able to run aws successfully in your environment.)

Other secret stores

PR's welcome! :grin:

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

secstache-0.3.7.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

secstache-0.3.7-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file secstache-0.3.7.tar.gz.

File metadata

  • Download URL: secstache-0.3.7.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Darwin/21.4.0

File hashes

Hashes for secstache-0.3.7.tar.gz
Algorithm Hash digest
SHA256 4cbfc55be2cee1d6e54a5c4e695f347d42a95c900f9b1ed261ff66a3cecb77b2
MD5 17a12605379f95091fbecce9ee9956f8
BLAKE2b-256 9f7c2ff644ccbfd982ad4b2fd6a700bbb9eb77e1529373f8424c8267355ead52

See more details on using hashes here.

File details

Details for the file secstache-0.3.7-py3-none-any.whl.

File metadata

  • Download URL: secstache-0.3.7-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Darwin/21.4.0

File hashes

Hashes for secstache-0.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e2ae1b2b7aa5d37f7952329fbbe9eda06a2c376fa55a2d34797d0fee11b6906f
MD5 abf08cb832ebd7b1c812115dcc9395a4
BLAKE2b-256 380bb9a9fbd171a7e141c017d8a30b5331ca462d50fa65110d1c3ec5553755a0

See more details on using hashes here.

Supported by

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