It's been a while since I was working on this, and I've made some further progress but FreeRADIUS is still not doing what I'm after. It is successfully sending back an Access-Accept packet or Access-Reject packet as I would like, but none of the reply attributes that correspond to the group that they are a member of are returned. Initially I didn't have FreeRADIUS configured correctly (nothing in the "users" file to set a User-Profile...), now from what I can gather, the rlm_ldap module is now doing a search for the correct profile, but the filter it is using is incorrect and I can't work out where you would change it in the configuration file.
Please take a look at the line in my debug output that shows the ldap search for the user profile - the filter doesn't look right to me. I want it to use the filter being the Ldap-Group...I don't think anywhere in my config though I can set what that filter is!? rlm_ldap: performing search in cn=dialup,cn=group,cn=radius,cn=config,ou=eaccounts,dc=megashaft,dc=com, dc=au, with filter (objectclass=radiusprofile) Anyway I'll include the rest of the debugging below - I might be miles off... Here is what I have added since last time in my users file (this is all that is in there at this stage - the nas terminates both adsl and dialup so I'll have different profiles eventually for each type, but for the moment I'm just using the dialup example... --- users file --- DEFAULT Ldap-Group == dialup, User-Profile := "cn=dialup,cn=group,cn=radius,cn=config,ou=eaccounts,dc=megashaft,dc=com ,dc=au" Fall-Through = no This is the ldap section of my radius.conf file -- radius.conf --- # See doc/rlm_ldap for description of configuration options # and sample authorize{} and authenticate{} blocks ldap { server = "ldap2-dev.megashaft.com.au" identity = "cn=root,dc=megashaft,dc=com,dc=au" password = testpassword basedn = "dc=megashaft,dc=com,dc=au" # filter = "(uid=%{Stripped-User-Name:-%{User-Name}})" filter = "(&(objectClass=radiusProfile)(uid=%{Stripped-User-Name:-%{User-Name}})) " # set this to 'yes' to use TLS encrypted connections # to the LDAP database by using the StartTLS extended # operation. # The StartTLS operation is supposed to be used with normal # ldap connections instead of using ldaps (port 689) connections start_tls = no # default_profile = "cn=radprofile,ou=dialup,o=My Org,c=UA" # profile_attribute = "radiusProfileDn" access_attr = "dialupAccess" # Mapping of RADIUS dictionary attributes to LDAP # directory attributes. dictionary_mapping = ${raddbdir}/ldap.attrmap ldap_connections_number = 5 # password_header = "{clear}" # password_attribute = userPassword groupname_attribute = uid groupmembership_filter = "($(uid=dialup)(objectClass=radiusProfile))" # groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=Gr oupOfUnique Names)(uniquemember=%{Ldap-UserDn})))" groupmembership_attribute = radiusGroupName timeout = 4 timelimit = 3 net_timeout = 1 # compare_check_items = yes # access_attr_used_for_allow = yes } In the authorise block I have authorize { preprocess suffix files mschap ldap } And in the authenticate block I have authenticate { Auth-Type PAP { pap } Auth-Type CHAP { chap } Auth-Type MS-CHAP { mschap } Auth-Type LDAP { ldap } } Here is the output from radiusd -X [EMAIL PROTECTED] raddb]# radiusd -X Starting - reading configuration files ... reread_config: reading radiusd.conf Config: including file: /usr/local/etc/raddb/proxy.conf Config: including file: /usr/local/etc/raddb/clients.conf Config: including file: /usr/local/etc/raddb/snmp.conf Config: including file: /usr/local/etc/raddb/sql.conf main: prefix = "/usr/local" main: localstatedir = "/usr/local/var" main: logdir = "/var/log/radius" main: libdir = "/usr/local/lib" main: radacctdir = "/var/log/radius/radacct" main: hostname_lookups = no main: max_request_time = 30 main: cleanup_delay = 5 main: max_requests = 1024 main: delete_blocked_requests = 0 main: port = 0 main: allow_core_dumps = no main: log_stripped_names = no main: log_file = "/var/log/radius/radius.log" main: log_auth = no main: log_auth_badpass = yes main: log_auth_goodpass = no main: pidfile = "/usr/local/var/run/radiusd/radiusd.pid" main: bind_address = 203.191.96.199 IP address [203.191.96.199] main: user = "nobody" main: group = "nobody" main: usercollide = no main: lower_user = "no" main: lower_pass = "no" main: nospace_user = "no" main: nospace_pass = "no" main: checkrad = "/usr/local/sbin/checkrad" main: proxy_requests = yes proxy: retry_delay = 5 proxy: retry_count = 3 proxy: synchronous = no proxy: default_fallback = yes proxy: dead_time = 120 proxy: post_proxy_authorize = yes proxy: wake_all_if_all_dead = no security: max_attributes = 200 security: reject_delay = 1 security: status_server = no main: debug_level = 0 read_config_files: reading dictionary read_config_files: reading naslist read_config_files: reading clients read_config_files: reading realms Using deprecated realms file. Support for this will go away soon. radiusd: entering modules setup Module: Library search path is /usr/local/lib Module: Loaded expr Module: Instantiated expr (expr) Module: Loaded PAP pap: encryption_scheme = "crypt" Module: Instantiated pap (pap) Module: Loaded CHAP Module: Instantiated chap (chap) Module: Loaded MS-CHAP mschap: use_mppe = yes mschap: require_encryption = no mschap: require_strong = no mschap: passwd = "(null)" mschap: authtype = "MS-CHAP" Module: Instantiated mschap (mschap) Module: Loaded LDAP ldap: server = "ldap2-dev.megashaft.com.au" ldap: port = 389 ldap: net_timeout = 1 ldap: timeout = 4 ldap: timelimit = 3 ldap: identity = "cn=root,dc=megashaft,dc=com,dc=au" ldap: start_tls = no ldap: password = "testpassword" ldap: basedn = "dc=megashaft,dc=com,dc=au" ldap: filter = "(&(objectClass=radiusProfile)(uid=%{Stripped-User-Name:-%{User-Name}})) " ldap: default_profile = "(null)" ldap: profile_attribute = "(null)" ldap: password_header = "(null)" ldap: password_attribute = "(null)" ldap: access_attr = "dialupAccess" ldap: groupname_attribute = "uid" ldap: groupmembership_filter = "($(uid=dialup)(objectClass=radiusProfile))" ldap: groupmembership_attribute = "radiusGroupName" ldap: dictionary_mapping = "/usr/local/etc/raddb/ldap.attrmap" ldap: ldap_debug = 0 ldap: ldap_connections_number = 5 ldap: compare_check_items = no ldap: access_attr_used_for_allow = yes conns: (nil) rlm_ldap: reading ldap<->radius mappings from file /usr/local/etc/raddb/ldap.attrmap rlm_ldap: LDAP radiusCheckItem mapped to RADIUS $GENERIC$ rlm_ldap: LDAP radiusReplyItem mapped to RADIUS $GENERIC$ rlm_ldap: LDAP radiusAuthType mapped to RADIUS Auth-Type rlm_ldap: LDAP radiusSimultaneousUse mapped to RADIUS Simultaneous-Use rlm_ldap: LDAP radiusCalledStationId mapped to RADIUS Called-Station-Id rlm_ldap: LDAP radiusCallingStationId mapped to RADIUS Calling-Station-Id rlm_ldap: LDAP lmPassword mapped to RADIUS LM-Password rlm_ldap: LDAP ntPassword mapped to RADIUS NT-Password rlm_ldap: LDAP acctFlags mapped to RADIUS SMB-Account-CTRL-TEXT rlm_ldap: LDAP radiusExpiration mapped to RADIUS Expiration rlm_ldap: LDAP radiusServiceType mapped to RADIUS Service-Type rlm_ldap: LDAP radiusFramedProtocol mapped to RADIUS Framed-Protocol rlm_ldap: LDAP radiusFramedIPAddress mapped to RADIUS Framed-IP-Address rlm_ldap: LDAP radiusFramedIPNetmask mapped to RADIUS Framed-IP-Netmask rlm_ldap: LDAP radiusFramedRoute mapped to RADIUS Framed-Route rlm_ldap: LDAP radiusFramedRouting mapped to RADIUS Framed-Routing rlm_ldap: LDAP radiusFilterId mapped to RADIUS Filter-Id rlm_ldap: LDAP radiusFramedMTU mapped to RADIUS Framed-MTU rlm_ldap: LDAP radiusFramedCompression mapped to RADIUS Framed-Compression rlm_ldap: LDAP radiusLoginIPHost mapped to RADIUS Login-IP-Host rlm_ldap: LDAP radiusLoginService mapped to RADIUS Login-Service rlm_ldap: LDAP radiusLoginTCPPort mapped to RADIUS Login-TCP-Port rlm_ldap: LDAP radiusCallbackNumber mapped to RADIUS Callback-Number rlm_ldap: LDAP radiusCallbackId mapped to RADIUS Callback-Id rlm_ldap: LDAP radiusFramedIPXNetwork mapped to RADIUS Framed-IPX-Network rlm_ldap: LDAP radiusClass mapped to RADIUS Class rlm_ldap: LDAP radiusSessionTimeout mapped to RADIUS Session-Timeout rlm_ldap: LDAP radiusIdleTimeout mapped to RADIUS Idle-Timeout rlm_ldap: LDAP radiusTerminationAction mapped to RADIUS Termination-Action rlm_ldap: LDAP radiusLoginLATService mapped to RADIUS Login-LAT-Service rlm_ldap: LDAP radiusLoginLATNode mapped to RADIUS Login-LAT-Node rlm_ldap: LDAP radiusLoginLATGroup mapped to RADIUS Login-LAT-Group rlm_ldap: LDAP radiusFramedAppleTalkLink mapped to RADIUS Framed-AppleTalk-Link rlm_ldap: LDAP radiusFramedAppleTalkNetwork mapped to RADIUS Framed-AppleTalk-Network rlm_ldap: LDAP radiusFramedAppleTalkZone mapped to RADIUS Framed-AppleTalk-Zone rlm_ldap: LDAP radiusPortLimit mapped to RADIUS Port-Limit rlm_ldap: LDAP radiusLoginLATPort mapped to RADIUS Login-LAT-Port conns: 0x8101d58 Module: Instantiated ldap (ldap) Module: Loaded preprocess preprocess: huntgroups = "/usr/local/etc/raddb/huntgroups" preprocess: hints = "/usr/local/etc/raddb/hints" preprocess: with_ascend_hack = no preprocess: ascend_channels_per_line = 23 preprocess: with_ntdomain_hack = no preprocess: with_specialix_jetstream_hack = no preprocess: with_cisco_vsa_hack = no Module: Instantiated preprocess (preprocess) Module: Loaded realm realm: format = "suffix" realm: delimiter = "@" Module: Instantiated realm (suffix) Module: Loaded files files: usersfile = "/usr/local/etc/raddb/users" files: acctusersfile = "/usr/local/etc/raddb/acct_users" files: preproxy_usersfile = "/usr/local/etc/raddb/preproxy_users" files: compat = "no" Module: Instantiated files (files) Module: Loaded Acct-Unique-Session-Id acct_unique: key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port-Id" Module: Instantiated acct_unique (acct_unique) Module: Loaded detail detail: detailfile = "/var/log/radius/radacct/%{Client-IP-Address}/detail-%Y%m%d" detail: detailperm = 384 detail: dirperm = 493 detail: locking = no Module: Instantiated detail (detail) Module: Loaded radutmp radutmp: filename = "/var/log/radius/radutmp" radutmp: username = "%{User-Name}" radutmp: case_sensitive = yes radutmp: check_with_nas = yes radutmp: perm = 384 radutmp: callerid = yes Module: Instantiated radutmp (radutmp) Listening on IP address 203.191.96.199, ports 1812/udp and 1813/udp, with proxy on 1814/udp. Ready to process requests. rad_recv: Access-Request packet from host 203.191.96.199:34032, id=161, length=56 User-Name = "hugh" User-Password = "testpassword" NAS-IP-Address = 255.255.255.255 NAS-Port = 1 modcall: entering group authorize for request 0 modcall[authorize]: module "preprocess" returns ok for request 0 modcall[authorize]: module "chap" returns noop for request 0 rlm_realm: No '@' in User-Name = "hugh", looking up realm NULL rlm_realm: Found realm "NULL" rlm_realm: Adding Stripped-User-Name = "hugh" rlm_realm: Proxying request from user hugh to realm NULL rlm_realm: Adding Realm = "NULL" rlm_realm: Authentication realm is LOCAL. modcall[authorize]: module "suffix" returns noop for request 0 rlm_ldap: Entering ldap_groupcmp() radius_xlat: 'dc=megashaft,dc=com,dc=au' radius_xlat: '(&(objectClass=radiusProfile)(uid=hugh))' ldap_get_conn: Got Id: 0 rlm_ldap: attempting LDAP reconnection rlm_ldap: (re)connect to ldap2-dev.megashaft.com.au:389, authentication 0 rlm_ldap: bind as cn=root,dc=megashaft,dc=com,dc=au/testpassword to ldap2-dev.megashaft.com.au:389 rlm_ldap: waiting for bind result ... rlm_ldap: performing search in dc=megashaft,dc=com,dc=au, with filter (&(objectClass=radiusProfile)(uid=hugh)) ldap_release_conn: Release Id: 0 radius_xlat: '($(uid=dialup)(objectClass=radiusProfile))' ldap_get_conn: Got Id: 0 rlm_ldap: performing search in dc=megashaft,dc=com,dc=au, with filter (&(uid=dialup)($(uid=dialup)(objectClass=radiusProfile))) rlm_ldap: object not found or got ambiguous search result ldap_release_conn: Release Id: 0 ldap_get_conn: Got Id: 0 rlm_ldap: performing search in cn=hugh,cn=3,cn=2000,cn=package,cn=hugh,cn=user,ou=eaccounts,dc=megashaf t,dc=com,dc=au, with filter (objectclass=*) rlm_ldap::ldap_groupcmp: User found in group dialup ldap_release_conn: Release Id: 0 users: Matched DEFAULT at 53 modcall[authorize]: module "files" returns ok for request 0 modcall[authorize]: module "mschap" returns noop for request 0 rlm_ldap: - authorize rlm_ldap: performing user authorization for hugh radius_xlat: '(&(objectClass=radiusProfile)(uid=hugh))' radius_xlat: 'dc=megashaft,dc=com,dc=au' ldap_get_conn: Got Id: 0 rlm_ldap: performing search in dc=megashaft,dc=com,dc=au, with filter (&(objectClass=radiusProfile)(uid=hugh)) rlm_ldap: checking if remote access for hugh is allowed by dialupAccess rlm_ldap: performing search in cn=dialup,cn=group,cn=radius,cn=config,ou=eaccounts,dc=megashaft,dc=com, dc=au, with filter (objectclass=radiusprofile) rlm_ldap: object not found or got ambiguous search result rlm_ldap: default_profile/user-profile search failed rlm_ldap: looking for check items in directory... rlm_ldap: looking for reply items in directory... rlm_ldap: user hugh authorized to use remote access ldap_release_conn: Release Id: 0 modcall[authorize]: module "ldap" returns ok for request 0 modcall: group authorize returns ok for request 0 rad_check_password: Found Auth-Type LDAP auth: type "LDAP" modcall: entering group Auth-Type for request 0 rlm_ldap: - authenticate rlm_ldap: login attempt by "hugh" with password "testpassword" rlm_ldap: user DN: cn=hugh,cn=3,cn=2000,cn=package,cn=hugh,cn=user,ou=eaccounts,dc=megashaf t,dc=com,dc=au rlm_ldap: (re)connect to ldap2-dev.megashaft.com.au:389, authentication 1 rlm_ldap: bind as cn=hugh,cn=3,cn=2000,cn=package,cn=hugh,cn=user,ou=eaccounts,dc=megashaf t,dc=com,dc=au/testpassword to ldap2-dev.megashaft.com.au:389 rlm_ldap: waiting for bind result ... rlm_ldap: user hugh authenticated succesfully modcall[authenticate]: module "ldap" returns ok for request 0 modcall: group Auth-Type returns ok for request 0 Sending Access-Accept of id 161 to 203.191.96.199:34032 Finished request 0 Going to the next request --- Walking the entire request list --- Waking up in 6 seconds... --- Walking the entire request list --- Cleaning up request 0 ID 161 with timestamp 404692a6 Nothing to do. Sleeping until we see a request. (some details changed to protect the innocent) Thanks for any suggestions you may have! - I've gotten a lot further from reading that document at http://doris.name/radius/ - that was what gave away the tip of needing to use the users file! Cheers, Sam -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dustin Doris Sent: Saturday, 3 January 2004 2:19 AM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: ldap auth: requiring group membership Check out www.doris.cc/radius. It is my setup that I am using and does what you would want. If you have any questions, post to the list and I'll try to answer them as best as I can. Dusty Doris On Tue, 30 Dec 2003, Ryan Henry wrote: > I have ldap auth working and would like to allow/disallow access based > on the user being in a certian group. > > this shows in the log: modcall: group authenticate returns ok but > there is never any ldap query to check the group. > > i have this in my radiusd.conf: > > groupname_attribute = cn > groupmembership_filter = > "(|(&(objectClass=posixGroup)(member=%{Ldap-UserDn}))(&(objectClass=Gr > oupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))" > groupmembership_attribute = radiusGroupName > > and this in users: > > DEFAULT Ldap-Group != "dialup", Auth-Type := REJECT > Reply-Message = "Sorry, you are not allowed to have dialup access" > > If anyone has any suggestions or could post their config with this > functionality working, I would appreciate it. > > Thanks, > -Ryan > > > - > List info/subscribe/unsubscribe? See > http://www.freeradius.org/list/users.html > - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html