kms

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2020 License: Apache-2.0, BSD-3-Clause, MIT Imports: 19 Imported by: 0

README

kms provider

The KMS provider uses the AWS KMS service to encrypt every secret value.

Example

crypto:
  provider: kms
  key: arn:aws:kms:us-east-1:000000000000:key/00000000-0000-0000-0000-000000000000
zero:
  ciphertext: AKMSTHiNG0123456789AAAA...0XyZ
  encrypted: true
  hash: 6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b

Environment variables

go-config-yourself strives to behave like any other AWS SDK client.

The following AWS_* environment variables are implemented:

  • AWS_PROFILE: if set, go-config-yourself will use the profile configuration from ~/.aws/config to prompt for MFA tokens when required or assuming a role.

Known Issues

  • Since not all regions are enabled by default, and there is currently no API endpoint to list the available regions for the user's AWS account, gcy (init|rekey) will only warn on UnrecognizedClientException and continue querying for keys in all regions.

Documentation

Overview

Package kms adds kms support for go-config-yourself

It uses the AWS KMS (https://aws.amazon.com/kms/) service to encrypt every secret value.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config map[string]interface{}) (pvd.Crypto, error)

New creates a new kms.Provider and returns it

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider implements provider.Crypto for KMS

func (*Provider) Decrypt

func (provider *Provider) Decrypt(encryptedBytes []byte) (string, error)

Decrypt bytes

func (*Provider) Enabled

func (provider *Provider) Enabled() bool

Enabled tells whether the provider is ready to operate on secrets

func (*Provider) Encrypt

func (provider *Provider) Encrypt(plainText []byte) ([]byte, error)

Encrypt bytes

func (*Provider) Replace

func (provider *Provider) Replace(args map[string]interface{}) (err error)

Replace the key with a new one

Will query every available AWS region and then prompt the user to select a key from it, unless `key` is present in `args`

func (*Provider) Serialize

func (provider *Provider) Serialize() (serialized map[string]interface{})

Serialize into a map of config for later hydration

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL