-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
auth/ldap: add username_as_alias configurable #14324
Merged
Merged
Conversation
This file contains 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
Known issue PR opened here: #14325. |
calvn
reviewed
Mar 4, 2022
jasonodonnell
force-pushed
the
auth-ldap-alias-username
branch
from
March 14, 2022 19:48
a1ae3c4
to
c6f67ab
Compare
calvn
approved these changes
Mar 14, 2022
Should the label be all the way back to 1.8.10? |
This was referenced Mar 15, 2022
jasonodonnell
added a commit
that referenced
this pull request
Mar 15, 2022
jasonodonnell
added a commit
that referenced
this pull request
Mar 15, 2022
remilapeyre
added a commit
to remilapeyre/vault
that referenced
this pull request
May 19, 2022
There is a bug that was introduced in the LDAP authentication method by hashicorp#11000. It was thought to be backward compatible but has broken a number of users. Later a new parameter `username_as_alias` was introduced in hashicorp#14324 to make it possible for operators to restore the previous behavior. The way it is currently working is not completely backward compatible thought because when username_as_alias is set, a call to GetUserAliasAttributeValue() will first be made, then this value is completely discarded in pathLogin() and replaced by the username as expected. This is an issue because it makes useless calls to the LDAP server and will break backward compatibility if one of the constraints in GetUserAliasAttributeValue() is not respected, even though the resulting value will be discarded anyway. In order to maintain backward compatibility here we have to only call GetUserAliasAttributeValue() if necessary. Since this change of behavior was introduced in 1.9, this fix will need to be backported to the 1.9, 1.10 and 1.11 branches.
calvn
added a commit
that referenced
this pull request
May 20, 2022
* Fix handling of username_as_alias during LDAP authentication There is a bug that was introduced in the LDAP authentication method by #11000. It was thought to be backward compatible but has broken a number of users. Later a new parameter `username_as_alias` was introduced in #14324 to make it possible for operators to restore the previous behavior. The way it is currently working is not completely backward compatible thought because when username_as_alias is set, a call to GetUserAliasAttributeValue() will first be made, then this value is completely discarded in pathLogin() and replaced by the username as expected. This is an issue because it makes useless calls to the LDAP server and will break backward compatibility if one of the constraints in GetUserAliasAttributeValue() is not respected, even though the resulting value will be discarded anyway. In order to maintain backward compatibility here we have to only call GetUserAliasAttributeValue() if necessary. Since this change of behavior was introduced in 1.9, this fix will need to be backported to the 1.9, 1.10 and 1.11 branches. * Add changelog * Add tests * Format code * Update builtin/credential/ldap/backend.go Co-authored-by: Calvin Leung Huang <[email protected]> * Format and fix declaration * Reword changelog Co-authored-by: Calvin Leung Huang <[email protected]>
calvn
pushed a commit
that referenced
this pull request
May 20, 2022
* Fix handling of username_as_alias during LDAP authentication There is a bug that was introduced in the LDAP authentication method by #11000. It was thought to be backward compatible but has broken a number of users. Later a new parameter `username_as_alias` was introduced in #14324 to make it possible for operators to restore the previous behavior. The way it is currently working is not completely backward compatible thought because when username_as_alias is set, a call to GetUserAliasAttributeValue() will first be made, then this value is completely discarded in pathLogin() and replaced by the username as expected. This is an issue because it makes useless calls to the LDAP server and will break backward compatibility if one of the constraints in GetUserAliasAttributeValue() is not respected, even though the resulting value will be discarded anyway. In order to maintain backward compatibility here we have to only call GetUserAliasAttributeValue() if necessary. Since this change of behavior was introduced in 1.9, this fix will need to be backported to the 1.9, 1.10 and 1.11 branches. * Add changelog * Add tests * Format code * Update builtin/credential/ldap/backend.go Co-authored-by: Calvin Leung Huang <[email protected]> * Format and fix declaration * Reword changelog Co-authored-by: Calvin Leung Huang <[email protected]> # Conflicts: # builtin/credential/ldap/backend_test.go
calvn
pushed a commit
that referenced
this pull request
May 20, 2022
…#15556) * Fix handling of username_as_alias during LDAP authentication There is a bug that was introduced in the LDAP authentication method by #11000. It was thought to be backward compatible but has broken a number of users. Later a new parameter `username_as_alias` was introduced in #14324 to make it possible for operators to restore the previous behavior. The way it is currently working is not completely backward compatible thought because when username_as_alias is set, a call to GetUserAliasAttributeValue() will first be made, then this value is completely discarded in pathLogin() and replaced by the username as expected. This is an issue because it makes useless calls to the LDAP server and will break backward compatibility if one of the constraints in GetUserAliasAttributeValue() is not respected, even though the resulting value will be discarded anyway. In order to maintain backward compatibility here we have to only call GetUserAliasAttributeValue() if necessary. Since this change of behavior was introduced in 1.9, this fix will need to be backported to the 1.9, 1.10 and 1.11 branches. * Add changelog * Add tests * Format code * Update builtin/credential/ldap/backend.go Co-authored-by: Calvin Leung Huang <[email protected]> * Format and fix declaration * Reword changelog Co-authored-by: Calvin Leung Huang <[email protected]> # Conflicts: # builtin/credential/ldap/backend_test.go Co-authored-by: Rémi Lapeyre <[email protected]>
Gabrielopesantos
pushed a commit
to Gabrielopesantos/vault
that referenced
this pull request
Jun 6, 2022
…rp#15525) * Fix handling of username_as_alias during LDAP authentication There is a bug that was introduced in the LDAP authentication method by hashicorp#11000. It was thought to be backward compatible but has broken a number of users. Later a new parameter `username_as_alias` was introduced in hashicorp#14324 to make it possible for operators to restore the previous behavior. The way it is currently working is not completely backward compatible thought because when username_as_alias is set, a call to GetUserAliasAttributeValue() will first be made, then this value is completely discarded in pathLogin() and replaced by the username as expected. This is an issue because it makes useless calls to the LDAP server and will break backward compatibility if one of the constraints in GetUserAliasAttributeValue() is not respected, even though the resulting value will be discarded anyway. In order to maintain backward compatibility here we have to only call GetUserAliasAttributeValue() if necessary. Since this change of behavior was introduced in 1.9, this fix will need to be backported to the 1.9, 1.10 and 1.11 branches. * Add changelog * Add tests * Format code * Update builtin/credential/ldap/backend.go Co-authored-by: Calvin Leung Huang <[email protected]> * Format and fix declaration * Reword changelog Co-authored-by: Calvin Leung Huang <[email protected]>
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.
This adds a new config parameter to the LDAP util SDK
username_as_alias
. A change in #11000 resulted in alias names changing, which has broken a number of users in 1.9+. Using this parameter, an operator can change alias names back.For example, if LDAP auth was configured with no binddn or bindpass, in 1.8.8 the alias name would be:
However, in 1.9.3, the same config would result in alias names like this: