-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Salt master fails to authenticate minion key with mismatched line terminators #52289
Comments
Do you know if this is a regression? |
I do not know for sure. It's my first time preseeding windows minions. There doesn't seem to be any recent history of change to how salt.transport.mixins.auth opens the minion's public key on the master. And while there have been some changes to salt.crypt.get_rsa_pub_key related to M2Crypto, that's not installed on my minion. There may be other places a change could have broken this, but it's such a niche issue that it wouldn't be too unlikely to have always existed. |
That comparison is:
Maybe even throw a EDIT: The |
|
@cruscio You are correct! I should have dived deeper into it before reacting... |
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. |
@Ch3LL , you tagged this |
Thank you for updating this issue. It is no longer marked as stale. |
Just stepped into this (likely). We are spinning up a bunch of different minions as AWS EC2 VMs, and the only problematic one is Debian 10 arm64 from this AMI: We are using standard bootstrap-salt.sh (2023.04.26 as of now) everywhere across the stack for setting up salt on fresh VMs. The scenario with denied keys between the master (3006.5 running on Debian 11 "bullseye") and minion on Debian 10 arm64 is currently 100% reproducible in our env. Collecting more information at the moment. UPDATE: it seems like a bootstrap issue, preconfigured repository shows
So bootstrap eventually installs salt-minion from Debian's own repos where it's quite ancient:
Doing some tests to confirm. UPDATE: confirmed:
UPDATE: this patch fixes the issue for us:
Not sure if it makes sense as is because I don't see salt packages for Debian versions < 10, but still. |
This issue should be fixed by the above PR. If this is still broken, please open a new issue and reference this one. |
Description of Issue/Question
The salt master will fail to authenticate a minion when the minion's
minion.pem
hasCRLF
line terminators and the master's/etc/salt/pki/master/minions/minion_id
file hasLF
line terminators. This happened when pre-seeding a Windows minion.The minion and/or master should normalize line terminators before attempting to authenticate.
Setup
Preseed a Windows minion such that the
C:\salt\conf\pki\minion\minion.pem
file has CRLF line terminators.In theory, it'd also fail if you convert an existing minion.pem to CRLF terminators on any Windows or Linux minion
Steps to Reproduce Issue
Start the salt minion
See authentication errors in both the minion and master logs
See a new denied key on the master
Versions Report
Salt Master
Salt Minion
The text was updated successfully, but these errors were encountered: