Skip to content
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

missing entity alias attribute value with #26171

Closed
trutled3 opened this issue Mar 26, 2024 · 12 comments · Fixed by #26200
Closed

missing entity alias attribute value with #26171

trutled3 opened this issue Mar 26, 2024 · 12 comments · Fixed by #26200
Labels
auth/ldap bug Used to indicate a potential bug reproduced This issue has been reproduced by a Vault engineer

Comments

@trutled3
Copy link

trutled3 commented Mar 26, 2024

Describe the bug
A clear and concise description of what the bug is.

After upgrading Vault to v1.16.0 from v1.15.1 we are seeing an error when signing in through the ldap auth method stating, Authentication failed: missing entity alias attribute value. I am using active directory.

Screenshot 2024-03-26 at 4 58 29 PM

To Reproduce
Steps to reproduce the behavior:

  1. Enable ldap auth method with config similar to:
  url="<REDACTED>" \
  userattr="sAMAccountName" \
  userdn="<REDACTED>" \
  binddn="<REDACTED>" \
  bindpass="<REDACTED>" \
  groupdn="<REDACTED>" \
  certificate=@ldap_cert.pem \
  insecure_tls=true \
  case_sensitive_names=false \
  starttls=true
  1. Attempt to sign in to Vault with ldap auth method.

Expected behavior
Expected behavior is for ldap auth method behavior to remain the same between v1.15.1 and v1.16.0 with no changes to ldap auth method configuration.

Environment:

  • Vault Server Version (retrieve with vault status): 1.16.0
  • Vault CLI Version (retrieve with vault version): N/A
  • Server Operating System/Architecture: Ubuntu

Vault server configuration file(s):

  url="<REDACTED>" \
  userattr="sAMAccountName" \
  userdn="<REDACTED>" \
  binddn="<REDACTED>" \
  bindpass="<REDACTED>" \
  groupdn="<REDACTED>" \
  certificate=@ldap_cert.pem \
  insecure_tls=true \
  case_sensitive_names=false \
  starttls=true
@heatherezell heatherezell added auth/ldap bug Used to indicate a potential bug labels Mar 26, 2024
@heatherezell
Copy link
Contributor

Hi @trutled3 - thanks for this report! Is this on 1.16.0 GA or one of the RCs? It'll help our investigation. Thanks much! :)

@trutled3
Copy link
Author

Hi there!

This was v1.16.0 GA that was released today.

@heatherezell
Copy link
Contributor

heatherezell commented Mar 27, 2024

Hi there!

This was v1.16.0 GA that was released today.

Thank you so much! I'll pass this along. Edit: I misspoke on the state of the version.

@trutled3
Copy link
Author

Oh, okay. Thanks!

@usernamemikem
Copy link

I have the exact same issue. Upgraded just minutes ago.

@Joffrey54
Copy link

Joffrey54 commented Mar 27, 2024

Are you using Active Directory ? I have the same issue
I set "Username as Alias" and it resoled the issue

@trutled3
Copy link
Author

@Joffrey54 - I am using active directory, yes! I did not include that information in my original issue post. I updated to include that information as well.

@usernamemikem
Copy link

I have the exact same issue. Upgraded just minutes ago.

@Joffrey54 - Same here, using Active Directory.

@Joffrey54
Copy link

Perhaps the bug come from the "user attribute" that is forced in lowercase:
image

In Windows, this attribute is "sAMAccountName"

But, as I said, this option solved the error for me:
image

@usernamemikem
Copy link

Thank you @Joffrey54! Checking the Username as alias box also worked for me.

@trutled3
Copy link
Author

I can confirm checking the username as alias box resolves the error for me as well.

@fairclothjm
Copy link
Contributor

Thanks everyone, we are working on a fix for this now.

The workaround mentioned above should be used with caution since the user attribute is customizable.

@heatherezell heatherezell added the reproduced This issue has been reproduced by a Vault engineer label Mar 27, 2024
fairclothjm added a commit that referenced this issue Mar 28, 2024
This fixes 2 ldap auth login errors

* Missing entity alias attribute value
  * Vault relies on case insensitive user attribute keys for mapping user
    attributes to entity alias metadata. This sets the appropriate
    configs in the cap library.

* ldap group search anonymous bind regression
  * Anonymous group searches can be rejected by some LDAP servers if
    they contain a userDN. This sets the configs in the cap library to
    specify unauthenticated binds for anonymous group searches should
    exclude a DN.

Closes #26171
Closes #26183
fairclothjm added a commit that referenced this issue Mar 28, 2024
* auth/ldap: fix login errors

This fixes 2 ldap auth login errors

* Missing entity alias attribute value
  * Vault relies on case insensitive user attribute keys for mapping user
    attributes to entity alias metadata. This sets the appropriate
    configs in the cap library.

* ldap group search anonymous bind regression
  * Anonymous group searches can be rejected by some LDAP servers if
    they contain a userDN. This sets the configs in the cap library to
    specify unauthenticated binds for anonymous group searches should
    exclude a DN.

Closes #26171
Closes #26183

* changelog

* go mod tidy

* go get cap/ldap@latest and go mod tidy
fairclothjm added a commit that referenced this issue Mar 28, 2024
* auth/ldap: fix login errors

This fixes 2 ldap auth login errors

* Missing entity alias attribute value
  * Vault relies on case insensitive user attribute keys for mapping user
    attributes to entity alias metadata. This sets the appropriate
    configs in the cap library.

* ldap group search anonymous bind regression
  * Anonymous group searches can be rejected by some LDAP servers if
    they contain a userDN. This sets the configs in the cap library to
    specify unauthenticated binds for anonymous group searches should
    exclude a DN.

Closes #26171
Closes #26183

* changelog

* go mod tidy

* go get cap/ldap@latest and go mod tidy
digivava pushed a commit that referenced this issue Mar 28, 2024
* auth/ldap: fix login errors

This fixes 2 ldap auth login errors

* Missing entity alias attribute value
  * Vault relies on case insensitive user attribute keys for mapping user
    attributes to entity alias metadata. This sets the appropriate
    configs in the cap library.

* ldap group search anonymous bind regression
  * Anonymous group searches can be rejected by some LDAP servers if
    they contain a userDN. This sets the configs in the cap library to
    specify unauthenticated binds for anonymous group searches should
    exclude a DN.

Closes #26171
Closes #26183

* changelog

* go mod tidy

* go get cap/ldap@latest and go mod tidy
fairclothjm added a commit that referenced this issue Apr 9, 2024
Add tests to cover the regressions reported in
- #26171
- #26183
fairclothjm added a commit that referenced this issue Apr 10, 2024
* ldap/auth: add tests for login regressions

Add tests to cover the regressions reported in
- #26171
- #26183

* fix tests; update image tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth/ldap bug Used to indicate a potential bug reproduced This issue has been reproduced by a Vault engineer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants