07-30-2014 03:59 AM
I am trying to use a custom LDAP attribute (389 on centos) to enable or disable VPN access. I know this could be done by OU groups but I have my reasons. I created the custom attribute (usesvpn) as a boolean and it works within LDAP. I created a group-policy access_null with 0 simultaneous connections and vpntunnel with simultaneous connections. I also created an attribute-map which I connected to the aaa-server. My issue is it don't work and even if usesvpn is FALSE the connection is still established even though the log file shows it reading the value but selecting the wrong group policy.
Thank you
Charlie
== Log File ==
7 | Jul 30 2014 | 11:30:07 | 734003 | DAP: User ******, Addr x.x.x.x : Session Attribute aaa.cisco.grouppolicy = vpntunnel |
7 | Jul 30 2014 | 11:30:07 | 734003 | DAP: User ****** , Addr x.x.x.x : Session Attribute aaa.ldap.usesvpn = FALSE |
== configurations excerpts ==
ldap attribute-map VPN_Test
map-name usesvpn Group-Policy
map-value usesvpn FALSE access_null
map-value usesvpn TRUE vpntunnel
aaa-server UKLDAP protocol ldap
aaa-server UKLDAP (ServerLan) host x.x.x.x
ldap-base-dn ou=Users,dc=mycompany,dc=local
ldap-scope subtree
ldap-login-password *****
ldap-login-dn cn=Directory Manager
ldap-attribute-map VPN_Test
07-30-2014 05:07 AM
Hi,
I believe you need to tweak the configuration little more to get this done...... map-name and policies needs to tweaked a bit to match right group policy for you while checking....
The below mentioned document will give you the better info to achieve your requirement...
http://www.cisco.com/c/en/us/support/docs/security/asa-5500-x-series-next-generation-firewalls/91831-mappingsvctovpn.html
Regards
Karthik
07-31-2014 01:58 AM
Thank you this is a helpful article and I had consulted it when setting up but I had not run the debug. Having check the article I then ran it the debug and got what looks like a successful output but my access_null doesn't seem to have an effect as I connect anyway. I attached an edited screenshot of the result. I have checked and access_ null has 0 simultaneous logins so surely I should get kicked out. Can you suggest anything else I should be looking at?
Regards
Charlie
07-31-2014 03:32 AM
Hi Charlie,
Debug clearly show that user gets "usesvpn" value as False and gets the group-policy "access-null".
In the configuration ,
07-31-2014 06:04 AM
Good Afternoon,
I tried your suggestion and set access_nul as the default and now everyone is excluded. I have run tow tests one with my user name charlie.dick that should have access and chadic who should not. Although it looks as if the correct policies are being selected but not applied.
Thanks
Charlie
The debug is as follows:
07-31-2014 06:11 AM
Hi Charlie,
I don't see any issues with attribute mapping.
Can you try removing the attribute mapping and undoing the no_access default group-policy and see if plain LDAP auth works or not.
This will rule out whether the issue is with LDAP attributes or Anyconnect VPN configuration.
Regards,
Dinesh Moudgil
08-01-2014 01:15 AM
Plain LDAP authentication works perfectly. It looks like the mapped policies are being ignored.
Regards
Charlie
08-27-2014 07:37 AM
I think I figured out the issue. In my system I had the group policy vpntunnel that allows access inheriting its values from the default group policy (3 simultaneous). This did not work, however, when I attributed a value to the group policy I was able to succeed in connecting.
It would seem if the default policy for the VPN profile is the access_nul i.e. 0 connections then the mapped group policy (vpntunnel) inherited the 0 instead of the default group policy of 3.
The policies were originally created using the GUI and the GUI defaults to inherit for simultaneous connections and I assumed that meant it had inherited from the default policy.
It make sense to me but it is not what I expected. I suspect this is a newbie error.
In any case a big thank you guys for your help in debugging this -- it has been an education.
Blessing
Charlie
08-27-2014 10:02 AM
Hi Charlie,
I am glad it is working for you.
The order of the preference for the attributes is :-
1. DAP
2. User's attributes
3. User's group-policy.
4. Tunnel-group's default group-policy.
5. Default group-policy (DfltGrpPolicy)
Since we had attribute mapping pushing the group-policy for the user , so the attribute (simultaneous login ) would be taken firstly from the ldap pushed group-policy .
If it is not present there , it would be taken from tunnel-group's default group-policy (access_nul in this case).
If that is not present there as well , then Default group-policy DfltGrpPolicy (ASAs default group-policy ) would be called upon to provide the parameter value.
Thus , we need to make sure that we define simultaneous login in the LDAP pushed group-policy to avoid issues.
HTH
Regards,
Dinesh Moudgil
07-31-2014 06:25 AM
can u cross verify in your server as well?... because the attributes are case sensitive....
Please do so with initial step by step to cross verify that...
Regards
Karthik
08-19-2014 05:37 AM
Good afternoon,
I have an update on the problem that I been having. (Back after a holiday.) I have figured out that using the ADSM gui the attribute mapping does not happen. I have used the cli to check the mapping. I am still having problems I have run both the debug and sh session commands and got the following results.
It looks like the mapping is functioning but being selecting but not applied. If I set the default group policy to nul access I can't not connect even if the mapping should be providing the vpntunnel policy. I have a question about the connection profile (tunnel Group) Lock (I don't understand this function), does this prevent a changing of policies?
Thanks for any help
Charlie
ciscoasa# debug ldap 255
[290] Session Start
[290] New request Session, context 0xad84da70, reqType = Authentication
[290] Fiber started
[290] Creating LDAP context with uri=ldap://192.168.70.132:389
[290] Connect to LDAP server: ldap://192.168.70.132:389, status = Successful
[290] supportedLDAPVersion: value = 2
[290] supportedLDAPVersion: value = 3
[290] Binding as Directory Manager
[290] Performing Simple authentication for Directory Manager to 192.168.70.132
[290] LDAP Search:
Base DN = [ou=Users,dc=company,dc=local]
Filter = [cn=chadic]
Scope = [SUBTREE]
[290] User DN = [uid=chadic,ou=Users,dc=company,dc=local]
[290] Server type for 192.168.70.132 unknown - no password policy
[290] Binding as chadic
[290] Performing Simple authentication for chadic to 192.168.70.132
[290] Processing LDAP response for user chadic
[290] Authentication successful for chadic to 192.168.70.132
[290] Retrieved User Attributes:
[290] objectClass: value = posixAccount
[290] objectClass: value = top
[290] objectClass: value = inetOrgPerson
[290] objectClass: value = organizationalPerson
[290] objectClass: value = person
[290] objectClass: value = Products
[290] gidNumber: value = 65534
[290] givenName: value = cha
[290] sn: value = cha
[290] usesvpn: value = FALSE
[290] mapped to Group-Policy: value = access_null
[290] mapped to LDAP-Class: value = access_null
[290] displayName: value = chadic
[290] uid: value = chadic
[290] homeDirectory: value = /
[290] cn: value = chadic
[290] uidNumber: value = 47115
[290] userPassword: value = {SSHA}
[290] Fiber exit Tx=327 bytes Rx=672 bytes, status=1
[290] Session End
ciscoasa# sh vpn-sessiondb detail svc
Session Type: AnyConnect Detailed
Username : chadic Index : 187
Assigned IP : 10.10.10.1 Public IP : 192.168.70.77
Protocol : AnyConnect-Parent SSL-Tunnel
License : AnyConnect Premium
Encryption : RC4 Hashing : SHA1
Bytes Tx : 114081 Bytes Rx : 86323
Pkts Tx : 384 Pkts Rx : 480
Pkts Tx Drop : 0 Pkts Rx Drop : 0
Group Policy : vpntunnel Tunnel Group : vpntunnel
Login Time : 11:37:55 GMT/BDT Tue Aug 19 2014
Duration : 0h:00m:48s
Inactivity : 0h:00m:00s
NAC Result : Unknown
VLAN Mapping : N/A VLAN : none
AnyConnect-Parent Tunnels: 1
SSL-Tunnel Tunnels: 1
AnyConnect-Parent:
Tunnel ID : 187.1
Public IP : 192.168.70.77
Encryption : RC4 Hashing : SHA1
Encapsulation: TLSv1.0 TCP Dst Port : 443
Auth Mode : userPassword
Idle Time Out: 30 Minutes Idle TO Left : 29 Minutes
Client Type : AnyConnect
Client Ver : AnyConnect Windows 3.1.00495
Bytes Tx : 23262 Bytes Rx : 5915
Pkts Tx : 28 Pkts Rx : 11
Pkts Tx Drop : 0 Pkts Rx Drop : 0
SSL-Tunnel:
Tunnel ID : 187.2
Assigned IP : 10.10.10.1 Public IP : 192.168.70.77
Encryption : RC4 Hashing : SHA1
Encapsulation: TLSv1.0 TCP Src Port : 13705
TCP Dst Port : 443 Auth Mode : userPassword
Idle Time Out: 30 Minutes Idle TO Left : 30 Minutes
Client Type : SSL VPN Client
Client Ver : Cisco AnyConnect VPN Agent for Windows 3.1.00495
Bytes Tx : 90130 Bytes Rx : 81008
Pkts Tx : 356 Pkts Rx : 475
Pkts Tx Drop : 0 Pkts Rx Drop : 0
NAC:
Reval Int (T): 0 Seconds Reval Left(T): 0 Seconds
SQ Int (T) : 0 Seconds EoU Age(T) : 53 Seconds
Hold Left (T): 0 Seconds Posture Token:
Redirect URL :
08-19-2014 05:57 AM
Hi,
The tunnel-group lock allows you to push the connection to specific tunnel-group rather thatn group-policy based on AD database.
Please refer this document for more clarification.
Regards,
Dinesh Moudgil
P.S. Please rate helpful posts.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide