summaryrefslogtreecommitdiffstats
path: root/config/utils/README.eyaml.rst
blob: 1f584261ce1df179d37a03e09f7ead539cfc7e21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

@media only all and (prefers-color-scheme: dark) {
.highlight .hll { background-color: #49483e }
.highlight .c { color: #75715e } /* Comment */
.highlight .err { color: #960050; background-color: #1e0010 } /* Error */
.highlight .k { color: #66d9ef } /* Keyword */
.highlight .l { color: #ae81ff } /* Literal */
.highlight .n { color: #f8f8f2 } /* Name */
.highlight .o { color: #f92672 } /* Operator */
.highlight .p { color: #f8f8f2 } /* Punctuation */
.highlight .ch { color: #75715e } /* Comment.Hashbang */
.highlight .cm { color: #75715e } /* Comment.Multiline */
.highlight .cp { color: #75715e } /* Comment.Preproc */
.highlight .cpf { color: #75715e } /* Comment.PreprocFile */
.highlight .c1 { color: #75715e } /* Comment.Single */
.highlight .cs { color: #75715e } /* Comment.Special */
.highlight .gd { color: #f92672 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .gi { color: #a6e22e } /
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. SPDX-License-Identifier: CC-BY-4.0
.. (c) 2018 OPNFV and others.

Use eyaml to decrypt secret values
==================================

Prerequisites
-------------

#. Install eyaml and create keys (All of this should be done on the slave server)

    .. code-block:: bash

        $ sudo yum install rubygems || sudo apt-get install ruby
        $ sudo gem install hiera-eyaml
        $ eyaml createkeys

#. Move keys to /etc/eyaml_keys

    .. code-block:: bash

        $ sudo mkdir -p /etc/eyaml_keys/
        $ sudo mv ./keys/* /etc/eyaml_keys/
        $ sudo rmdir ./keys

#. Set up eyaml config.yaml

    .. code-block:: bash

        $ mkdir ~/.eyaml/
        $ cp config.example.yaml ~/.eyaml/config.yaml

Encryption
----------

#. Copy a PDF (yaml) to current directory (or edit the PDF in-place)

NOTE: There is a sample encrypted PDF located at `../pdf/pod1.encrypted.yaml`.
Data in that file is only an example and can't be decrypted without the PEM,
which is not provided.

    .. code-block:: bash

        $ cp ~/foo/securedlab/labs/lf/pod2.yaml .

#. Create some encrypted values

    .. code-block:: bash

        $ eyaml encrypt -s 'opnfv'

#. Replace values to be encrypted

    .. code-block:: yaml

        type: ipmi
        versions:
          - 2.0
        user: ENC[PKCS7 ...]
        pass: ENC[PKCS7 ...]

Decryption
----------

    .. code-block:: bash

        $ ./generate_config.py -y pod2.yaml -j ../installers/apex/pod_config.yaml.j2