merge documents

This commit is contained in:
ebner committed 2026-02-23 15:16:01 +01:00
1 parent dd4327ad6e
commit 4c02d064fc
2 files changed
+42 -60

No files matched your search

-48
View File
@@ -1,48 +0,0 @@
# EYAML Secrets in Hiera
To encrypt data with `eyaml` you need the `hiera-eyaml` tool installed on your system.
## Encrypt Data
To encrypt data you have to use the public key from your Hiera (`data-*`) git repository named `eyaml_public_key.pem`
For the lower layers (global, server or data) it is on the Puppet server at `/etc/puppetlabs/keys/eyaml/public_key.pkcs7.pem`.
For to encrypt a simple string do
```bash
eyaml encrypt --pkcs7-public-key=eyaml_public_key.pem -s secret_string
```
and for a complete file
```bash
eyaml encrypt --pkcs7-public-key=eyaml_public_key.pem -f secret_file
```
and from pipe
```bash
eyaml encrypt --pkcs7-public-key=eyaml_public_key.pem --stdin
```
#### Example
To encrypting password for a system you can do like this:
```bash
# openssl passwd -6 | eyaml encrypt --pkcs7-public-key=eyaml_public_key.pem --stdin
Password:
Verifying - Password:
string: ENC[PKCS7,MIIB2gYJKoZIhvcNAQcDoIIByzCCAccCAQ...sfLHuai6p+Mdukw/TT1BlKA==]
OR
block: >
ENC[PKCS7,MIIB2gYJKoZIhvcNAQcDoIIByzCCAccCAQAxggEhMIIBHQIBAD
AFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEA1vyV8J3LYjfBz5zY1PIs9k9zIC
...
c+MJa+CzicugI0Ptyq/anhhfWeDeBnZza1/9OCxWqqf3wEcnhJCmxYxBEOLR
AxVw2cf3w0wGRuZ0373LHljGTsfLHuai6p+Mdukw/TT1BlKA==]
#
```
and place either the string or the block at the required place in your Hiera YAML.
+42 -12
View File
@@ -45,23 +45,53 @@ Any change to the repo will automatically trigger a redeployment of the new vers
## Configuration
### Secrets
Secrets and clear-text values can be mixed inside the same yaml file, eg.:
```yaml
ntp_client::servers:
- pstime1.psi.ch
- pstime2.psi.ch
- pstime3.psi.ch
secret_key: ENC[PKCS7,MIIBiQYJKoZIhvcNA...AMA==]
```
To encrypt sensitive data in your hiera configuration you need the `hiera-eyaml` tool installed on your system.
To encrypt data you have to use the public key from your Hiera (`data-*`) git repository named `eyaml_public_key.pem`
For the lower hiera layers (global, server or data) it is on the Puppet server at `/etc/puppetlabs/keys/eyaml/public_key.pkcs7.pem`.
For to encrypt a simple string do
The encrypted values can be decrypted transparently from Hiera (on a host having the proper hiera key):
```bash
[root]# hiera secret_key
this is a secret value
eyaml encrypt --pkcs7-public-key=eyaml_public_key.pem -s secret_string
```
For encrypting data see [EYAML Secrets in Hiera](eyaml)
and for a complete file
```bash
eyaml encrypt --pkcs7-public-key=eyaml_public_key.pem -f secret_file
```
and from pipe
```bash
eyaml encrypt --pkcs7-public-key=eyaml_public_key.pem --stdin
```
For example, to encrypt a password for a system you can do like this:
```bash
# openssl passwd -6 | eyaml encrypt --pkcs7-public-key=eyaml_public_key.pem --stdin
Password:
Verifying - Password:
string: ENC[PKCS7,MIIB2gYJKoZIhvcNAQcDoIIByzCCAccCAQ...sfLHuai6p+Mdukw/TT1BlKA==]
OR
block: >
ENC[PKCS7,MIIB2gYJKoZIhvcNAQcDoIIByzCCAccCAQAxggEhMIIBHQIBAD
AFMAACAQEwDQYJKoZIhvcNAQEBBQAEggEA1vyV8J3LYjfBz5zY1PIs9k9zIC
...
c+MJa+CzicugI0Ptyq/anhhfWeDeBnZza1/9OCxWqqf3wEcnhJCmxYxBEOLR
AxVw2cf3w0wGRuZ0373LHljGTsfLHuai6p+Mdukw/TT1BlKA==]
#
```
and place either the string or the block at the required place in your Hiera YAML.
### Hiera Variable Interpolation