{"id":182,"date":"2015-06-23T06:51:33","date_gmt":"2015-06-23T06:51:33","guid":{"rendered":"http:\/\/www.balajibandi.com\/blog\/?p=182"},"modified":"2024-02-04T19:52:17","modified_gmt":"2024-02-04T19:52:17","slug":"using-the-cisco-routers-local-database-to-apply-different-policies-for-cisco-ios-anyconnect-users-part-2","status":"publish","type":"post","link":"https:\/\/www.balajibandi.com\/?p=182","title":{"rendered":"Using the Cisco Router\u2019s Local Database to Apply Different Policies for Cisco IOS AnyConnect Users (part 2)"},"content":{"rendered":"<p>In the last article about this topic, we covered one of the ways to apply different policies to AnyConnect VPN users using the Cisco router\u2019s local database. In that article, we saw that even though the IOS WebVPN group lock feature is meant to tie a user to a particular context, this indirectly means that the policy configured under that context gets applied to the user.<\/p>\n<p>One of the reasons I don\u2019t like that method is that users need to know which context they will be connecting to beforehand. This may not necessarily be a problem if hostnames are used to connect but, still, it seems a bit a tacky. This brings us to the second solution.<\/p>\n<p><strong>AAA Attribute Lists<\/strong><\/p>\n<p>Under a WebVPN context, one can configure several policies even though a context can have only one default group policy applied. While researching this topic, I discovered from a Cisco white paper that the attribute <em>webvpn:user-vpn-group<\/em> can be returned by a RADIUS server to assign different policies to VPN users. However, I needed a way to achieve this locally.<\/p>\n<p>I recently started using AAA attribute lists extensively on the Cisco IOS and it has come in really handy in many instances. This feature basically turns a Cisco router into a local AAA server with many (if not all?) of the attributes that you can configure on an external AAA (e.g. RADIUS) server. Luckily for me (and you reading this article), \u201cuser-vpn-group\u201d is one of the attributes available under AAA attribute lists.<\/p>\n<p>Let me use the same network we had in the last article to show you how this can be configured:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1rtdn21e2k8w27koup1eiasxspe.wpengine.netdna-cdn.com\/wp-content\/uploads\/061915_0926_UsingtheCis1.png\" alt=\"\" data-lazy-loaded=\"true\" \/><\/p>\n<p>We will configure a single WebVPN context, but with three different policies:<\/p>\n<ol>\n<li>\u201cSales_Policy,\u201d which will allow HTTP access to 192.168.10.100<\/li>\n<li>\u201cAdministrator_Policy,\u201d which will allow unrestricted access.<\/li>\n<li>\u201cNo_Access,\u201d which will be the default policy applied to any user who isn\u2019t assigned a policy. All traffic will be denied.<\/li>\n<\/ol>\n<p>The configuration on the router is as follows:<\/p>\n<div class=\"EnlighterJSWrapper gitEnlighterJSWrapper\">\n<ol class=\"gitEnlighterJS EnlighterJS\">\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">aaa new-model<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">aaa authentication login webvpn local<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">interface FastEthernet0\/0<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> ip address 41.1.1.2 255.255.255.0<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">interface FastEthernet0\/1<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> ip address 192.168.10.1 255.255.255.0<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">interface Virtual-Template1<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> ip unnumbered FastEthernet0\/1<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">ip local pool ANYCONNECT_POOL 192.168.10.51 192.168.10.60<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">ip http server<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">ip http secure-server<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">ip access-list standard SPLIT_ACL<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> permit 192.168.10.0 0.0.0.255<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">ip access-list extended Administrator_ACL<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> permit ip any any<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">ip access-list extended Sales_ACL<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> permit tcp any host 192.168.10.100 eq 80<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">webvpn gateway AnyConnect_RTR<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> ip address 41.1.1.2 port 443<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> ssl trustpoint TP-self-signed-4279256517<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> inservice<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> !<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">webvpn install svc disk0:\/webvpn\/anyconnect-linux-3.1.08009-k9.pkg sequence 1<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> !<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">webvpn context Anyconnect<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> ssl authenticate verify all<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> !<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> policy group Sales_Policy<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> functions svc-enabled<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> filter tunnel Sales_ACL<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> svc address-pool &#8220;ANYCONNECT_POOL&#8221;<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> svc keep-client-installed<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> svc split include 192.168.10.0 255.255.255.0<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> !<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">policy group Administrator_Policy<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> functions svc-enabled<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> filter tunnel Administrator_ACL<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> svc address-pool &#8220;ANYCONNECT_POOL&#8221;<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> svc keep-client-installed<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> svc split include 192.168.10.0 255.255.255.0<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">policy group No_Access<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> functions svc-enabled<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> hide-url-bar<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> banner \u201cAccess Denied!\u201d<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> virtual-template 1<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> default-group-policy No_Access<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> aaa authentication list webvpn<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> gateway AnyConnect_RTR<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> inservice<\/span><\/li>\n<\/ol>\n<\/div>\n<p>Notice that this configuration is just the normal IOS WebVPN\/SSL VPN configuration except that we have defined multiple policies under the WebVPN context.<\/p>\n<p>Now what we need to do is make sure users get assigned the right policy when they connect and this is where we configure AAA attribute lists. These attributes are applied in the authorization phase so we must also configure an AAA authorization method to be applied to the WebVPN context.<\/p>\n<div class=\"EnlighterJSWrapper gitEnlighterJSWrapper\">\n<ol class=\"gitEnlighterJS EnlighterJS\">\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">aaa authorization network webvpn local<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">aaa attribute list Sales_AAA_List<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> attribute type user-vpn-group &#8220;Sales_Policy&#8221;<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">aaa attribute list Administrator_AAA_List<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\"> attribute type user-vpn-group &#8220;Administrator_Policy&#8221;<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">username user1 secret cisco<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">username user1 aaa attribute list Sales_AAA_List<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">username user2 secret cisco<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">username user2 aaa attribute list Administrator_AAA_List<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">username user3 secret cisco<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\">!<\/span><\/li>\n<li class=\"even hoverEnabled\"><span class=\"unknown\">webvpn context Anyconnect<\/span><\/li>\n<li class=\"odd hoverEnabled\"><span class=\"unknown\"> aaa authorization list webvpn<\/span><\/li>\n<\/ol>\n<\/div>\n<p>As you can see, I have created three users: user1 has the AAA attribute list \u201cSales_AAA_List\u201d attached; user2 has the AAA attribute list \u201cAdministrator_AAA_List\u201d attached; and user2 does not have any attribute list attached.<\/p>\n<p>Let\u2019s test this configuration. We will start with user1, who should be assigned the \u201cSales_Policy.\u201d<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1rtdn21e2k8w27koup1eiasxspe.wpengine.netdna-cdn.com\/wp-content\/uploads\/061915_0926_UsingtheCis2.png\" alt=\"\" data-lazy-loaded=\"true\" \/><\/p>\n<p>We can use the \u201c<strong><em>show webvpn session user &lt;username&gt; context &lt;context&gt;<\/em><\/strong>\u201d command to view information about the connected user\u2019s session.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1rtdn21e2k8w27koup1eiasxspe.wpengine.netdna-cdn.com\/wp-content\/uploads\/061915_0926_UsingtheCis3.png\" alt=\"\" data-lazy-loaded=\"true\" \/><\/p>\n<p>As you can see, even though the default group policy under the WebVPN context is \u201cNo_Access,\u201d user1 was successfully assigned the \u201cSales_Policy\u201d group policy, meaning that our AAA attribute list works.<\/p>\n<p>Let\u2019s test user2 now.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1rtdn21e2k8w27koup1eiasxspe.wpengine.netdna-cdn.com\/wp-content\/uploads\/061915_0926_UsingtheCis4.png\" alt=\"\" data-lazy-loaded=\"true\" \/><\/p>\n<p>We can also check the WebVPN session for user2.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1rtdn21e2k8w27koup1eiasxspe.wpengine.netdna-cdn.com\/wp-content\/uploads\/061915_0926_UsingtheCis5.png\" alt=\"\" data-lazy-loaded=\"true\" \/><\/p>\n<p>Finally, let\u2019s test user3. Since this user has no AAA attribute list attached to it (meaning no user-vpn-group), it will use the default group policy under the WebVPN context. In summary, no access will be given and a banner will be displayed saying \u201cAccess Denied.\u201d<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1rtdn21e2k8w27koup1eiasxspe.wpengine.netdna-cdn.com\/wp-content\/uploads\/061915_0926_UsingtheCis6.png\" alt=\"\" data-lazy-loaded=\"true\" \/><\/p>\n<p>After I click \u201cConnect\u201d, the banner we configured is displayed:<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1rtdn21e2k8w27koup1eiasxspe.wpengine.netdna-cdn.com\/wp-content\/uploads\/061915_0926_UsingtheCis7.png\" alt=\"\" data-lazy-loaded=\"true\" \/><\/p>\n<p>If I click on \u201cAccept\u201d, the tunnel still attempts to be formed but, since I did not attach any IP address pool to that policy, the VPN session is not established.<\/p>\n<p><strong>Note<\/strong>: If user3 connects to the WebVPN service using a web browser, the \u201chide-url-bar\u201d (and no configured URL lists) will make sure that user cannot connect to any IP address<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1rtdn21e2k8w27koup1eiasxspe.wpengine.netdna-cdn.com\/wp-content\/uploads\/061915_0926_UsingtheCis8.png\" alt=\"\" data-lazy-loaded=\"true\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/1rtdn21e2k8w27koup1eiasxspe.wpengine.netdna-cdn.com\/wp-content\/uploads\/061915_0926_UsingtheCis9.png\" alt=\"\" data-lazy-loaded=\"true\" \/><\/p>\n<p><strong>Summary<\/strong><\/p>\n<p>This brings us to the end of this 2-part article on using the local database on a Cisco router to apply different policies to WebVPN\/AnyConnect VPN users. In the first part of this article, we used the Cisco IOS WebVPN group lock feature, which basically means we attach users to different WebVPN contexts and the policy configured under those WebVPN contexts will be applied to the user.<\/p>\n<p>In this article, we configured different policies under a single WebVPN context and then used AAA attribute lists to attach these group policies to different users.<\/p>\n<p>I hope you have found this article helpful.<\/p>\n<p><strong>References and Further Reading<\/strong><\/p>\n<ul>\n<li>ASA and Cisco IOS Group-lock Features and AAA Attributes and WebVPN Configuration Example:http:\/\/www.cisco.com\/c\/en\/us\/support\/docs\/security\/ios-easy-vpn\/117634-configure-asa-00.html<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In the last article about this topic, we covered one of the ways to apply different policies to AnyConnect VPN users using the Cisco router\u2019s local database. In that article, we saw that even though the IOS WebVPN group lock feature is meant to tie a user to a particular context, this indirectly means that [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,2],"tags":[],"class_list":["post-182","post","type-post","status-publish","format-standard","hentry","category-ccie-sec","category-cisco"],"_links":{"self":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/182","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=182"}],"version-history":[{"count":2,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":2065,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions\/2065"}],"wp:attachment":[{"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.balajibandi.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}