Simple secret management, particularly for Spring Boot applications running on Kubernetes.
Seckrit provides a simple way to fetch secrets from a secret manager and make them available to application servers or Kubernetes pod containers. Secrets can be made available as either environment variables or files.
This eliminates the insecure practice of storing secrets in code repositories, leaving only a single set of credentials to protect (e.g. using the secret management features of your CI/CD provider).
Currently, only Google Cloud Secret Manager is supported, but feel free to submit a pull request to add support for others.
Seckrit can either be used as a regular Python script on a local machine or application server, or as an initContainer in a Kubernetes Deployment.
- Write a manifest file that conforms to the schema. This file lists the secrets you want to fetch and how they should be made available to the app.
- Set an environment variable
GOOGLE_APPLICATION_CREDENTIALSto the location of a GCP service account file. This can be done inline when running the command if you like. - Run
python3 seckrit.py /path/to/manifest.yml. - Run
. /path/to/environment && /path/to/your/app. This will set environment variables before running your app. If you like, you can also delete the environment file after reading it.
- Write a manifest file and embed it in a Kubernetes
ConfigMap. - In your
Deployment, define aninitContainerthat mounts the manifestConfigMapas a file. - Set an environment variable
GOOGLE_APPLICATION_CREDENTIALSto the value of a KubernetesSecretthat contains the service account. - Define a named volume to share between the
initContainerand thecontainer. This volume is where secrets will be stored, so it should encompass the paths you used in your manifest file. - In the
containerssection, mount the volume containing the secrets fetched by theinitContainer. - Define your
commandas. /path/to/environment && /path/to/your/app.
Run pip3 install --user -r requirements.txt to install Python dependencies.
Run docker build -t TAG ., using a TAG of your choosing.
This project is licensed under the BSD 3-Clause license.
Contributions are most welcome. Before submitting an issue or pull request, please familiarise yourself with the Contribution Guidelines.
