-
Notifications
You must be signed in to change notification settings - Fork 789
GUACAMOLE-954: Add LDAP support for nested user groups #1091
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
base: main
Are you sure you want to change the base?
Conversation
Personally I think it would be fine to have this feature included, provided we clearly document when it is expected to work and when it probably will not work. Many other software applications out there that leverage LDAP have ways of configuring the type of LDAP server you're pointing to in order to make use of specific features, and I agree that it would be useful for folks pointing at AD-based LDAP servers. |
if (config.getNestedGroups()) { | ||
|
||
// Add support for nested groups using LDAP_MATCHING_RULE_IN_CHAIN | ||
// (memberOf:1.2.840.113556.1.4.1941:=<UserDN>) | ||
// Matching rule OID for LDAP_MATCHING_RULE_IN_CHAIN | ||
// ** This possibly only supports Active Directory ** | ||
ExtensibleNode node = new ExtensibleNode("member"); | ||
filterValue = null; | ||
|
||
// Explicitly set the matching rule ID and dnAttributes | ||
node.setMatchingRuleId("1.2.840.113556.1.4.1941"); | ||
node.setDnAttributes(false); | ||
node.setValue(new Value(userIDorDN)); | ||
groupFilter = new AndNode( | ||
groupFilter, node | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few concerns for this:
- Why is
filterValue
set tonull
, and what is the implication of passing throughnull
to thequeryService.search()
method? - The OID for LDAP_MATCHING_RULE_IN_CHAIN should probably be defined as a
final String
above - if the Apache LDAP API doesn't already have that defined somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@necouchman I believe in my testing the group filter applied with the filtervalue as userIDorDN did not work. It seemed like one or the other and I was trying to avoid duplicate code calling the function twice.
Looks like from the doc, it probably was so the groups could be found outside of where the user's account object was located:
The value that should be searched search for within the attributes of objects within the LDAP directory. If null, the search will test only for the presence of at least one of the given attributes on each object, regardless of the value of those attributes.
I am not aware of any constant for that value, but I agree it makes sense to add it to a variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay - yes, please define that OID as a constant wherever it makes sense.
This is the start of a pull request to address GUACAMOLE-954 in a performant way, but unfortunately this feature only works with Active Directory (as far as I am aware).
I added a new config boolean due to this called 'nested-groups' to enable/disable the AD-specific query.
It makes use of the LDAP_MATCHING_RULE_IN_CHAIN mentioned in the Jira with a specific OID.
I understand if the team is not keen on merging a feature that is only for a specific vendor's LDAP implementation, but this is performant and very useful for us in our AD environment so I would like to try and get it added for the others who requested it and likely using AD as well.