saltstack / saltstack/salt

WheelClient Doesn't Support rotate_aes_key Option

Open
#52,784 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Confirmed severity-medium ZD
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description of Issue/Question

When using the WheelClient and operating in large environments it may be desirable to use the CLI option --rotate-aes-key and not have this set in the master configuration. However, this option is not available to the wheel.key module and it seems that the CLI tool uses a completely different class, KeyCLI, to implement/handle this option.

Setup

Start watching the event bus with salt-run state.event specifically watching for an event like:

key	{"_stamp": "2019-05-01T19:55:38.463057", "rotate_aes_key": true}

Then run the following script.

# With this script you will see the event described above still
import salt.config
import salt.wheel

opts = salt.config.master_config('/etc/salt/master')
wheel = salt.wheel.WheelClient(opts)
data = wheel.cmd('key.delete', ['<minion_id>'], {'rotate_aes_key':False})

However, you can call salt-key --rotate-aes-key=False -d <minion_id> from the CLI and you will not see the event described above.

Versions Report
Salt Version:
           Salt: 2018.3.3
 
Dependency Versions:
           cffi: Not Installed
       cherrypy: Not Installed
       dateutil: Not Installed
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: Not Installed
         pygit2: Not Installed
         Python: 2.7.5 (default, Oct 30 2018, 23:45:53)
   python-gnupg: Not Installed
         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.5.1804 Core
         locale: UTF-8
        machine: x86_64
        release: 4.9.125-linuxkit
         system: Linux
        version: CentOS Linux 7.5.1804 Core

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with salt.wheel.WheelClient, the wheel.key module, and the KeyCLI path that handles --rotate-aes-key. Compare how key.delete receives and propagates the option in each path. Done means WheelClient can control rotation consistently with the CLI, including the false case shown in the report, and the corresponding behavior is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.