Auto Generated INFO.yaml file
[pharos.git] / config / utils / README.eyaml.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. (c) 2017 OPNFV and others.
4
5 Use eyaml to decrypt secret values
6 ==================================
7
8 Prerequisites
9 -------------
10
11 #. Install eyaml and create keys (All of this should be done on the slave server)
12
13     .. code-block:: bash
14
15         $ sudo yum install rubygems || sudo apt-get install ruby
16         $ sudo gem install hiera-eyaml
17         $ eyaml createkeys
18
19 #. Move keys to /etc/eyaml_keys
20
21     .. code-block:: bash
22
23         $ sudo mkdir -p /etc/eyaml_keys/
24         $ sudo mv ./keys/* /etc/eyaml_keys/
25         $ sudo rmdir ./keys
26
27 #. Set up eyaml config.yaml
28
29     .. code-block:: bash
30
31         $ mkdir ~/.eyaml/
32         $ cp config.example.yaml ~/.eyaml/config.yaml
33
34 Encryption
35 ----------
36
37 #. Copy a PDF (yaml) to current directory (or edit the PDF in-place)
38
39 NOTE: There is a sample encrypted PDF located at `../pdf/pod1.encrypted.yaml`.
40 Data in that file is only an example and can't be decrypted without the PEM,
41 which is not provided.
42
43     .. code-block:: bash
44
45         $ cp ~/foo/securedlab/labs/lf/pod2.yaml .
46
47 #. Create some encrypted values
48
49     .. code-block:: bash
50
51         $ eyaml encrypt -s 'opnfv'
52
53 #. Replace values to be encrypted
54
55     .. code-block:: yaml
56
57         type: ipmi
58         versions:
59           - 2.0
60         user: ENC[PKCS7 ...]
61         pass: ENC[PKCS7 ...]
62
63 Decryption
64 ----------
65
66     .. code-block:: bash
67
68         $ ./generate_config.py -y pod2.yaml -j ../installers/apex/pod_config.yaml.j2