FreeRadius, Active Directory, LDAP Authorization
Hi, I have installed FreeRadius server 2.1.12, installed and configured Kerberos, Samba; configured ntlm_auth program for FreeRadius Authentication with Active Directory. Everything is successful and running smoothly till this stage. Now, I am in the phase of configuration of Authorization in FreeRadius. For Authorization process I want to use LDAP database which is already up and running in another server (not in the server where FreeRadius is installed). The authorization should be granted in such a way that some users should be allowed/restricted VPN, some should be allowed/restricted wifi, etc....... I am not sure whether this is the best way to do Authorization using LDAP or not because it is first time I am trying this in FreeRadius. After changing the configuration as mentioned below and running FreeRadius in debug mode, I get successful "Ready to process requests" but while supplying user credentials I get rad_recv: *Access-Reject *packet from host 127.0.0.1 port 1812, id=60, length=20. What I have done so far is: I uncommented the "LDAP" in authorize section of both files /usr/local/etc/raddb/sites-enabled/default and /usr/local/etc/raddb/sites-enabled/inner-tunnel. I have changed the configuration in /usr/local/etc/raddb/modules/ldap accordingly as: (Some parts are left blank for privacy) ldap { server = "*My ldap server name*" identity = "cn= ,dc= ,dc= " password = basedn = "dc= ,dc= " filter = "(uid=%{%{Stripped-User-Name}:-%{User-Name}})" ldap_connections_number = 5 timeout = 4 timelimit = 3 net_timeout = 1 tls { start_tls = no } dictionary_mapping = ${raddbdir}/ldap.attrmap edir_account_policy_check = no } In /usr/local/etc/raddb/users file: DEFAULT Auth-Type = ntlm_auth bob Cleartext-Password := "hello" I havn't done any change in Authenticate section of both /usr/local/etc/raddb/sites-enabled/default and /usr/local/etc/raddb/sites-enabled/inner-tunnel files related to LDAP. I have listed authenticate section of ntlm_auth by following deployingradius.com. But while following *"rlm_ldap"* doc I have seen that it is mentioned: LDAP and Active Directory ------------------------- *You can only use PAP, and then only if you list "ldap" in the "authenticate" section.* Does this mean I need to list ldap in authenticate section also. If I list it, what about ntlm_auth that is already enabled for authentication. I am confused with this. Should I need to install openldap & openssl also in the machine where freeradius is installed to make LDAP authorisation work properly? Please suggest me whether the configuration & process I am following related to LDAP is the good way to do or not. If not what is the best way to achieve it. Any documentation/site/thread suggestion regarding this would be greately appreciated. Thanks, -- View this message in context: http://freeradius.1045715.n5.nabble.com/FreeRadius-Active-Directory-LDAP-Aut... Sent from the FreeRadius - User mailing list archive at Nabble.com.
suggestme wrote:
I have installed FreeRadius server 2.1.12, installed and configured Kerberos, Samba; configured ntlm_auth program for FreeRadius Authentication with Active Directory. Everything is successful and running smoothly till this stage. Now, I am in the phase of configuration of Authorization in FreeRadius. For Authorization process I want to use LDAP database which is already up and running in another server (not in the server where FreeRadius is installed). The authorization should be granted in such a way that some users should be allowed/restricted VPN, some should be allowed/restricted wifi, etc.......
What does that mean? i.e. HOW do you determine which users get what access? For most people, this means LDAP groups. Put users into groups, and give them permissions based on LDAP groups. You can check the groups at run time from FreeRADIUS.
I am not sure whether this is the best way to do Authorization using LDAP or not because it is first time I am trying this in FreeRadius. After changing the configuration as mentioned below and running FreeRadius in debug mode, I get successful "Ready to process requests" but while supplying user credentials I get rad_recv: *Access-Reject *packet from host 127.0.0.1 port 1812, id=60, length=20.
The debug log will tell you why the user was rejrected. Read it.
What I have done so far is:
Not post the debug log as suggested in the FAQ, README, "man" page, web site, and daily on this list.
But while following *"rlm_ldap"* doc I have seen that it is mentioned:
LDAP and Active Directory -------------------------
*You can only use PAP, and then only if you list "ldap" in the "authenticate" section.*
Does this mean I need to list ldap in authenticate section also. If I list it, what about ntlm_auth that is already enabled for authentication. I am confused with this.
Read my web page on Active Directory integration It explains this/
Should I need to install openldap & openssl also in the machine where freeradius is installed to make LDAP authorisation work properly?
No.
Please suggest me whether the configuration & process I am following related to LDAP is the good way to do or not. If not what is the best way to achieve it. Any documentation/site/thread suggestion regarding this would be greately appreciated.
My AD integration page (http://deployingradius.com) explains this in great detail. Alan DeKok.
Hi, After configuration and running the FreeRadius in debug mode, I see that binding with LDAP server is successful as : *[ldap] Bind was successful* Then it does searching of user with filter and gives the error as : *[ldap] ldap_search() failed: Operations error after* *[ldap] search failed* Is there anything I am missing due to which I am getting this error? Is this related to any configuration that needs to be done in LDAP server side or any change I need to do in /usr/local/etc/raddb/dictionary and /usr/local/etc/raddb/ldap.attrmap. I am doing Authentication using ntlm_auth as suggested by deployingradius.com, which is successful. Now, I am doing Authorization using LDAP. Thanks -- View this message in context: http://freeradius.1045715.n5.nabble.com/FreeRadius-Active-Directory-LDAP-Aut... Sent from the FreeRadius - User mailing list archive at Nabble.com.
On 07/12/11 14:22, suggestme wrote:
Hi,
After configuration and running the FreeRadius in debug mode, I see that binding with LDAP server is successful as : *[ldap] Bind was successful* Then it does searching of user with filter and gives the error as : *[ldap] ldap_search() failed: Operations error after* *[ldap] search failed*
This is an LDAP error - check the LDAP filter syntax and search base. Or post the "radiusd -X" output, as requested a million times a day (or so it sometimes seems) on this list.
Thank you all for the suggestions. I have already installed FreeRadius 2.1.12 which I am running, an I have got ldap in file /usr/local/etc/raddb/modules/ldap; I have gone through it and I am still not sure where the problem lies. I have here included below the part of debug mode output that I have got running radiusd -X. I have illustrated the output part after "Linked to module rlm_ldap" Module: Linked to module rlm_ldap Module: Instantiating module "ldap" from file /usr/local/etc/raddb/modules/ldap ldap { server = "Example.com" port = 389 password = "" identity = "" net_timeout = 1 timeout = 4 timelimit = 3 tls_mode = no start_tls = no tls_require_cert = "allow" tls { start_tls = no require_cert = "allow" } basedn = "dc=Example,dc=com" filter = "(sAMAccountName=%{%{Stripped-User-Name}:-%{User-Name}})" base_filter = "(objectclass=radiusprofile)" auto_header = no access_attr_used_for_allow = yes groupname_attribute = "cn" groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))" dictionary_mapping = "/usr/local/etc/raddb/ldap.attrmap" ldap_debug = 0 ldap_connections_number = 5 compare_check_items = no do_xlat = yes set_auth_type = yes } rlm_ldap: Registering ldap_groupcmp for Ldap-Group rlm_ldap: Registering ldap_xlat with xlat_name ldap rlm_ldap: Over-riding set_auth_type, as there is no module ldap listed in the "authenticate" section. 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 sambaLmPassword mapped to RADIUS LM-Password rlm_ldap: LDAP sambaNtPassword mapped to RADIUS NT-Password rlm_ldap: LDAP dBCSPwd mapped to RADIUS LM-Password rlm_ldap: LDAP userPassword mapped to RADIUS Password-With-Header rlm_ldap: LDAP acctFlags mapped to RADIUS SMB-Account-CTRL-TEXT rlm_ldap: LDAP radiusExpiration mapped to RADIUS Expiration rlm_ldap: LDAP radiusNASIpAddress mapped to RADIUS NAS-IP-Address 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 rlm_ldap: LDAP radiusReplyMessage mapped to RADIUS Reply-Message rlm_ldap: LDAP radiusTunnelType mapped to RADIUS Tunnel-Type rlm_ldap: LDAP radiusTunnelMediumType mapped to RADIUS Tunnel-Medium-Type rlm_ldap: LDAP radiusTunnelPrivateGroupId mapped to RADIUS Tunnel-Private-Group-Id conns: 0x2853e2e0 Module: Checking preacct {...} for more modules to load Module: Linked to module rlm_acct_unique Module: Instantiating module "acct_unique" from file /usr/local/etc/raddb/modules/acct_unique acct_unique { key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port" } Module: Checking accounting {...} for more modules to load Module: Linked to module rlm_detail Module: Instantiating module "detail" from file /usr/local/etc/raddb/modules/detail detail { detailfile = "/usr/local/var/log/radacct/%{Client-IP-Address}/detail-%Y%m%d" header = "%t" detailperm = 384 dirperm = 493 locking = no log_packet_header = no } Module: Linked to module rlm_radutmp Module: Instantiating module "radutmp" from file /usr/local/etc/raddb/modules/radutmp radutmp { filename = "/usr/local/var/log/radutmp" username = "%{User-Name}" case_sensitive = yes check_with_nas = yes perm = 384 callerid = yes } Module: Linked to module rlm_attr_filter Module: Instantiating module "attr_filter.accounting_response" from file /usr/local/etc/raddb/modules/attr_filter attr_filter attr_filter.accounting_response { attrsfile = "/usr/local/etc/raddb/attrs.accounting_response" key = "%{User-Name}" relaxed = no } Module: Checking session {...} for more modules to load Module: Checking post-proxy {...} for more modules to load Module: Checking post-auth {...} for more modules to load Module: Instantiating module "attr_filter.access_reject" from file /usr/local/etc/raddb/modules/attr_filter attr_filter attr_filter.access_reject { attrsfile = "/usr/local/etc/raddb/attrs.access_reject" key = "%{User-Name}" relaxed = no } } # modules } # server server inner-tunnel { # from file /usr/local/etc/raddb/sites-enabled/inner-tunnel modules { Module: Checking authenticate {...} for more modules to load Module: Checking authorize {...} for more modules to load Module: Checking session {...} for more modules to load Module: Checking post-proxy {...} for more modules to load Module: Checking post-auth {...} for more modules to load } # modules } # server radiusd: #### Opening IP addresses and Ports #### listen { type = "auth" ipaddr = * port = 0 } listen { type = "acct" ipaddr = * port = 0 } listen { type = "auth" ipaddr = 127.0.0.1 port = 18120 } ... adding new socket proxy address * port 37323 Listening on authentication address * port 1812 Listening on accounting address * port 1813 Listening on authentication address 127.0.0.1 port 18120 as server inner-tunnel Listening on proxy address * port 1814 Ready to process requests. rad_recv: Access-Request packet from host 127.0.0.1 port 43820, id=155, length=80 User-Name = "test" User-Password = "guess" NAS-IP-Address = *Radius server IP address* NAS-Port = 0 Message-Authenticator = 0x6dd8a6e1e5e521977c075d24d7df47f2 # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default +- entering group authorize {...} ++[preprocess] returns ok ++[chap] returns noop ++[mschap] returns noop ++[digest] returns noop [suffix] No '@' in User-Name = "test", looking up realm NULL [suffix] No such realm "NULL" ++[suffix] returns noop [eap] No EAP-Message, not doing EAP ++[eap] returns noop [files] users: Matched entry DEFAULT at line 1 ++[files] returns ok [ldap] performing user authorization for test [ldap] expand: %{Stripped-User-Name} -> [ldap] ... expanding second conditional [ldap] expand: %{User-Name} -> test [ldap] expand: (sAMAccountName=%{%{Stripped-User-Name}:-%{User-Name}}) -> (sAMAccountName=test) [ldap] expand: dc=Example,dc=com -> dc=Example,dc=com [ldap] ldap_get_conn: Checking Id: 0 [ldap] ldap_get_conn: Got Id: 0 [ldap] attempting LDAP reconnection [ldap] (re)connect to LDAP server name:389, authentication 0 [ldap] bind as / to LDAP server name:389 [ldap] waiting for bind result ... [ldap] Bind was successful [ldap] performing search in dc=Example,dc=com, with filter (sAMAccountName=test) [ldap] ldap_search() failed: Operations error [ldap] search failed [ldap] ldap_release_conn: Release Id: 0 ++[ldap] returns fail Using Post-Auth-Type Reject # Executing group from file /usr/local/etc/raddb/sites-enabled/default +- entering group REJECT {...} [attr_filter.access_reject] expand: %{User-Name} -> test attr_filter: Matched entry DEFAULT at line 11 ++[attr_filter.access_reject] returns updated Delaying reject of request 0 for 1 seconds Going to the next request Waking up in 0.9 seconds. Sending delayed reject for request 0 Sending Access-Reject of id 155 to 127.0.0.1 port 43820 Waking up in 4.9 seconds. Cleaning up request 0 ID 155 with timestamp +7 Ready to process requests. Thanks -- View this message in context: http://freeradius.1045715.n5.nabble.com/FreeRadius-Active-Directory-LDAP-Aut... Sent from the FreeRadius - User mailing list archive at Nabble.com.
On Thu, Dec 8, 2011 at 3:57 AM, suggestme <samanaupadhyay@hotmail.com> wrote:
Thank you all for the suggestions.
I have already installed FreeRadius 2.1.12 which I am running, an I have got ldap in file /usr/local/etc/raddb/modules/ldap; I have gone through it and I am still not sure where the problem lies.
Have you READ the file? #=============================== # The following two configuration items are for Active Directory # compatibility. If you see the helpful "operations error" # being returned to the LDAP module, uncomment the next # two lines. # # chase_referrals = yes # rebind = yes #=============================== -- Fajar
suggestme wrote:
I have already installed FreeRadius 2.1.12 which I am running, an I have got ldap in file /usr/local/etc/raddb/modules/ldap; I have gone through it and I am still not sure where the problem lies.
The problem is you. You were told to look for "operations error" in raddb/modules/ldap. Since you say you read that file, there are only two options: 1) you found it 2) you didn't find it. If you found it, you should have followed the instructions. If you didn't find it, you should SAY you didn't find it. We tell you to read documentation which exists. So if you can't find it, there's a problem in your local installation. But... your response didn't match option (1) or (2). It's like me asking "are you running version 1 or version 2", and your response is "my cat's name is mittens" Alan DeKok.
suggestme wrote:
Hi,
After configuration and running the FreeRadius in debug mode, I see that binding with LDAP server is successful as : *[ldap] Bind was successful* Then it does searching of user with filter and gives the error as : *[ldap] ldap_search() failed: Operations error
Upgrade to 2.1.12, and read raddb/modules/ldap. Look for "operations error". Alan DeKok.
participants (4)
-
Alan DeKok -
Fajar A. Nugraha -
Phil Mayers -
suggestme