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

Fix handling of multiple LDAP user bind patterns #8134

Merged
merged 1 commit into from
Jun 23, 2021

Conversation

hashhar
Copy link
Member

@hashhar hashhar commented May 28, 2021

Attempt to implement #8022 correctly.

@hashhar hashhar added the WIP label May 28, 2021
@cla-bot cla-bot bot added the cla-signed label May 28, 2021
@hashhar hashhar force-pushed the hashhar/multi-ldap-binds branch 2 times, most recently from 99c74b5 to e0fd4d6 Compare May 30, 2021 19:13
@hashhar hashhar marked this pull request as ready for review May 30, 2021 19:13
@hashhar hashhar force-pushed the hashhar/multi-ldap-binds branch 4 times, most recently from d59d73f to 34e87df Compare May 31, 2021 19:33
@@ -1,7 +1,7 @@
password-authenticator.name=ldap
ldap.url=ldaps://ldapserver:636
ldap.ssl-trust-certificate=/etc/openldap/certs/openldap-certificate.pem
ldap.user-base-dn=ou=Asia,dc=presto,dc=testldap,dc=com
ldap.user-base-dn=dc=presto,dc=testldap,dc=com
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added uid=EuropeUser,ou=Europe and uid=AmericanUser,ou=America who are a memberOf DefaultGroup so both of them should be able to run queries provided they can bind to LDAP.

I've changed the ldap.user-bind-pattern to include both ou=America and ou=Asia so that every user except EuropeUser can bind. And base-dn has been changed to remove ou=Asia because we want to search every ou.

@hashhar hashhar mentioned this pull request Jun 1, 2021
@hashhar hashhar removed the WIP label Jun 5, 2021
@hashhar
Copy link
Member Author

hashhar commented Jun 5, 2021

@kokosing @lukasz-walkiewicz @dain PTAL at the changes.

It's possible and expected for some authentication attempts to fail when
testing multiple LDAP bind patterns. In such cases we should ignore
all AccessDeniedExceptions except any that get thrown when testing the
last pattern.
@@ -47,7 +47,7 @@
testOnEnvironment(SinglenodeLdapAndFile.class).withGroups("ldap", "ldap_and_file", "ldap_cli", "ldap_and_file_cli").build(),
testOnEnvironment(SinglenodeLdapInsecure.class).withGroups("ldap").build(),
testOnEnvironment(SinglenodeLdapReferrals.class).withGroups("ldap").build(),
testOnEnvironment(SinglenodeLdapBindDn.class).withGroups("ldap").build(),
testOnEnvironment(SinglenodeLdapBindDn.class).withGroups("ldap").withExcludedGroups("ldap_multiple_binds").build(),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The BindDn env uses a fixed bind user which cannot be used together with bind patterns obviously. So an exclusion was needed.

@hashhar
Copy link
Member Author

hashhar commented Jun 22, 2021

@kokosing @dain PTAL.

@hashhar hashhar merged commit 97af1be into trinodb:master Jun 23, 2021
@hashhar hashhar added this to the 359 milestone Jun 23, 2021
@hashhar hashhar mentioned this pull request Jun 23, 2021
13 tasks
@hashhar hashhar deleted the hashhar/multi-ldap-binds branch June 23, 2021 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants