Repository navigation
Replies: 28 comments
|
I also have this question |
|
I also have the question? |
|
The "old" public master key on the minion prevents connection the (any) master with a "new" key. We must prepare the clients for a master key change before we change the master key. The only way I know of is to switch to a new master:
Is there realy a second master needed to renew the master key? |
|
I gave it a thought: to handle master key change, the minion must know both (old and new) keys. I think this is a feature request, there is no "proper way" (yet) I know of. Because @kiemlicz said "Sometimes I want to upgrade", I understand this is a use case: Use case no specific timeThe minion should try the second master key, if the first does not work (any more) I could also think of a second use case, where the master will change the key at a specific time Use case specific timeThe minion, at a specific time, shall replace the master key with the the second. |
|
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. |
|
Still a desired feature |
|
Thank you for updating this issue. It is no longer marked as stale. |
|
Also from our part. |
|
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. |
|
gladly reopen the issue |
|
Thank you for updating this issue. It is no longer marked as stale. |
|
The problem is spoiled me ,so I add following code to resolve the problem. @shangxdy @kiemlicz at location: |
|
I wish saltstack add an option to support auto delete the minion_master.pub file. |
|
You remove the master key from minion, I know this will work Maybe there are some security reasons for that, yet I would love this to be configurable |
|
We have a similar method where we have an AWS autoscaling group of 1 master to create it if it dies (or we need a fresh version). We set the userdata build of the master to copy the master keys from /etc/salt/pki/master - the master.pem and master.pub into a secure S3 bucket if they don't exist there - and download them from there if they do (I have the bash if anyone wants it). We also have the master set to use the autosign_grains to auto-register minions if they match the special grains - so we don't have to accept the keys again. However - the minions aren't attempting to reconnect at all unless they are restarted (which you can't do via salt at that point!). There seems to be no "poll" of the master happening in the /var/log/salt/minion log either - certainly no warnings of the master not being present (we thought a cron job to check for lack of salt connection and run a systemctl restart salt-minion ). If I can just solve this one part then we'll have a self-healing salt infrastructure. Otherwise we need to either manually log onto every minion and restart or fully rebuild the platform which seems overkill for just the salt master being replaced. |
Ahh - just found this to investigate: #44038 (comment) |
|
Just want to clarify
I'm not very familiar with AWS, does that mean that you Salt Master instances always have the same keypair? (if so then you should not have problem)
By default Minions die if the connection to master(s) won't succeed. |
Yes - we keep the same keypair - but the minions weren't reconnecting (also the master IP address is changing - but DNS would hopefully find it).
Actually it looks like the salt-minion process (2019.2.0 code) is just sitting there doing nothing. Maybe this is changed in later versions (we got badly bitten by the 2019.2.1 performance bug so we're very cautious now). Looks like this might work in the salt-minion conf file: |
|
And it doesn't work (at least on version 2019.2.0). The minion does detect that it's gone now: however it just posts that every 2 minutes and doesn't restart and pick up the new master. |
|
To me you're having some other issue (possibly network related) |
on what line number or function did you put that on @rico256-cn ? |
|
grep "The master key has changed, the salt master could have been subverted" /usr/lib/python3.6/site-packages/salt/crypt.py |
Thanks. |
Did you ever get to the bottom of this? I'm seeing the same thing on 3000.6. We're doing a similar thing, except mounting a partition from EBS onto /etc/salt/pki to maintain keys across salt instances from an ASG. Do let me know if you manage to solve it or get around it, thanks! Edit: I just found the auth_safemode has changed to check that |
|
Hi Vince - yes we looked through the code and eventually found the difference in auth-safemode between the actual code and the documentation. However ... we still occasionally hit an issue with it not restarting itself anyway. Now this may be unconnected or old code (we're now on 2019.2.4 although upgrading to 3000.x soon) but we lost confidence it would work by itself so we've ended up putting a bash cron script on each server to also restart if we see the Runs every 5 minutes: */5 * * * * |
|
Ah that's awesome. I wanted to avoid the hammer of a cronjob but I was only thinking about a blind restart - checking the logs for the I think we've managed to solve our issues, though we'll need a bit more time to test it out to know for sure. We had set the So it seems like it'll sit in the reconnect loop forever, so |
|
Wait, why not just use a CA and if the master is signed by the CA, then that's enough, right? The minion can have ssl: ca_certs: ?? Salt isn't TLS? Why the frick not? Just use TLS! |
|
This question was moved out of the issue tracker as part of a backlog cleanup. If you have additional context, workarounds that worked for you, or still need help, please reply here. |
Uh oh!
There was an error while loading. Please reload this page.
Description of Issue/Question
What is the proper way to re-auth minion to upgraded master (master which got its keys changed)?
I have limited access to minions, some of them are Windows minions
Setup
Regular salt master - minion setup
Steps to Reproduce Issue
salt-key --gen-keys master/etc/salt/pki/masterIt doesn't matter if you previously deleted minion from master via
salt-key -dAs long the minion keeps master's key somewhere in
salt/pki/minion/minion_master.pubit seems that changing keys on master is unsupported. Am I right?This is a problem for me because I have salt master deployed in container
Sometimes I want to upgrade salt by simply replacing the container
Is the only solution to manually remove
minion_master.pubfrom minion?Maybe there is some configuration option on minion to relax this requirement?
Versions Report
any version afair
All reactions