Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Salt minion didn't decrypt GPG encrypted pillar when using SaltClass #54145

@pavel-z1

Description

@pavel-z1

Description of Issue

I have installed Salt with enabled SaltClass module.
Salt minion didn't decrypt GPG encrypted pillar.

Setup

Configured parameter in /etc/salt/master.d/f_defaults.conf

master_tops:
    saltclass:
      path: /srv/salt/saltclass

Configured Node Yaml file /srv/salt/saltclass/nodes/server1.yml:

---
environment: base

states:
  - cpanel.ips

classes:
  - roles.pass

Content of file /srv/salt/saltclass/classes/roles/pass.yml:

#!jinja|yaml|gpg

pillars:
  settings:
    crypted_secret: |
      -----BEGIN PGP MESSAGE-----
      Version: GnuPG v2.0.22 (GNU/Linux)

      hQEMA4Ip7oKHIdrwAQf6A5taDQqjoaKZ48cqFRXRNIwoCBGhC5ucQPulZDq+MKlu
      2iBhyKPWmiFZdLo2cB5liGYwoBooRUhoeInfIj/TxBSlOgnXPz+8aPA+wMvp2wOa
      uQ4kQPjiRfWXaKBONqG4OOWcM82LiZu205TEmWRnLyiQv9pmQmddwnr1Mm4GS4cV
      dhv4YpmFjiBXmQkoFizIAjsyjtWnjmc+m51X8tca18125GBrIoU0XDBfN7vcneV9
      hSKp7NKUZaJQjTQ7jBD9ePjAg/jO2iVpPWaou4cW1fDqxsNKRHyoKiV0855IB3O0
      ethZa5CKV6iu4XUOor7+baM3TuadtiZfMDGRJ+87fdJLASgbCSIzWGONnXiUCpub
      F5+j2PGuUzSforNNzplnGwY60+ZYOkNnhaS5xtFa9HIcdR3GCIBpS4DV5qQmuC5p
      RgZbJXIh0pKCGCnB
      =IlpW
      -----END PGP MESSAGE-----

Steps to Reproduce Issue

salt server1 pillar.get settings:crypted_secret
server1:
-----BEGIN PGP MESSAGE-----
Version: GnuPG v2.0.22 (GNU/Linux)

hQEMA4Ip7oKHIdrwAQf6A5taDQqjoaKZ48cqFRXRNIwoCBGhC5ucQPulZDq+MKlu
2iBhyKPWmiFZdLo2cB5liGYwoBooRUhoeInfIj/TxBSlOgnXPz+8aPA+wMvp2wOa
uQ4kQPjiRfWXaKBONqG4OOWcM82LiZu205TEmWRnLyiQv9pmQmddwnr1Mm4GS4cV
dhv4YpmFjiBXmQkoFizIAjsyjtWnjmc+m51X8tca18125GBrIoU0XDBfN7vcneV9
hSKp7NKUZaJQjTQ7jBD9ePjAg/jO2iVpPWaou4cW1fDqxsNKRHyoKiV0855IB3O0
ethZa5CKV6iu4XUOor7+baM3TuadtiZfMDGRJ+87fdJLASgbCSIzWGONnXiUCpub
F5+j2PGuUzSforNNzplnGwY60+ZYOkNnhaS5xtFa9HIcdR3GCIBpS4DV5qQmuC5p
RgZbJXIh0pKCGCnB
=IlpW
-----END PGP MESSAGE-----

Versions Report

Salt Master version:

salt --versions-report
Salt Version:
           Salt: 2018.3.4

Dependency Versions:
           cffi: 1.6.0
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: 0.26.3
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: 2.14
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: 0.26.4
         Python: 2.7.5 (default, Nov 20 2015, 02:00:19)
   python-gnupg: 0.4.3
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: centos 7.2.1511 Core
         locale: ANSI_X3.4-1968
        machine: x86_64
        release: 3.10.0-327.18.2.el7.x86_64
         system: Linux
        version: CentOS Linux 7.2.1511 Core

Salt minion version:
salt-call --versions-report

Salt Version:
           Salt: 2018.3.4

Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: 1.5
      docker-py: 1.10.6
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: 0.31.0
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: 1.2.5
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Jun 24 2019, 08:54:15)
   python-gnupg: 0.4.3
         PyYAML: 3.11
          PyZMQ: 15.3.0
           RAET: Not Installed
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.1.4

System Versions:
           dist: redhat 7.6 Vladimir Lyakhov
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-962.3.2.lve1.5.25.8.el7.x86_64
         system: Linux
        version: CloudLinux 7.6 Vladimir Lyakhov

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions