Skip to content

Conversation

@steffen-moser
Copy link

…sed Session Admission

The change will extend the user lookup code by the ability to search not only through the groupOfNames but also through the posixGroup scheme. The piece of code seems to work with both schemes in my tests successfully.

I am not sure if there are any pitfalls when just combining the possible results. Maybe introducing a configuration flag to choose whether searching posixGroup or groupOfNames would be a better approach.

@necouchman
Copy link
Contributor

Maybe introducing a configuration flag to choose...

I'm perfectly good with the changes you suggested here, but I would vote for making it configurable, as that would improve LDAP performance on searches, especially for larger trees.

@mike-jumper
Copy link
Contributor

My only concerns would be with respect to the guacConfigGroup schema:

https://github.com/apache/guacamole-client/blob/6db25395698632d93e766e73ec73437eb262b5a3/extensions/guacamole-auth-ldap/schema/guacConfigGroup.schema

The guacConfigGroup is defined as extending groupOfNames, which is a standard object class which defines and requires the member attribute (see RFC 2519). Adding a memberUid attribute to a guacConfigGroup technically doesn't follow the schema definition of the object class itself, and though it does follow the schema of the object class referenced in this PR and JIRA (posixGroup, defined by RFC 2307), I'm on unclear on:

  1. Why does guacConfigGroup, a connection configuration mechanism specific to Guacamole, need to support memberUid? Why use member, as defined by groupOfNames?
  2. If this is something that is desirable, how does it affect our defined LDAP schema?

Copy link
Contributor

@necouchman necouchman left a comment

Choose a reason for hiding this comment

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

@mike-jumper:

Why does guacConfigGroup, a connection configuration mechanism specific to Guacamole, need to support memberUid? Why use member, as defined by groupOfNames

Isn't the search that's being modified not looking for guacConfigGroups, and only looking for actual groups:

"(&(!(objectClass=guacConfigGroup))(|(member=" + escapingService.escapeLDAPSearchFilter(userDN) + ")(memberUid=" + user.getCredentials().getUsername() + ")))"

?? It's generating the search filter which will ultimately be used to find connections accessible to the current user through group membership, and all this change really accomplishes is to make sure that it looks for both groupOfNames and posixGroup objects, correct? It's not actually examining guacConfigGroup objects. Or maybe I'm missing something?

@steffen-moser:
Need to add documentation for the one new parameter, as noted above. Also, I do think this should be configurable and not something that automatically gets added to every search, as I've already noted.

* @throws LDAPException
* If an error occurs preventing retrieval of user groups.
*
* @throws GuacamoleException
Copy link
Contributor

Choose a reason for hiding this comment

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

New parameter needs to be added to the documentation.

@mike-jumper
Copy link
Contributor

Yup, that's correct. Never mind - I misread the query.

groupBaseDN,
LDAPConnection.SCOPE_SUB,
"(&(!(objectClass=guacConfigGroup))(member=" + escapingService.escapeLDAPSearchFilter(userDN) + "))",
"(&(!(objectClass=guacConfigGroup))(|(member=" + escapingService.escapeLDAPSearchFilter(userDN) + ")(memberUid=" + user.getCredentials().getUsername() + ")))",
Copy link
Contributor

Choose a reason for hiding this comment

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

The username value here will need to be escaped for inclusion in a filter.

@necouchman
Copy link
Contributor

@steffen-moser Any chance you can work on this a bit more to get it ready for merge? I'd like to set the final list of issues for inclusion in the version 1.0.0 release, and this looks like a good candidate to me if it's something you can spend a little more time on?

@necouchman
Copy link
Contributor

Ping @steffen-moser - see last note, would like to include this in 1.0.0...

@necouchman
Copy link
Contributor

@steffen-moser Merge base needs to be changed to staging/1.0.0 to be included in 1.0.0 release.

@necouchman
Copy link
Contributor

@steffen-moser Ping...

@necouchman
Copy link
Contributor

@steffen-moser Last call, else this will be pulled from the 1.0.0 release.

@necouchman
Copy link
Contributor

Closed by #450

@necouchman necouchman closed this Jan 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants