question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`allowed_groups` are looked up with authenticated user instead of search user

See original GitHub issue

Bug description

The plugin uses a so called search user to lookup the dn of the user to be authenticated. The authentication is done using an ldap bind which creates another connection to the server. All subsequent ldap searches are performed with the connection of the authenticated user and not with the connection of the configured search user. Thus, the ldap query to check each of the allowed_groups is performed with the authenticated user instead of the search user.

The real problem behind this behavior: the authenticated user needs the ldap permissions to lookup the ldap groups. I think it’s more the role of the search user to have such permissions instead of the authenticated user. Our institution follows such a consequent security approach where ldap groups are used for authorization by member check. But there is no need that the groups are itself accessible by the members.

Expected behaviour

I would expect that all search operations use the connection established with the search user.

Actual behaviour

After successful authentication, all ldap operations are done with the authenticated user instead of the search user.

How to reproduce

A source review targeting the following aspects or any working setup with debugger or debug output reveals this behavior.

method authenticate: - calls resolve_username to use the search user to lookup the dn of the user to be authenticated - later the variable conn is initialized with a get_connection method call with the user to be authenticated - search_filter and allowed_groups queries use the connection (conn) with the successfully authenticated user

Your personal set up

  • Jupyterhub 1.2.1 with ldap authenticator (customized the official docker image)

How to proceed

I feel confident to fix this issue in a non intrusive way of keeping both connections to the ldap server and introduce a config flag which could be switched on to use the connection with the search user instead of the user to be authenticated.

Is such a contribution desired by the project? Or is the actual behavior the one which is expected by the project? I just ask as there are some pull request open from two years back.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
tobi45commented, Nov 6, 2020

@manics Thanks for your quick answer! I totally understand that situation. And it sounds promising to me. Let’s start with that issue and see how things evolve 😀

0reactions
tobi45commented, Jan 27, 2022

Hey guys, just to prevent confusion: I closed PR #185 and opened its replacement #207. Background: I throw the old repo fork away and created a new one with a new structure allowing me to manage my changesets better.

Please let me know If I could be of any help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allowed groups doesn't work because user cn and memberuid ...
I would need a capability ( this is from a helm chart) to say for example: auth: type: ldap ldap: allowedGroups: - 'CN=xxx,OU=Groups,DC=xyz,DC= ......
Read more >
sshd AllowGroups group not granting access [closed]
Now I am wondering why sshd is not picking up this group (also, users within the group bar can login with AllowGroups active)....
Read more >
sshd_config(5) - Linux manual page - man7.org
AuthorizedKeysCommand Specifies a program to be used to look up the user's public keys. The program must be owned by root, not writable...
Read more >
how to limit certain domain users to access RHEL server via ...
I'm seeing in your post above "domain groups" are you or are you not authenticating your Red Hat systems to a domain controller...
Read more >
SRX - Juniper Secure Connect - domain name search problem | SRX
I am running Junos 21.4 and I have clients connecting using Juniper Secure Connect. They are authenticating use LDAP to the Windows domain...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found