Fix LDAP eauth 2FA incompatibility with auth.ldap.freeipa#69234
Open
ggiesen wants to merge 1 commit into
Open
Conversation
Contributor
|
This sounds like a bug fix, if so it should go into the oldest applicable branch 3006.x, 3007.x, or 3008.x. |
When auth.ldap.freeipa is enabled, groups() re-bound the user on every job payload to re-verify the password. With single-use 2FA (e.g. a FreeIPA OTP, or Duo push) that second bind fails or double-prompts, because the credential is only valid once. Apply the same guard the standard LDAP branch already uses: only re-bind on the first payload of a job (detected via the presence of show_jid in kwargs), using _bind() with the configured anonymous handling. Non-FreeIPA and Active Directory code paths are unchanged. Fixes saltstack#61974
18b7601 to
391e781
Compare
Contributor
Author
|
Thanks @dwoz - agreed, it's a bug fix. Re-targeted to 3006.x (the oldest supported branch containing the affected |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes the LDAP eauth group-membership lookup so it works with single-use 2FA
(e.g. FreeIPA OTP, Duo) when
auth.ldap.freeipais enabled.In
groups(), the FreeIPA branch re-bound the user withauth(username, password)on every job payload to re-verify the password. With a single-use 2FA
credential that second bind fails (the OTP is already consumed) or double-prompts.
The standard LDAP branch already guards against this by only re-binding on the
first payload of a job (detected via the presence of
show_jidinkwargs).This PR applies that same guard to the FreeIPA branch, using
_bind()with theconfigured anonymous handling. The Active Directory and standard LDAP branches
are unchanged, and
auth()/_bind()themselves are not modified.What issues does this PR fix or reference?
Fixes #61974
Previous Behavior
With
auth.ldap.freeipa: True, every authentication performed a second userbind during group lookup, breaking single-use 2FA tokens and causing duplicate
Duo prompts.
New Behavior
With
auth.ldap.freeipa: True, the user is only re-bound on the first payloadof a job, matching the existing standard-LDAP behavior. Without
auth_by_group_membership_only/anonymousconfigured, the re-bind remains anormal user bind, so existing behavior is retained.
Merge requirements satisfied?
Commits signed with GPG?
No