<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jimmys Cyber Corner &#187; Cisco ASA</title>
	<atom:link href="http://blogg.kvistofta.nu/category/english/security/cisco-asa/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogg.kvistofta.nu</link>
	<description>A Cisco Security-guy exploring the world</description>
	<lastBuildDate>Wed, 21 Jul 2010 19:49:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>What about wiping your firewall for breakfast?</title>
		<link>http://blogg.kvistofta.nu/what-about-wiping-your-firewall-for-breakfast/</link>
		<comments>http://blogg.kvistofta.nu/what-about-wiping-your-firewall-for-breakfast/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 08:33:14 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=1085</guid>
		<description><![CDATA[You know how it is? You are typing so fast making changes in you cisco gear you not always pay attention to which mode you are in? Doing config-command in exec-level, exec-commands in config-level and adding &#8220;do&#8221; in front just to make them pass? Wanna know if that happens to fast and you are in [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>You know how it is? You are typing so fast making changes in you cisco gear you not always pay attention to which mode you are in? Doing config-command in exec-level, exec-commands in config-level and adding &#8220;do&#8221; in front just to make them pass? Wanna know if that happens to fast and you are in the wrong place doing the wrong time?</p>
<p>Below I am in system context of a multi context ASA firewall. My intention is to do something with a context. I go into config mode and then into the context definition of the context I wanna change. What if I get interrupted or whatever and enter the &#8220;conf t&#8221;-command in the context configuration mode?</p>
<p><code><br />
act# sh mode<br />
Security context mode: multiple<br />
act#<br />
act# conf t<br />
act(config)# context LEFT<br />
act(config-ctx)# conf t<br />
INFO: Converting t to disk0:/t<br />
.<br />
WARNING: Could not fetch the URL disk0:/t<br />
INFO: Creating context with default config<br />
INFO: Admin context will take some time to come up .... please wait.<br />
act(config-ctx)#<br />
</code></p>
<p>Congrats! Your firewall is gone!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/what-about-wiping-your-firewall-for-breakfast/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doing some magic translations in Cisco ASA</title>
		<link>http://blogg.kvistofta.nu/doing-some-magic-translations-in-cisco-asa/</link>
		<comments>http://blogg.kvistofta.nu/doing-some-magic-translations-in-cisco-asa/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 18:59:01 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=1117</guid>
		<description><![CDATA[I recently got a question from a collegue regarding address translations in Cisco ASA. He wrote: Got a question from a customer if you can do the following: 1. NAT the . IP address of a machine located on the DMZ to inside with the same address as the NAT has been: at the outside [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently got a question from a collegue regarding address translations in Cisco ASA. He wrote:</p>
<p><i><br />
Got a question from a customer if you can do the following:</p>
<p>1. NAT the . IP address of a machine located on the DMZ to inside with the same address as the NAT has been: at the outside (ie publish public address inwards too)</p>
<p>2. Source NAT for inside addresses (clients) when they must go above the DMZ server (in the &#8220;public&#8221; address) so that the source is a different puclic address.</p>
<p>Have not tested yet so I do not know but the config must be abit weird. <img src='http://blogg.kvistofta.nu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p></i></p>
<p>ok. Lets try. I put together a quick lab-setup. A 3-legged ASA with a one-legged router on each firewall-interface:</p>
<p><code><br />
interface Vlan10<br />
 nameif outside<br />
 security-level 0<br />
 ip address 200.1.1.1 255.255.255.0<br />
!<br />
interface Vlan20<br />
 nameif inside<br />
 security-level 100<br />
 ip address 10.1.1.1 255.255.255.0<br />
!<br />
interface Vlan30<br />
 no forward interface Vlan20<br />
 nameif dmz<br />
 security-level 50<br />
 ip address 10.2.2.1 255.255.255.0<br />
!<br />
</code></p>
<p>And the routers.</p>
<p>R1:<br />
<code><br />
interface FastEthernet0<br />
 ip address 200.1.1.99 255.255.255.0<br />
 duplex auto<br />
 speed auto<br />
end<br />
</code></p>
<p>R2:<br />
<code><br />
interface FastEthernet0<br />
 ip address 10.1.1.99 255.255.255.0<br />
 duplex auto<br />
 speed auto<br />
end<br />
</code></p>
<p>and R3:<br />
<code><br />
interface FastEthernet0<br />
 ip address 10.2.2.2 255.255.255.0<br />
 duplex auto<br />
 speed auto<br />
end<br />
</code></p>
<p>Ok. R1 is the outside host on internet. R2 is an inside host on our corporate network. R3 is this magical server on DMZ. In this example it is a high performance telnet server!</p>
<p><code><br />
line vty 0 4<br />
 no login<br />
</code></p>
<p>First, make sure that this is reachable from internet. We do a static and allow the traffic on outside acl:</p>
<p><code><br />
static (dmz,outside) 200.1.1.2 10.2.2.2 netmask 255.255.255.255<br />
access-list OUTSIDE extended permit tcp any host 200.1.1.2 eq telnet<br />
</code></p>
<p>Verification. Telnet from R1 to public IP:<br />
<code><br />
R1#telnet 200.1.1.2<br />
Trying 200.1.1.2 ... Open<br />
R3><br />
</code></p>
<p>Great. Now we want to reach the DMZ server from inside. Since this is higher security level to lower and we dont have any acl on inside we dont have to care about open the traffic. But we want to use an OUTSIDE address as destination ip to reach a DMZ host. Lets try a static:</p>
<p><code><br />
FW(config)# static (dmz,inside) 200.1.1.2 10.2.2.2<br />
</code></p>
<p>The command above seems weird, right? I agree. Someday when I have a lot of time I will explain the theory but for now, just trust me!</p>
<p>Verification:<br />
<code><br />
R2#telnet 200.1.1.2<br />
Trying 200.1.1.2 ... Open<br />
R3><br />
</code></p>
<p>Next step is to hide the source address of that telnet client on inside. Right now it is using its own source ip:<br />
<code><br />
R3>en<br />
Password:<br />
R3#<br />
R3#sh users<br />
    Line       User       Host(s)              Idle       Location<br />
   0 con 0                idle                 00:08:09<br />
*  6 vty 0                idle                 00:00:00 10.1.1.99</p>
<p>  Interface    User               Mode         Idle     Peer Address</p>
<p>R3#<br />
</code></p>
<p>So, how do we accomplish that? The easiest way is to use a policy nat-statement. We create an access-list which defines which traffic to translate. We then create a nat-statement with a nat-id of your choice and call the access-list. Finaly we define which global ip to use. (outside. Remember dmz is outside relative to inside since dmz has lower security-level)<br />
<code><br />
access-list Inside2DMZ extended permit tcp 10.1.1.0 255.255.255.0 host 200.1.1.2 eq telnet<br />
nat (inside) 1 access-list Inside2DMZ<br />
global (dmz) 1 200.1.1.10<br />
</code></p>
<p>Verification:<br />
<code><br />
R2#telnet 200.1.1.2<br />
Trying 200.1.1.2 ... Open</p>
<p>R3>sh users<br />
    Line       User       Host(s)              Idle       Location<br />
*  6 vty 0                idle                 00:00:00 200.1.1.10</p>
<p>  Interface    User               Mode         Idle     Peer Address</p>
<p>R3></code></p>
<p>Voila! So, the client is on a private ip network 10.1.1.0 and establish a connection to what he think is on outside, because it is an public/outside ip. The traffic passes the magic ASA and the server on DMZ believes that the client is on internet since it has a public/outside source ip.</p>
<p><a href="http://www.gliffy.com/pubdoc/2075293/L.png"><img src="http://www.gliffy.com/pubdoc/2075293/S.png" alt="Topology" /></a></p>
<p>Mission accomplished.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/doing-some-magic-translations-in-cisco-asa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lab notes &#8211; WB1 Lab4 Part 1</title>
		<link>http://blogg.kvistofta.nu/lab-notes-wb1-lab4-part-1/</link>
		<comments>http://blogg.kvistofta.nu/lab-notes-wb1-lab4-part-1/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 13:46:22 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[CCIE Security Lab]]></category>
		<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[Cisco IOS]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=829</guid>
		<description><![CDATA[Today I started to work with IPExpert CCIE Security workbook 1 Lab 4a &#8211; VPN-solutions. During my work I made the following notes which might be interresting to read for other CCIE-candidates. I will also from now on continue to do these notes and post them on this blog. Explaining and writing is simply a [...]]]></description>
			<content:encoded><![CDATA[<p></p><div id="_mcePaste">Today I started to work with <a href="http://www.ipexpert.com/Cisco/CCIE/Security/Workbook/Technology-Focused-Security-Lab-Workbook">IPExpert CCIE Security workbook 1</a> Lab 4a &#8211; VPN-solutions. During my work I made the following notes which might be interresting to read for other CCIE-candidates. I will also from now on continue to do these notes and post them on this blog. Explaining and writing is simply a great way for me to learn.</div>
<div>Also, if my boss some day ask me what the heck I am doing all these work-hours, I will gladly give him a link to this blog. <img src='http://blogg.kvistofta.nu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </div>
<h3>Task 4.1 &#8211; IOS CA</h3>
<div>This was quite straight-forward. Make an IOS become a root certificate authority for later use.</div>
<div id="_mcePaste">
<ul>
<li>What confuses me is that there is nothing in the configuation telling it to authenticate with certificates. All there is compared to &#8220;normal&#8221; preshared-key-auth is a missing &#8220;authen pre-share&#8221;. Which ofcours means that authentication is done with the certificates by default. I understand, I just have to get used to the fact that there is no command visible in the crypto isakmp policy saying &#8220;authentication MY-CA-TRUSTPOINT&#8221;.</li>
<li> When entering a wrong peer in the crypto map, it´s not just enough to re-enter a new ip. Since a crypto map sequence can have multiple peers for redundancy the old one doesnt go away. The effect is that the tunnel goes up, after a while, since it first tries with the bad peer ip before trying the second one. Remove the first.</li>
<li>Me being more used to vpns in asa than in ios usually tear down vpn-tunnels with the commands &#8220;clear crypto isakmp sa&#8221; and &#8220;clear crypto ipsec sa&#8221;. In IOS the corresponding command is &#8220;clear crypto session&#8221;. Cool.</li>
</ul>
</div>
<h3>Task 4.2 &#8211; IOS L2L</h3>
<p>This is all about enrollment of certificates from the CA in previous task to two IOS-routers and setup an ipsec-tunnel.</p>
<ul>
<li> What confuses me is that there is nothing in the configuation telling it to authenticate with certificates. All there is compared to &#8220;normal&#8221; preshared-key-auth is a missing &#8220;authen pre-share&#8221;. Which ofcours means that authentication is done with the certificates by default. I understand, I just have to get used to the fact that there is no command visible in the crypto isakmp policy saying &#8220;authentication MY-CA-TRUSTPOINT&#8221;.</li>
<li>When entering a wrong peer in the crypto map, it´s not just enough to re-enter a new ip. Since a crypto map sequence can have multiple peers for redundancy the old one doesnt go away. The effect is that the tunnel goes up, after a while, since it first tries with the bad peer ip before trying the second one. Remove the first.</li>
<li>Me being more used to vpns in asa than in ios usually tear down vpn-tunnels with the commands &#8220;clear crypto isakmp sa&#8221; and &#8220;clear crypto ipsec sa&#8221;. In IOS the corresponding command is &#8220;clear crypto session&#8221;. Cool.</li>
</ul>
<h3>Task 4.3 &#8211; VPN IOS-ASA</h3>
<p>The task was to setup a tunnel between IOS and ASA. Preshared-key, all straight-forward. However, I was asked to prioritize to certan traffic going into the tunnel from the IOS-router. This was done by creating a service-policy on outside-interface like this:</p>
<p><code><br />
class-map match-all VPN-CLASS</code></p>
<p><code> </code></p>
<p><code>match access-group 150  ! The ACL that defines the traffic to prioritize</code></p>
<p><code>policy-map VPN-POLICY</code></p>
<p><code>class VPNCLASS</p>
<p>priority 200 (I was also assign to restrict the prioritized traffic to 200kbps)</p>
<p>interface Fa1/1</p>
<p></code></p>
<p><code>service-policy output VPN-POLICY<br />
</code></p>
<ul>
<li>And, dont forget to do &#8220;qos pre-classify&#8221; on the crypto map! Otherwise your class-map has to look for ESP-traffic and that is not very granular, is it? <img src='http://blogg.kvistofta.nu/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
<li>&#8220;create lo3 on r2, assign it ip 192.168.3.2/24&#8243; and &#8220;create a vpn tunnel between Vlan100 and the newly created loopback network&#8221;. I used &#8220;host 192.168.3.2&#8243; in acl, but it clearly states &#8220;the loopback _network_&#8221;. Darn!</li>
</ul>
<h3>Task 4.4 L2L Aggressive mode with PSK</h3>
<div id="_mcePaste">
<ul>
<li>Stuck Twice.</li>
</ul>
</div>
<div>I PROMISE NEVER TO FORGET TO APPLY THE CRYPTO MAP TO THE INTERFACE AGAIN</div>
<div id="_mcePaste">I PROMISE NOT TO FORGET TO APPLY THE CRYPTO MAP TO IF AGAIN</div>
<div id="_mcePaste">I PROMISE NOTTO FORGET TO APPLY THE CRYPTO MAP TO IF AGAIN</div>
<div id="_mcePaste">
<ul>
<li>Stuck again. Couldn´t get the tunnel up even when comparing my configs with the solution guide. After getting help from <a href="http://www.mail-archive.com/ccie_security@onlinestudylist.com/">OSL </a>I made it:</li>
</ul>
</div>
<p><span style="font-family: arial, sans-serif; line-height: normal; border-collapse: collapse; color: #333333;"><em>Hi</em></span></p>
<div><em><br />
</em></div>
<div><em>I am struggling with this task, I simply cannot get the tunnel up. And I cant see what Ive done wrong. </em></div>
<div><em><br />
</em></div>
<div><em>Background: Make a tunnle between r2 and r5. Assume that r5-ip is dynamic, the tunnel should only be initiated from r5. (that is: dynamic map on r2).</em></div>
<div><em><br />
</em></div>
<div><span style="font-family: arial, sans-serif; line-height: normal; border-collapse: collapse; color: #333333;"><em>The relevant parts of the config looks like this:</em></span></div>
<div><span style="font-family: arial, sans-serif; color: #333333;"><span style="border-collapse: collapse; line-height: normal;"><em><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; color: #000000;"><span style="border-collapse: separate; font-style: normal; line-height: 19px;"><br />
</span></span></em></span></span></div>
<div>Answer from Brandon:</div>
<p><span style="font-family: arial, sans-serif; line-height: normal; border-collapse: collapse; color: #333333;">Not sure if this is it or not but you have crypto isakmp key ipexpert<br />
hostname <a style="color: #364452;" href="http://r5.ipexpert.com/" class="broken_link"  target="_blank">r5.ipexpert.com</a> and the debug shows    FQDN name    : <a style="color: #364452;" href="http://r5.ipexpert.com/" class="broken_link"  target="_blank">R5.ipexpert.com</a></span></p>
<div>Voila! Changed the &#8220;r5&#8243; to &#8220;R5&#8243; and it started working!</div>
<h3>Task 4.5 L2L Overlapping subnets.</h3>
<div id="_mcePaste">The task was to create a tunnel between 4 routers to protect traffic between internal nets. The restrictions was: no static routing, no crypto maps and no GRE.</div>
<div id="_mcePaste">
<ul>
<li>I havent worked  very much with tunnel-interfaces but this was a pleasant first date. It´s kind of magic making a virtual interface and make the router route traffic thru it. Even more coolish when you encrypt the traffic and make a routing protocol talk thru the tunnel.</li>
<li>Since I wasn´t allowed to use static routing I had to create loopback-interfaces to force knowledge of that local networks translated address-space into the routing-protocol. I was thinking of some kind of &#8220;add-reverse-route&#8221;-option for the &#8220;ip nat source static network&#8221;-command but I guess there is no such solution? Or could this routing-issue be solved in another way?</li>
</ul>
</div>
<h3>Task 4.6 &#8211; Easy VPN Server on IOS</h3>
<div id="_mcePaste">
<ul>
<li>This task deals with connecting a plain ipsec-client from XP workstation to an VPN-server on ios. First step was to verify connectivity on XP. Wrong IP, changing it. Now, a good advice from someone &#8220;who knows&#8221;: Do NOT add a default route on the student NIC of the <a href="http://proctorlabs.com/PDF/sec_bp3_top.pdf">labb </a>pc:s. It has 2 nics and the other one is convinently named &#8220;Outside NIC &#8211; Do not Touch!&#8221; which is fine because thats how you reach the machine over internet. But if you add a default &#8220;gateway&#8221; on the student nic (which you are allowed to fool with) you will convert that kind little XP-machine into an unpredicible beast. If you are lucky u will reach it after a while and remove that default gw. So I´ve heard. <img src='http://blogg.kvistofta.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>IOS auto-enroll and the enroll-feature of ipsec vpn client is cool. Just point it to http://&lt;ios ca ip&gt;/cgi-bin/pkiclient.exe and request a certificate.</li>
<li> I had to look at the solution guide quite alot in this case. Even when doing that I couldnt get the vpn-client to connect. I just got these error messages:</li>
</ul>
</div>
<p><code> </code></p>
<p><code></p>
<div id="_mcePaste">Feb 26 12:35:24.740: ISAKMP:(1011):deleting SA reason "Recevied fatal informational" state (R) CONF_XAUTH    (peer 8.9.2.200)</div>
<div id="_mcePaste">Feb 26 12:35:24.740: ISAKMP:(1011):deleting SA reason "Recevied fatal informational" state (R) CONF_XAUTH    (peer 8.9.2.200)</div>
<p></code></p>
<div>
<ul>
<li>Suddenly I looked at the bottom right corner of my screen and saw tht the time was 3 minutes until the lab-period was over. I have never backed up a bunch of routers this fast before. First thing next lab-attempt will be to load the configs and troubleshoot the EasyVPN-config of R4.</li>
</ul>
</div>
<div>Conclusion of this lab so far: It´s intense! I´ve been configuring plenty of VPN-solutions before, but I guess that my experience covers only 20-30% of the VPN-related topics in this lab. All these profiles-configurations in IOS are all new to me. I guess I have some CCO-chapters to read during the weekend&#8230;</div>
<div>Here are my current configurations: <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/asa1.txt" target="_blank">asa1</a>, <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/r2.txt" target="_blank">r2</a>, <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/r4.txt" target="_blank">r4</a>, <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/r5.txt" target="_blank">r5 </a>and <a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/r6.txt" target="_blank">r6</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/lab-notes-wb1-lab4-part-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cisco Ipsec VPN-client for 64-bit windows-OS after all?</title>
		<link>http://blogg.kvistofta.nu/cisco-ipsec-vpn-client-for-64-bit-windows-os-after-all/</link>
		<comments>http://blogg.kvistofta.nu/cisco-ipsec-vpn-client-for-64-bit-windows-os-after-all/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 19:44:23 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=819</guid>
		<description><![CDATA[It seems that Cisco has changed their mind. For long it has been told that one major step for Cisco to promote use of the new SSL Anyconnect VPN-client was to not release a traditional Ipsec VPN-client for 64-bits Windows. Cisco have received lots of critics for this, primary because Anyconnect-usage is a licensed feature [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>It seems that Cisco has changed their mind. For long it has been told that one major step for Cisco to promote use of the new SSL Anyconnect VPN-client was to not release a traditional Ipsec VPN-client for 64-bits Windows. Cisco have received lots of critics for this, primary because Anyconnect-usage is a licensed feature in ASA Firewall in contradiction to the free ipsec-vpn-client-usage.</p>
<p>This peek into the <a href="http://tools.cisco.com/support/downloads/go/ImageList.x?relVer=5.0.7+Beta&amp;mdfid=281940730&amp;sftType=VPN+Client+Software&amp;optPlat=Windows&amp;nodecount=6&amp;edesignator=null&amp;modelName=Cisco+VPN+Client+v5.x&amp;treeMdfId=268438162&amp;modifmdfid=&amp;imname=&amp;treeName=Security&amp;hybrid=&amp;imst=">download area</a> for VPN-clients seems to change the way we look at it. Still a beta, but anyway&#8230;</p>
<p><a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/vpn.png"><img class="alignnone size-full wp-image-820" title="vpn" src="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/vpn.png" alt="" width="619" height="89" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/cisco-ipsec-vpn-client-for-64-bit-windows-os-after-all/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cisco ASA &#8220;active/active&#8221; failover</title>
		<link>http://blogg.kvistofta.nu/cisco-asa-activeactive-failover/</link>
		<comments>http://blogg.kvistofta.nu/cisco-asa-activeactive-failover/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 21:21:08 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=788</guid>
		<description><![CDATA[I often get into discussions with customers about the active/active feature of Cisco firewalls (ASA/FWSM). There seems to be a lot of confusions regarding the possible redundancy scenarios. The short story first: The only scenario when active/active can be done is when you have 2 physical units and at least 2 virtual firewalls (contexts) configured. [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I often get into discussions with customers about the active/active feature of Cisco firewalls (ASA/FWSM). There seems to be a lot of confusions regarding the possible redundancy scenarios.</p>
<p>The short story first: The only scenario when active/active can be done is when you have 2 physical units and at least 2 virtual firewalls (contexts) configured.</p>
<p>But we start from the beginning&#8230;</p>
<h3>Single Box &#8211; Single Context</h3>
<p>The most common solution for small companies is having one single firewall without any redundancy. There is not much to say about it&#8230;</p>
<p><a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/single-unit-single-context.jpg"><img class="alignnone size-full wp-image-789" title="single unit single context" src="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/single-unit-single-context.jpg" alt="" width="375" height="231" /></a></p>
<h3>Dual boxes &#8211; Single Contexts</h3>
<p><span style="background-color: #ffffff;">By adding another box you get a <strong>active/passive</strong>-failover, also known as <strong>hot standby</strong>. The primary box is doing all the work and the secondary just waits to stand in in case of a failure of the primary. There is <strong>no load-sharing</strong>.</span></p>
<p><span style="background-color: #ffffff;">The usage for this is an organisation that has no need for multiple contexts but wants their firewall to be redundant.</span></p>
<p><a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/dual-units-single-context.jpg"><img class="alignnone size-full wp-image-790" title="dual units single context" src="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/dual-units-single-context.jpg" alt="" width="526" height="163" /></a></p>
<h3>Single Box &#8211; Multiple Contexts</h3>
<p>If there is need for multiple context, the firewall can be configured so. Two (or more) different configurations can share the same physical hardware. They can also share interfaces with some exemptions. Each context can have different administrative profiles configured so that a specific person can configure only one context.</p>
<p><a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/single-unit-multiple-contexts.jpg"><img class="alignnone size-full wp-image-791" title="single unit multiple=" alt="" width="376" height="226" /></a></p>
<p>Example: Company A and Company B shares a common firewall. Each company has their specific security policies and are each administered separately.</p>
<h3>Dual boxes &#8211; Multiple Contexts</h3>
<p>By extending the previos scenario with duplicated hardware one can get a redundant solution. With both contexts active on the left hardware this unit will handle all traffic for both of them. In case of a hardware-failure both contexts will become active on the other unit.</p>
<p><a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/dual-units-multiple-contexts.jpg"><img class="alignnone size-full wp-image-792" title="dual units multiple=" alt="" width="539" height="162" /></a></p>
<p>Example: The need for high-available firewall-functionality made the company AB to invest in redundant firewalls. They need to have multiple security policies administered by each companys respective IT-department. It all runs in Unit 1, while Unit 2 is configured as a hot-spare.</p>
<h3>Dual boxes &#8211; Multiple Contexts balanced</h3>
<p>If one context is active in one hardware and another context in the other one you will get a load-balanced-ish solution. Normal case is that the left unit handles Department A context and the right unit takes care of all traffic for Department B. In case of a hardware failure on either unit, the context(s) that were active in the failed unit &#8220;moves&#8221; to the other hardware.</p>
<p><a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/dual-units-multiple-contexts-balanced.jpg"><img class="alignnone size-full wp-image-793" title="dual units multiple=" alt="" width="533" height="158" /></a></p>
<p>Scenario: To gain performance company AB have distributed the placement of each contexts active unit. The left unit takes care of Department A:s context and the left one handles the context of Department B. Each unit is hot-spare for respective context.</p>
<h3>Important notes:</h3>
<ul>
<li>The only case when &#8220;active/active&#8221; can be built is when you have multiple contexts.</li>
<li>There is no load-sharing done &#8220;within&#8221; a context. That means that if traffic going thru the green context it will suck all resources out of the left unit without any &#8220;help&#8221; from the right unit.</li>
<li>These multiple-contexts-scenarios also applies to when having more than two contexts. For example, if there are 5 contexts, 0, 1, 2, 3, 4 or five of them can be active in each unit. It´s all configurable. This configuration is done by putting contexts in failover-groups and this config is the only difference between the two last scenarios above.</li>
<h3>Final words:</h3>
<p>A Cisco ASA-solution without multiple contexts can <strong>never</strong> be active/active.</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/cisco-asa-activeactive-failover/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>MPF Task: Solution!</title>
		<link>http://blogg.kvistofta.nu/mpf-task-solution/</link>
		<comments>http://blogg.kvistofta.nu/mpf-task-solution/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 18:10:03 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=773</guid>
		<description><![CDATA[Solution: The solution to this is the fact that this doesn´t work with the regexps: class-map type inspect http match-all class-FIND-BANNED-URLS match request uri regex class class-map-JIMMYS-BANNED-SITES ! uri is the part of the url after the hostname, the directory-path and filename on the web-server. By matching uri you can in the &#8220;http://www.facebook.com/jimmy.larsson&#8221; match on [...]]]></description>
			<content:encoded><![CDATA[<p></p><h3>Solution:</h3>
<p>The solution to this is the fact that this doesn´t work with the regexps:</p>
<p><code><br />
class-map type inspect http match-all class-FIND-BANNED-URLS<br />
match request uri regex class class-map-JIMMYS-BANNED-SITES<br />
!<br />
</code></p>
<p><strong>uri</strong> is the part of the url after the hostname, the directory-path and filename on the web-server. By matching uri you can in the &#8220;http://www.facebook.com/jimmy.larsson&#8221; match on substrings within the &#8220;/jimmy.larsson&#8221;-subset but not in &#8220;http://www.facebook.com&#8221;-part.</p>
<p>By instead match on the request header <strong>host </strong>string I get the desired result:</p>
<p><code><br />
class-map type inspect http match-all class-FIND-BANNED-URLS<br />
match request header host regex class class-map-JIMMYS-BANNED-SITES<br />
</code></p>
<h3>Verification:</h3>
<p>When trying to access <a href="http://www.facebook.com">facebook</a> (after making sure that the clock is not in my 5 min per hour grace period <img src='http://blogg.kvistofta.nu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  ) I get this in the log:</p>
<p><code><br />
%ASA-5-415008: HTTP - matched Class 29: class-FIND-BANNED-URLS in policy-map policy-INSPECT-HTTP, header matched - Resetting connection from inside:192.168.1.50/51194 to outside: 69.63.181.15/80</code></p>
<h3>Caveat:</h3>
<p>Since I match on host-name I cannot do stuff like this:</p>
<p><code><br />
regex googlereader ".*google\.com\/reader*"<br />
</code></p>
<p>This will work.:</p>
<p><code><br />
regex googlereader ".*google\.com*"<br />
</code></p>
<p>However it will prevent me from using <b>any</b> google-service during my studies. (Which might be a good thing. <img src='http://blogg.kvistofta.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) Anyway, how do I prevent access to google reader at google.com/reader without killing my google-searching-abilities? Like this:</p>
<p><code><br />
regex reader ".*reader\/.*"<br />
regex google ".*\.google\..*"<br />
!<br />
class-map type inspect http match-all GOOGLEREADER<br />
 match request header host regex google<br />
 match request uri regex reader<br />
!<br />
policy-map type inspect http policy-INSPECT-HTTP<br />
 parameters<br />
 class class-FIND-BANNED-URLS<br />
  reset log<br />
 class GOOGLEREADER<br />
  reset log<br />
</code></p>
<p>Mission accomplished!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/mpf-task-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MPF Task: prevent surfing to those sites at these times.</title>
		<link>http://blogg.kvistofta.nu/mpf-task-prevent-surfing-to-those-sites-at-these-times/</link>
		<comments>http://blogg.kvistofta.nu/mpf-task-prevent-surfing-to-those-sites-at-these-times/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 10:57:58 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=763</guid>
		<description><![CDATA[For todays lab-session I gave myself a small task: Configure the internet-ASA to prevent myself from surfing to specific time-consuming websites except from 5 minutes every hour. The task sounds easy an as soon as I figured out to do MPF with a time-based acl for specifying inspect-traffic it just took me a few minutes [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>For todays lab-session I gave myself a small task: Configure the internet-ASA to prevent myself from surfing to specific time-consuming websites except from 5 minutes every hour.</p>
<p>The task sounds easy an as soon as I figured out to do MPF with a time-based acl for specifying inspect-traffic it just took me a few minutes to do this:</p>
<p><code><br />
time-range STUDY-TIME<br />
periodic weekdays 7:00 to 7:55<br />
periodic weekdays 8:00 to 8:55<br />
periodic weekdays 9:00 to 9:55<br />
periodic weekdays 10:00 to 10:55<br />
periodic weekdays 11:00 to 11:55<br />
periodic weekdays 12:00 to 12:55<br />
periodic weekdays 13:00 to 13:55<br />
periodic weekdays 14:00 to 14:55<br />
periodic weekdays 15:00 to 15:55<br />
!<br />
access-list acl-MAKE-JIMMY-WORK extended permit tcp any any eq www time-range STUDY-TIME<br />
!<br />
class-map class-NOSURF<br />
   match access-list acl-MAKE-JIMMY-WORK<br />
!<br />
regex gmail ".*mail\.google\.com*"<br />
regex googlereader ".*google\.com\/reader*"<br />
regex twitter ".*\.twitter\.com*"<br />
regex facebook ".*\.facebook\.com*"<br />
!<br />
class-map type regex match-any class-map-JIMMYS-BANNED-SITES<br />
  match regex gmail<br />
  match regex googlereader<br />
  match regex twitter<br />
  match regex facebook<br />
!<br />
class-map type inspect http match-all class-FIND-BANNED-URLS<br />
  match request uri regex class class-map-JIMMYS-BANNED-SITES<br />
!<br />
policy-map type inspect http policy-INSPECT-HTTP<br />
  parameters<br />
  class class-FIND-BANNED-URLS<br />
    reset log<br />
!<br />
policy-map policy-inside<br />
class class-NOSURF<br />
inspect http policy-INSPECT-HTTP<br />
!<br />
service-policy policy-inside interface inside<br />
</code></p>
<p>However, it didn´t work. I was still able to get to facebook. I verified that there were hitcounts in the access-list and there was. I verified that the time-range was active, and it was. Still, no reset of traffic.</p>
<p>What have I done wrong? Feel free to try to spot the error and write a comment below&#8230;</p>
<h2><blink><a href="http://blogg.kvistofta.nu/mpf-task-solution/">Solution here!</a></blink></h2</p>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/mpf-task-prevent-surfing-to-those-sites-at-these-times/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Asymmetric routing in ASA &#8211; TCP state bypass</title>
		<link>http://blogg.kvistofta.nu/asa-state-bypass/</link>
		<comments>http://blogg.kvistofta.nu/asa-state-bypass/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 21:01:33 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[ASA]]></category>
		<category><![CDATA[class-map]]></category>
		<category><![CDATA[mpf]]></category>
		<category><![CDATA[policy-map]]></category>
		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=667</guid>
		<description><![CDATA[Today I continued my work to fully understand MPF (Modular Policy Framework) and found a new cool feature in ASA 8.2: TCP State Bypass. By bypassing TCP state machine for certain traffic you can get around problems with asymettricrouting. In my home lab I built this scenario: On my inside network I have this client [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Today I continued my work to fully understand MPF (Modular Policy Framework) and found a new cool feature in ASA 8.2: TCP State Bypass. By bypassing TCP state machine for certain traffic you can get around problems with asymettricrouting. In my home lab I built this scenario:</p>
<p><a href="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/asym-routing1.jpg"><img class="alignnone size-medium wp-image-668" title="asym routing" src="http://blogg.kvistofta.nu/wp-content/uploads/2010/02/asym-routing-281x300.jpg" alt="" width="281" height="300" /></a></p>
<p>On my inside network I have this client host who wants to access the FTP-server on outside. However, there are multiple links between the networks and the routing seems to be assymmetric. My inside hosts outbound traffic leaves thru the router but the return traffic goes thru the firewall. What happens is that the ASA sees the SYN ACK return packet but havent seen the preceeding SYN-packet. The result is that it blocks the packet:<br />
<code><br />
%ASA-2-106001: Inbound TCP connection denied from 192.168.1.50/21 to 10.0.11.100/59677 flags SYN ACK  on interface outside<br />
%ASA-2-106001: Inbound TCP connection denied from 192.168.1.50/21 to 10.0.11.100/59677 flags SYN ACK  on interface outside<br />
%ASA-2-106001: Inbound TCP connection denied from 192.168.1.50/21 to 10.0.11.100/59677 flags SYN ACK  on interface outside<br />
</code><br />
She solution to this is to configure a policy-map that makes an exception to this state-machine-thing and allows that return-traffic anyway. Lets rock!</p>
<p>First, make sure that the inbound traffic gets thru. Doing state-bypass doesnt mean that acls will be bypassed. Since this is return traffic we need to permit permit with the <b>source</b>-port being 21.</p>
<p><code><br />
access-list acl_outside extended permit tcp host 192.168.1.50 eq ftp any<br />
access-group acl_outside in interface outside<br />
!<br />
</code></p>
<p>Next, define which traffic to do state-bypassing with. It happens to be the same layout as the acl above. <img src='http://blogg.kvistofta.nu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><code><br />
access-list ACL-STATE-BYPASS extended permit tcp host 192.168.1.50 eq ftp any<br />
</code></p>
<p>Now, create a class-map, give it a fancy name and match the access-list above&#8230;</p>
<p><code><br />
class-map state-bypass<br />
match access-list ACL-STATE-BYPASS<br />
</code></p>
<p>Next, a policy-map which references the class-map above and sets the tcp-state-bypass advanced option.</p>
<p><code><br />
policy-map POLICY-OUTSIDE<br />
class state-bypass<br />
set connection advanced-options tcp-state-bypass<br />
</code><br />
Finally. Apply it. Since its all about inbound traffic it needs to be applied to outside interface. Remember, if you already hava an service-policy for that interface, addit to that existing policy&#8230;<br />
<code><br />
service-policy POLICY-OUTSIDE interface outside<br />
</code></p>
<p>Now, when trying to access my outside FTP-server from my inside client it works. I get this in the ASA-log:</p>
<p><code><br />
%ASA-6-302303: Built TCP state-bypass connection 47 from outside:192.168.1.50/21 (192.168.1.50/21) to inside:10.0.11.100/37781 (10.0.11.100 /37781)<br />
</code><br />
As you can see I get hitcounts in both access-lists:<br />
<code><br />
fw1# sh access-list acl_outside<br />
access-list acl_outside; 1 elements; name hash: 0xdcd74233<br />
access-list acl_outside line 1 extended permit tcp host 192.168.1.50 eq ftp any (hitcnt=1) 0x6863abc6<br />
fw1# sh access-list ACL-STATE-BYPASS<br />
access-list ACL-STATE-BYPASS; 1 elements; name hash: 0xbe9fc05e<br />
access-list ACL-STATE-BYPASS line 1 extended permit tcp host 192.168.1.50 eq ftp any (hitcnt=1) 0xad18b614<br />
fw1#<br />
</code><br />
Voila! Or &#8220;Vålla&#8221; as we say in Sweden!</p>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/asa-state-bypass/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>ASA built-in help</title>
		<link>http://blogg.kvistofta.nu/ccie-security-asa-built-in-help/</link>
		<comments>http://blogg.kvistofta.nu/ccie-security-asa-built-in-help/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 09:44:05 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=589</guid>
		<description><![CDATA[Did you know that the kind coders at Cisco has put a lot of help for us into the CLI of ASA firewall? Here are two examples: vpnsetup todo-list With the vpnsetup-command you can see a list of configuration tasks needed for setting up different types of VPN: fw2(config)# vpnsetup ? configure mode commands/options: ipsec-remote-access [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Did you know that the kind coders at Cisco has put a lot of help for us into the CLI of ASA firewall? Here are two examples:</p>
<ul>
<li>vpnsetup todo-list</li>
<p>With the vpnsetup-command you can see a list of configuration tasks needed for setting up different types of VPN:</p>
<p><code><br />
fw2(config)# vpnsetup ?</p>
<p>configure mode commands/options:<br />
  ipsec-remote-access  Display IPSec Remote Access Configuration Commands<br />
  l2tp-remote-access   Display L2TP/IPSec Configuration Commands<br />
  site-to-site         Display IPSec Site-to-Site Configuration Commands<br />
  ssl-remote-access    Display SSL Remote Access Configuration Commands<br />
</code></p>
<p>Let´s say that we need to make a new Lan2Lan-tunnel:</p>
<p><code><br />
fw2(config)# vpnsetup site-to-site steps</p>
<p>Steps to configure a site-to-site IKE/IPSec connection with examples:</p>
<p>1. Configure Interfaces</p>
<p>        interface GigabitEthernet0/0<br />
         ip address 10.10.4.200 255.255.255.0<br />
         nameif outside<br />
         no shutdown</p>
<p>        interface GigabitEthernet0/1<br />
         ip address 192.168.0.20 255.255.255.0<br />
         nameif inside<br />
         no shutdown</p>
<p>2. Configure ISAKMP policy</p>
<p>        crypto isakmp policy 10<br />
         authentication pre-share<br />
         encryption aes<br />
         hash sha</p>
<p>3. Configure transform-set</p>
<p>        crypto ipsec transform-set myset esp-aes esp-sha-hmac</p>
<p>4. Configure ACL</p>
<p>        access-list L2LAccessList extended permit ip 192.168.0.0 255.255.255.0 192.168.50.0 255.255.255.0</p>
<p>5. Configure Tunnel group</p>
<p>        tunnel-group 10.20.20.1 type ipsec-l2l<br />
        tunnel-group 10.20.20.1 ipsec-attributes<br />
         pre-shared-key P@rtn3rNetw0rk</p>
<p>6. Configure crypto map and attach to interface</p>
<p>        crypto map mymap 10 match address L2LAccessList<br />
        crypto map mymap 10 set peer 10.10.4.108<br />
        crypto map mymap 10 set transform-set myset<br />
        crypto map mymap 10 set reverse-route<br />
        crypto map mymap interface outside</p>
<p>7. Enable isakmp on interface</p>
<p>        crypto isakmp enable outside</p>
<p>fw2(config)#<br />
</code></p>
<li>Command syntax help</li>
<p>Of course you can use question-mark and tab-completion. But did You know that there is also a built-in man-page for every command? Try &#8220;help <command>&#8221;</p>
<p><code><br />
fw2(config)# help global</p>
<p>USAGE:</p>
<p>        [no] global (<ext_if_name>) <nat_id> {<global_ip>[-<global_ip>] [netmask <global_mask>]} | interface<br />
        show running-config [all] global [(<ext_if_name>)] [<nat_id>]<br />
        clear configure global</p>
<p>DESCRIPTION:</p>
<p>global          Specify, delete or view global address pools,<br />
                or designate a PAT(Port Address Translated) address</p>
<p>SYNTAX:</p>
<p><(ext_if_name)> The external network interface name</p>
<p><nat_id>        The id of the nat group(from the nat command) that<br />
                will draw from these global addresses</p>
<p><global_ip>     The IP address, network or range of addresses that will<br />
                dynamically be translated on an as needed basis to hosts<br />
                in the nat group <nat_id>.<br />
                If this <ext_if_name> is connected to the Internet, the<br />
                <global_ip> should be registered with the Network Information<br />
                Center(NIC).<br />
                These addresses should also be reverse resolvable(in-addr.arpa)<br />
                on the outside DNS servers.<br />
                An address specified singly will be used as a PAT address.<br />
                When all of the non-PAT addresses of a global pool are in use<br />
                and there is a PAT address, subsequent hosts from the nat<br />
                group <nat_id> will share the single PAT address for up to<br />
                the number of licensed connections.<br />
                [netmask <global_mask>] The netmask of the global_ip.</p>
<p>interface       IP address of <ext_if_name> overloaded for PAT.</p>
<p>see also:       nat, alias, static</p>
<p>fw2(config)#<br />
</code>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/ccie-security-asa-built-in-help/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CCIE Security &#8211; Cisco ASA Modular Policy Framework Example</title>
		<link>http://blogg.kvistofta.nu/ccie-security-cisco-asa-modular-policy-framework-example/</link>
		<comments>http://blogg.kvistofta.nu/ccie-security-cisco-asa-modular-policy-framework-example/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 14:47:03 +0000</pubDate>
		<dc:creator>Jimmy Larsson</dc:creator>
				<category><![CDATA[Cisco ASA]]></category>
		<category><![CDATA[English posts]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Teknik]]></category>
		<category><![CDATA[ASA]]></category>
		<category><![CDATA[CCIE]]></category>
		<category><![CDATA[Modular Policy Framework]]></category>

		<guid isPermaLink="false">http://blogg.kvistofta.nu/?p=564</guid>
		<description><![CDATA[This is first in a serie of posts in english dealing with technical configurations and solutions. The reason for this is me studying for CCIE Security certification and along the road I will probably find interresting stuff to share with others in the same situation as I am. (I´ve already found that more good configuration [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>This is first in a serie of posts in english dealing with technical configurations and solutions. The reason for this is me studying for CCIE Security certification and along the road I will probably find interresting stuff to share with others in the same situation as I am. (I´ve already found that more good configuration examples can be found at blogs than in technical references as <a href="http://www.cisco.com">CCO</a>. Another purpose for me posting about stuff like this is that I learn alot when trying to explain and write about it. )</p>
<p>I have been bangning my head a couple of ours now trying to understand the modularity of Cisco ASA MPF. There are Class-maps, policy-maps and service-policies. There are a lot of different types of each of them and different combinations are invalid. Deeper information can be found att <a href="http://www.cisco.com/en/US/docs/security/asa/asa82/configuration/guide/mpf.html">CCO</a>.</p>
<p>MPF is built with 3 different types of modules:</p>
<ol>
<li>class-maps. Defining what to look for</li>
<li>policy-maps. What shall we do with it?</li>
<li>service-policy. where do we do it?</li>
</ol>
<p>I made up an hypothetical example. Lets say that I want to prevent my users from downloading mp3-files with ftp. This is a good example of when MPF comes handy (yes I know that some users know how to rename files, do encrypted file-transfers or use other protocols than ftp.)</p>
<p>Ok. On my LAN I have this PC with IP 192.168.1.215 which should not be able to GET files whose name contains &#8220;.mp3&#8243;. Where do I start?</p>
<p>First I create a regexp defining the string to search for:</p>
<p><code>regex mp3 ".*\.mp3.*"</code></p>
<p>Next I create a class-map type regex that uses the regex defined:</p>
<p><code><br />
class-map type regex match-any class-map-TEST-mp3-regex<br />
match regex mp3<br />
</code></p>
<p>Next thing to do is to create a class-map type inspect which is going to look into the ftp application-data sent and have a look for filenames with the regexp-string matched:</p>
<p><code>class-map type inspect ftp match-all class-map-TEST-ftpfilter<br />
match filename regex class class-map-TEST-mp3-regex<br />
</code></p>
<p>After that I create a policy-map that defines the action (reset tcp connection and log the event) to be taken when the class-map above is triggered:</p>
<p><code>policy-map type inspect ftp policy-map-TEST-dropftp<br />
parameters<br />
class class-map-TEST-ftpfilter<br />
reset log<br />
</code></p>
<p>Now I need to define which traffic to look into. Remember the host</p>
<p>-IP above? I create an acl:</p>
<p><code>access-list acl_TEST_mytraffic extended permit tcp host 192.168.1.215 any eq ftp<br />
</code></p>
<p>Before putting everything together you need to decide where to apply this. It can be done either globally or inbound to a specific interface. The most logical thing to do in this case is to apply it on my inside-interface where my ftp-clients are. If you have already a policy-map bound to that interface you need to reuse that policy-map in the next step. Otherwise, just create a new policy-map.</p>
<p><code>asa# sh run service-policy<br />
service-policy policy-inside interface inside<br />
asa#<br />
</code></p>
<p>So I reuse this policy and add a new class:<br />
<code>policy-map policy-inside<br />
class class-map-TEST-mytraffic<br />
inspect ftp strict policy-map-TEST-dropftp<br />
</code><br />
Let´s see if it works…<br />
<code>ftp&gt; (connected to FTP-server from my host)</code></p>
<p><code> </code></p>
<p><code>ftp&gt; ls</code></p>
<p><code> </code></p>
<p><code>200 PORT command successful</code></p>
<p><code>150 Connecting to port 40538</p>
<p>file.mp3</p>
<p>file.mpt</p>
<p>pub</p>
<p>226 3 matches total</p>
<p>ftp: 25 bytes received in 0,03Seconds 0,96Kbytes/sec.</p>
<p>ftp&gt; get file.mpt</p>
<p>200 PORT command successful</p>
<p>150-Connecting to port 17047</p>
<p>150 3948.3 kbytes to download</p>
<p>226-File successfully transferred</p>
<p>226 4.742 seconds (measured here), 0.81 Mbytes per second</p>
<p>ftp: 4056688 bytes received in 4,79Seconds 847,08Kbytes/sec.</p>
<p>ftp&gt; get file.mp3</p>
<p>200 PORT command successful</p>
<p></code></p>
<p><code>Connection closed by remote host.</code></p>
<p>Finally, a bleeding rocket-science flow-chart with home-made arrows and sugar on top&#8230;</p>
<p><img class="alignleft size-full wp-image-567" title="mpf ftp-filter example" src="http://blogg.kvistofta.nu/wp-content/uploads/2010/01/mpf-ftp-filter-example1.jpg" alt="" width="691" height="571" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blogg.kvistofta.nu/ccie-security-cisco-asa-modular-policy-framework-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
