Skip to content

Locked gpg keychain can cause salt to corrupt rendered data #41846

Closed

Description

@farcaller

Description of Issue/Question

Given the gpg-encrypted pillar, salt must abort any state involving encrypted keys, if they cannot be decrypted.

Setup

Add an encrypted key to pillar, add a file state with contents_pillar.

Steps to Reproduce Issue

Run the state. The expected result is for a file to have the decrypted contents or for the state to fail if contents cannot be decrypted. Instead, the GPG blob is written into the file.

Versions Report

$ salt --versions-report
Salt Version:
Salt: 2016.11.0

Dependency Versions:
cffi: 1.10.0
cherrypy: Not Installed
dateutil: 2.6.0
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.9.6
libgit2: 0.25.1
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: 2.17
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: 0.25.0
Python: 2.7.13 (default, Apr 20 2017, 12:13:37)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.1
ZMQ: 4.2.2

System Versions:
dist:
machine: x86_64
release: 4.10.0-22-generic
system: Linux
version: Not Installed

Activity

  1. farcaller commented on Jun 20, 2017

    @farcaller
    ContributorAuthor

    Just to be clear, still fails with salt 2016.11.5-120-ge7fc30f (Carbon)

  2. Ch3LL commented on Jun 20, 2017

    @Ch3LL
    Contributor

    Agreed we should not write to the file if the decryption fails. This is not a regression. I can see this behavior in 2016.3 as well.

  3. added
    bug
    Core
    severity-low
    P4
    on Jun 20, 2017
  4. added this to the Approved milestone on Jun 20, 2017
  5. stale commented on Nov 5, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

  6. farcaller commented on Nov 5, 2018

    @farcaller
    ContributorAuthor

    this is still a problem.

  7. stale commented on Nov 5, 2018

    @stale

    Thank you for updating this issue. It is no longer marked as stale.

  8. stale commented on Jan 9, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

  9. farcaller commented on Jan 9, 2020

    @farcaller
    ContributorAuthor

    this is still a problem.

  10. stale commented on Jan 9, 2020

    @stale

    Thank you for updating this issue. It is no longer marked as stale.

  11. removed
    P4
    on Jun 3, 2020
  12. added 2 commits that reference this issue on Jun 30, 2026
    1be5ff7
    f1809ce
  13. dwoz commented on Jul 2, 2026

    @dwoz
    Contributor

    Fix merged and shipped in a supported release. Closing per bulk triage. Reopen if this reproduces on a currently supported release (3006.x, 3007.x, 3008.x, master).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CoreState-Modulebugseverity-low

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions