Skip to main content

No project description provided

Project description

Cloud secret manager

This is a python package to handle secrets in cloud environments, handling GCP and AWS secrets.

It also helps to create a manifest to generate fake secrets for development while using external-secrets.io.

Setup

Initialize secrets manager:

./init_secret_manager.sh

Run secret manager:

# Either activate with poetry shell and run it
poetry -C . shell
es-cloud-secret-manager --help
# deactive when done
deactivate

# Either run it through poetry
poetry -C . run es-cloud-secret-manager --help

Format the code:

# Format the code with isort and autopep8
./format.sh

Yaml format

For secret with yaml format, if you want it to have a better formatting, better install yq and sponge.

# eg. for Ubuntu
sudo apt install yq moreutils

GCP

# First authenticate to your GCP project
gcloud auth application-default login --project <project id>

es-cloud-secret-manager --project project gcp --gcp-project <project id> list --secret cluster external
es-cloud-secret-manager --project project gcp --gcp-project <project id> create --secret cluster external
es-cloud-secret-manager --project project gcp --gcp-project <project id> initialize --secret cluster external
es-cloud-secret-manager --project project gcp --gcp-project <project id> details --secret cluster external
es-cloud-secret-manager --project project gcp --gcp-project <project id> import --secret cluster external
es-cloud-secret-manager --project project gcp --gcp-project <project id> export --secret cluster external
es-cloud-secret-manager --project project gcp --gcp-project <project id> diff --secret cluster external
es-cloud-secret-manager --project project gcp --gcp-project <project id> fake --secret cluster external
es-cloud-secret-manager --project project gcp --gcp-project <project id> delete --secret external --version 1

AWS

# First configure AWS
aws configure

es-cloud-secret-manager --project project aws --aws-region eu-west-1 list --secret cluster external
es-cloud-secret-manager --project project aws --aws-region eu-west-1 create --secret cluster external
es-cloud-secret-manager --project project aws --aws-region eu-west-1 initialize --secret cluster external
es-cloud-secret-manager --project project aws --aws-region eu-west-1 details --secret cluster external
es-cloud-secret-manager --project project aws --aws-region eu-west-1 import --secret cluster external
es-cloud-secret-manager --project project aws --aws-region eu-west-1 export --secret cluster external
es-cloud-secret-manager --project project aws --aws-region eu-west-1 diff --secret cluster external
es-cloud-secret-manager --project project aws --aws-region eu-west-1 fake --secret cluster external
es-cloud-secret-manager --project project aws --aws-region eu-west-1 delete --secret external --version 84e8c4e5-27c7-4nov-z9f5-50c398fe4911

External-secrets.io fake store


Release in testpypi

You can either build it with twine or with poetry.

You would need to have a ~/.pypirc file with the API token for twine.

python3 -m pip install --upgrade build
python3 -m build
python3 -m pip install --upgrade twine
# twine would automatically look for the API token in the ~/.pypirc file
python3 -m twine upload --repository testpypi dist/es_cloud_secret_manager-$(grep -e '^version' pyproject.toml | head -1 | cut -d= -f2 | xargs printf)*
poetry config pypi-token.testpypi <YOUR_API_TOKEN>
# You can get it from your ~/.pypirc file
poetry config pypi-token.testpypi "$(git config -f ~/.pypirc --get testpypi.password | xargs printf)"

poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish --repository testpypi

Once deployed on testpypi, you can install it as follow:

python3 -m pip install --upgrade --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ es-cloud-secret-manager

Release in pypi

Update the version in pyproject.toml and run:

./release.sh

Once deployed on pypi, you can install it as follow:

python3 -m pip install --upgrade es-cloud-secret-manager

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

es_cloud_secret_manager-2.0.4.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

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

es_cloud_secret_manager-2.0.4-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file es_cloud_secret_manager-2.0.4.tar.gz.

File metadata

  • Download URL: es_cloud_secret_manager-2.0.4.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for es_cloud_secret_manager-2.0.4.tar.gz
Algorithm Hash digest
SHA256 787b5d0278dfcc27b2e1781ef86c1663e4225a3e63a1043bb1fdea35c7a0ea6b
MD5 ffd10c9255d213f26b5290d7b9529184
BLAKE2b-256 c29f1160d7ffd5c226307346fc3f0737c61c02ff98b6cde086b65c7c1e626f40

See more details on using hashes here.

File details

Details for the file es_cloud_secret_manager-2.0.4-py3-none-any.whl.

File metadata

  • Download URL: es_cloud_secret_manager-2.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.13.0 Linux/6.6.87.2-microsoft-standard-WSL2

File hashes

Hashes for es_cloud_secret_manager-2.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 059483cd6d7cd3ecd054fda51ea3744c05a92ba152450e6ad3bded3322e1a6f0
MD5 19617c4ff9fa48fa594fd887a0e770cb
BLAKE2b-256 a0369d267c60050e1a09d386badfd7e7270d4de53ec477289625df9b7799fdaf

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