项目作者: anapsix

项目描述 :
Cerberus provider for Summon
高级语言: Go
项目地址: git://github.com/anapsix/summon-cerberus.git
创建时间: 2017-01-25T15:57:35Z
项目社区:https://github.com/anapsix/summon-cerberus

开源协议:MIT License

下载


summon-cerberus

Cerberus provider for Summon.

Provides access to secrets stored in Cerberus.

Usage

Set summon-cerberus as your Summon provider.

Make sure to set CERBERUS_API via environment variable.
Give summon a path to an object in Cerberus and it will fetch it for you and
print the value to stdout.

Example 1

  1. $ export CERBERUS_API='https://mycerbersus_endpoint.com'
  2. $ cat > /tmp/my_secrets.yml <<-EOF
  3. DB_USER: product_name
  4. DB_PASSWORD: !var product/$ENVTAG/dbpassword
  5. DATADOG_API_TOKEN: !var datadog/$ENVTAG/datadog_api_token
  6. EOF
  7. $ summon --provider summon-cerberus \
  8. -f /tmp/my_secrets.yml \
  9. -D ENVTAG=myenv \
  10. cat @SUMMONENVFILE
  11. DB_USER=product_name
  12. DB_PASSWORD=Wylb6owWawtenJab
  13. DATADOG_API_TOKEN=6d4f1e2992a11a332550aa555e630f0dc

Example 2

  1. $ export CERBERUS_API='https://mycerbersus_endpoint.com'
  2. $ summon --provider summon-cerberus \
  3. -D ENVTAG=myenv
  4. --yaml 'DATADOG_API_TOKEN: !var product/$ENVTAG/datadog_api_token' \
  5. printenv | grep DATADOG_API_TOKEN
  6. DATADOG_API_TOKEN=6d4f1e2992a11a332550aa555e630f0dc

Example 3

  1. $ export CERBERUS_API='https://mycerbersus_endpoint.com'
  2. $ DATADOG_API_KEY=$(summon-cerberus product/myenv/datadog_api_token)
  3. $ echo $DATADOG_API_KEY
  4. 6d4f1e2992a11a332550aa555e630f0dc

Configuration

summon-cerberus uses the official AWS Go SDK.
It will use the credentials file or environment variables as they explain.

Additionally, see Summon Usage documentation.

Limitations

summon-cerberus provider assumes the usage of IAM profiles and currently does not support usage of AWS API key/secret. As such, it is unusable anywhere but EC2 instances.
Improvements are required (PRs welcome) to make it support AWS key/secret the way AWS CLI tool does.

Authors

99.99% credit goes to @burdzz
00.01% @anapsix, for hack-jamming @burdzz’ code into Summon provider