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

LDAP groupfilter don't work as expected #137

Closed
chuhn opened this issue Nov 14, 2018 · 2 comments
Closed

LDAP groupfilter don't work as expected #137

chuhn opened this issue Nov 14, 2018 · 2 comments

Comments

@chuhn
Copy link
Contributor

chuhn commented Nov 14, 2018

In our setup we use LDAP authentication with grouptree and groupfilter, eg.

$conf['auth']['ldap']['grouptree']       = 'cn=groups,dc=example,dc=com';
$conf['auth']['ldap']['groupfilter']     = '(&(cn=onagroup)(uniqueMember=%{dn})(objectClass=GroupOfUniqueNames))';

The expected behavior would be that only members of ONAGROUP can connect to ONA and logins of other LDAP accounts fail.
What actually happens is that all LDAP logins with correct credential succeed and the user permissions are comparable to the guest access (global read-only access).

My proposal would be that

function get_authentication($login_name='', $login_password='') {
calls
$auth->getUserData($login_name); and block users with no groups assigned.

@chuhn
Copy link
Contributor Author

chuhn commented Nov 14, 2018

Another observation: LDAP login attempts with an existing user but wrong password are declined with 'Unknown user' instead of 'Wrong password'.
This is due to the direct bind that fails. ONA cannot distinguish between the two.
The error should simply be 'Login failed'.

@mattpascoe
Copy link
Member

Not sure how I totally missed answering you on this one. SORRY!

First off.. I would agree. Returning 'Login failed' would be more appropriate.. that should be forthcoming.

Second. It looks like there is no proper logic for successful logins for users with no groups. Seems to be just doing the default read only thing as you have pointed out. I tried the 'disable_guest' system config option and that did not fix it.

I'll probably look into fixing the disable_guest flag. Basically the general assumption has been a default read only with additional permissions. The disable_guest flag should really be called 'disable_readonly' or similar. Gotta git a bit more on the logic here and see what fits best.

mattpascoe added a commit that referenced this issue Mar 7, 2024
Deny login for LDAP user without group (fixes #137)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants