This container allows you to easily get encrypted values for your Puppet infrastructure using hiera-eyaml.
The only thing you need to do is add your public key, which can be done in one of two ways.
To use this method, create a new Dockerfile that looks like the following
FROM docker.io/jjulien/eyaml
ADD <location of publickey> /etc/eyaml/public-key.pem
To use this method, when running the container simply provide the option -v <location of public key>:/etc/eyaml/public-key.pem
You can run this container as if it were the eyaml
command itself. It will automatically use your public key (assuming you included it using one of the two methods mentioned above). The below examples assume you used the first method of storing the public key inside a new container.
Example Help
$ docker run docker.io/jjulien/example-eyaml encrypt --help
eyaml encrypt: encrypt some data
Usage: eyaml encrypt [options]
Options:
-n, --encrypt-method=<s> Override default encryption and decryption method
(default is PKCS7) (default: pkcs7)
--version Show version information
-v, --verbose Be more verbose
-t, --trace Enable trace debug
-q, --quiet Be less verbose
-h, --help Information on how to use this command
-p, --password Source input is a password entered on the
terminal
-s, --string=<s> Source input is a string provided as an argument
-f, --file=<s> Source input is a regular file
--stdin Source input is taken from stdin
-e, --eyaml=<s> Source input is an eyaml file
-o, --output=<s> Output format of final result (examples, block,
string) (default: examples)
-l, --label=<s> Apply a label to the encrypted result
--pkcs7-private-key=<s> Path to private key (default:
./keys/private_key.pkcs7.pem)
--pkcs7-public-key=<s> Path to public key (default:
./keys/public_key.pkcs7.pem)
--pkcs7-subject=<s> Subject to use for certificate when creating keys
(default: /)
Example String Encryption
$ docker run docker.io/jjulien/example-eyaml encrypt -s "hi"
string: ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEAjqVqCcs1XYx6hcKOWJG8duebShmkoWyi6lGs0V1+DPxEqp1ySGC52fN83dV+JFGSrg3V23SmKQOBXNeBIDOMaO/vmKXqtHiln1b/ffaQBW52IRGRmMNMXfWtqa5RbUTLqnJsi9DZaTWoqXUZCPhvGN7GICVZW16cnR9nnPFNZyuBgxh9h8sDN0RUCwItzOqIBRVqtU+6Qal/Q/NJC4QcoOUe46dsP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