freeradius: add configurable LDAP group membership mode#5430
Open
jkolo wants to merge 1 commit intoopnsense:masterfrom
Open
freeradius: add configurable LDAP group membership mode#5430jkolo wants to merge 1 commit intoopnsense:masterfrom
jkolo wants to merge 1 commit intoopnsense:masterfrom
Conversation
Adds `group_membership_mode` to the LDAP settings (model, form, template): - `attribute` (default): `membership_attribute = 'memberOf'` — existing behaviour, compatible with POSIX groups and flat LDAP structures. - `filter`: `membership_filter` with LDAP_MATCHING_RULE_IN_CHAIN OID (1.2.840.113556.1.4.1941) — resolves nested group membership against Active Directory and Samba 4 AD DC in a single LDAP query. The `memberOf` attribute reflects only direct memberships, breaking `Ldap-Group ==` checks (e.g. VLAN assignment) when groups are nested. The OID-based filter traverses the full membership chain server-side. Default is `attribute`; existing configurations are unaffected. Tested with Samba 4.24 AD DC and FreeRADIUS 3.2 (os-freeradius plugin).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
group_membership_modeto the LDAP settings (model, form, template):attribute(default):membership_attribute = 'memberOf'— existing behaviour, compatible with POSIX groups and flat LDAP structures.filter:membership_filterwith LDAP_MATCHING_RULE_IN_CHAIN OID (1.2.840.113556.1.4.1941) — resolves nested group membership against Active Directory and Samba 4 AD DC in a single LDAP query.The
memberOfattribute reflects only direct memberships, breakingLdap-Group ==checks (e.g. VLAN assignment) when groups are nested. The OID-based filter traverses the full membership chain server-side.Default is
attribute; existing configurations are unaffected.Tested with Samba 4.24 AD DC and FreeRADIUS 3.2 (os-freeradius plugin).
Important notices
Before you submit a pull request, we ask you kindly to acknowledge the following:
If AI was used, please disclose:
Describe the problem
FreeRADIUS hardcodes
membership_attribute = 'memberOf'in the LDAP module configuration. ThememberOfattribute on a user object reflects only direct group memberships. In Active Directory and Samba 4 AD DC deployments that rely on nested security groups,Ldap-Group ==checks (used e.g. for VLAN assignment in 802.1X) silently fail for users who are members only through a parentgroup.
Describe the proposed solution
Adds a Group Membership Mode option to the FreeRADIUS LDAP settings page:
membership_filterusing theLDAP_MATCHING_RULE_IN_CHAINOID (1.2.840.113556.1.4.1941), which instructs the LDAP server to resolve the full transitive membership chain in a single query — compatible with Active Directory and Samba 4.Related issue
None.