Skip to content

[BUG] salt-run manage.key_regen doesnt work with auto-accept #57704

Open

Description

@alan-cugler

Circumstances
We had minions responding to a master running a salt \* command but not if you directly tried to target those minions, the minions key wasn't present in salt-key, we figured we had key artifacts in memory and decided to get the minions to re-authenticate in bulk to get these ghost minion keys back in salt-key.

The main command used was:

$ salt-run manage.key_regen

Unfortunately, this command will give you a giant warning to restart within 60 seconds or else, but our master already had auto_accept enabled and the ghost minion keys were showing up. Unfortunately, the warning scared my coworker and he restarted the master causing all keys to be deleted???

Expected behavior
The master deletes the minion keys and all minions are instructed to delete the master public key and you restart the master then accept the pending minions keys.

What happens?
Instead of the expected behavior if you have auto_accept on for the master and you restart the master, you will delete all your minion keys! and the minion don't attempt to send their key again.

Versions Report

Salt Version:
           Salt: 3000.3
 
Dependency Versions:
           cffi: 1.11.5
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
         Jinja2: 2.11.2
        libgit2: 0.28.2
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.6.2
   mysql-python: Not Installed
      pycparser: 2.19
       pycrypto: 2.6.1
   pycryptodome: 3.9.7
         pygit2: 0.28.2
         Python: 3.7.5 (default, Oct 17 2019, 12:25:15)
   python-gnupg: Not Installed
         PyYAML: 5.3.1
          PyZMQ: 19.0.1
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.2
 
System Versions:
           dist:   
         locale: UTF-8
        machine: x86_64
        release: 3.10.0-1062.18.1.el7.x86_64
         system: Linux
        version: Not Installed

Resources
https://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.manage.html#salt.runners.manage.key_regen

Activity

  1. added
    bug
    on Jun 17, 2020
  2. added this to the Approved milestone on Jun 19, 2020
  3. xeacott commented on Jun 19, 2020

    @xeacott
    Contributor

    There's a lot of information in here, so let me try to summarize just to make sure I understand:

    • So first and foremost, your minions (only some of them?) we're not responding to being targeted, but only when the wildcard target was used
    • And, the minions that weren't responding through normal targeting (same ones as above) also didn't have keys otherwise returned from running salt-key
    • so to mitigate all this, a salt-run manage.key_regen was executed while auto_accept was set to true, but the conditions that our docs indicate auto_accept is suppose to do, it didn't do, i.e. the minions didn't re-register themselves automatically.

    Is that correct? Sorry, just trying to understand where the problem is and how we can help. :)

    @alan-cugler

  4. added
    severity-high
    on Jun 19, 2020
  5. added
    Aluminium
    on Jul 29, 2020
  6. removed this from the Aluminium milestone on Mar 22, 2021
  7. 1 remaining item

  8. sagetherage commented on Mar 22, 2021

    @sagetherage
    Contributor

    The Core Team will not be able to get this in this release cycle and moving this back into planning.

  9. modified the milestones: Silicon, Approved on Aug 9, 2021
  10. added
    pending-discussion
    and removed
    Silicon v3004.0
    on Oct 20, 2021
  11. changed the title [-]salt-run manage.key_regen doesnt work with auto-accept[BUG][/-] [+][BUG] salt-run manage.key_regen doesnt work with auto-accept[/+] on Nov 30, 2021
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

    bugpending-discussionseverity-high

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions