<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Traffic inspection best practices in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/traffic-inspection-best-practices/m-p/1932295#M437561</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Collin, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically we need to wrap it up and make differences between the class maps and policy maps that exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are mainly 2 types of Class maps and Policy maps. The one that carry layer 3/4 (well know as IP, TCP/UDP) and the layer 7 inspections&amp;nbsp; (the one that actually look into the payload of the packet and make sure the fields are correct). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the ASA by default comes with a default inspection policy with its own default inspection class map. If you look at the Inspection default class map, it just matches some of the well know protocols with their respective well known ports and on the policy map it actually does the inspect (which is just basically going to check if for example FTP actually does come in port 21). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Goin back to your question and example that you put &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map type inspect http match-any MyHTTPClass_drop&lt;/P&gt;&lt;P&gt; match req-rsp-content-type mismatch&lt;/P&gt;&lt;P&gt; match request uri length gt 1024&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map HttpPolicy&lt;/P&gt;&lt;P&gt; class MyHTTPClass_drop&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not correct, we need to define first what we want to check and then where we are going to apply it. For example, starting with the layer 7 is correct, cuz we decide and check what we want to verify on the HTTP packet, so: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map type inspect http match-any MyHTTPClass_drop&lt;/P&gt;&lt;P&gt; match req-rsp-content-type mismatch&lt;/P&gt;&lt;P&gt; match request uri length gt 1024&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, after the layer 7 is created, then we apply an action to it using a Policy map of Layer 7, like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Policy-map type inpspect http&lt;STRONG&gt; URI-AND-MISMATCH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; class MyHTTPClass_drop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; reset log &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have defined what we are going to do with the content type mismatch and if an URI exceeds the 1024 size. Now, we need to apply this, we need to tell the firewall where to look for this information (By that I mean what port, cuz it gives you the flexibility of Match this information on a non standard port, that is where layer 3/4 Information class maps kick in) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 2 ways, on the default policy map or you can create a custom one and apply it on an interface, I am going to show you both, first the default, basically it will be like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Policy-map global_policy &lt;/P&gt;&lt;P&gt;&amp;nbsp; class class_default-inspection-traffic &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inspect http &lt;STRONG&gt; URI-AND-MISMATCH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There in the layer 3/4 policy map, under the class default, the ASA knows already that when you put the inspect http on the class default, you are looking for http data on&amp;nbsp; port 80. Addtionally you can add your custom layer 7 inspection policy which is going to look for the URI and request-respond mismatch under the HTTP protocol. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other way will be almost the same, but instea applied on an interface and with the class maps and policy maps of Layer 3/4 configured by you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map HTTP &lt;/P&gt;&lt;P&gt; match port tcp eq 80&lt;/P&gt;&lt;P&gt;Policy-map HTTP &lt;/P&gt;&lt;P&gt; class HTTP &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; inspect http &lt;STRONG&gt;URI-AND-MISMATCH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Service-policy HTTP interface inside&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would be basically it. Now going back to your questions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-&lt;STRONG&gt;So the idea here is to leave the default policy active for all&amp;nbsp; interafaces (global) but use custom policies applied to individual&amp;nbsp; interfaces for specific types of traffic. Is this how it is typically&amp;nbsp; done?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R/ Class default inspection will have you fix ports-to-protocol mappings as you saw. If you want to be very granular, saying matchinn an access list or a non standard port, you cannot do that on the default class map as it only supports inspection option. That is where an when you need to create granular inspections and class maps, hence forcing you to configure per interface if you will. Depends most of all, on how granular you wan to be. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2-&lt;STRONG&gt;Also, what happens if I leave http inspection in the policy-map&amp;nbsp; global-policy along with the new policy? Which one takes precendence?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R/Basically first it goes to the ones applied on the interface and then the global policy, you can only have one policy per interface and one global policy. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3/Does the ASA look at he global policy before looking at the interface policy?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, first it goes to the interface one and then the global. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;Will the traffic coming from inside to the outside hit the global&amp;nbsp; policy and then the ASA will ignore the outside interface policy?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Policy just applies and action to the traffic defined on the class map, it will go per interface looking for a policy, if it finds a match, it applies the action, if not, it will look for the global. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A bit long explanation and I am sorry, but hope it makes some sense. Here, this explains how to apply HTTP inspection polices (both layer 3 and 7) it will give you better guidance and understanding. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a0080aee442.shtml"&gt;http://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a0080aee442.shtml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 May 2012 00:10:14 GMT</pubDate>
    <dc:creator>Maykol Rojas</dc:creator>
    <dc:date>2012-05-08T00:10:14Z</dc:date>
    <item>
      <title>Traffic inspection best practices</title>
      <link>https://community.cisco.com/t5/network-security/traffic-inspection-best-practices/m-p/1932294#M437560</link>
      <description>&lt;P&gt;Since the ASA, by default, has a global inspection policy enabled that uses the default-inspection-traffic class-map, what is the best way to apply additional policies on the system while retaining this global policy?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's say I want the system to take a closer look at http traffic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Should I&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Take it out of the policy-map global-policy&lt;/P&gt;&lt;P&gt;2. Create a new policy based on http class-maps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map type inspect http match-any MyHTTPClass_drop&lt;/P&gt;&lt;P&gt; match req-rsp-content-type mismatch&lt;/P&gt;&lt;P&gt; match request uri length gt 1024&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map HttpPolicy&lt;/P&gt;&lt;P&gt; class MyHTTPClass_drop&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;service-policy MyHTTPClass_drop interface outside&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the idea here is to leave the default policy active for all interafaces (global) but use custom policies applied to individual interfaces for specific types of traffic. Is this how it is typically done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, what happens if I leave http inspection in the policy-map global-policy along with the new policy? Which one takes precendence? Does the ASA look at he global policy before looking at the interface policy? Or better yet, what if the interface policy is enable on the outside interface (like above) but the globsal policy is enable everywhere? Will the traffic coming from inside to the outside hit the global policy and then the ASA will ignore the outside interface policy?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 23:03:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/traffic-inspection-best-practices/m-p/1932294#M437560</guid>
      <dc:creator>Colin Higgins</dc:creator>
      <dc:date>2019-03-11T23:03:06Z</dc:date>
    </item>
    <item>
      <title>Traffic inspection best practices</title>
      <link>https://community.cisco.com/t5/network-security/traffic-inspection-best-practices/m-p/1932295#M437561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Collin, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically we need to wrap it up and make differences between the class maps and policy maps that exists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are mainly 2 types of Class maps and Policy maps. The one that carry layer 3/4 (well know as IP, TCP/UDP) and the layer 7 inspections&amp;nbsp; (the one that actually look into the payload of the packet and make sure the fields are correct). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the ASA by default comes with a default inspection policy with its own default inspection class map. If you look at the Inspection default class map, it just matches some of the well know protocols with their respective well known ports and on the policy map it actually does the inspect (which is just basically going to check if for example FTP actually does come in port 21). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Goin back to your question and example that you put &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map type inspect http match-any MyHTTPClass_drop&lt;/P&gt;&lt;P&gt; match req-rsp-content-type mismatch&lt;/P&gt;&lt;P&gt; match request uri length gt 1024&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map HttpPolicy&lt;/P&gt;&lt;P&gt; class MyHTTPClass_drop&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop connection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is not correct, we need to define first what we want to check and then where we are going to apply it. For example, starting with the layer 7 is correct, cuz we decide and check what we want to verify on the HTTP packet, so: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map type inspect http match-any MyHTTPClass_drop&lt;/P&gt;&lt;P&gt; match req-rsp-content-type mismatch&lt;/P&gt;&lt;P&gt; match request uri length gt 1024&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, after the layer 7 is created, then we apply an action to it using a Policy map of Layer 7, like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Policy-map type inpspect http&lt;STRONG&gt; URI-AND-MISMATCH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt; class MyHTTPClass_drop&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; reset log &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have defined what we are going to do with the content type mismatch and if an URI exceeds the 1024 size. Now, we need to apply this, we need to tell the firewall where to look for this information (By that I mean what port, cuz it gives you the flexibility of Match this information on a non standard port, that is where layer 3/4 Information class maps kick in) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are 2 ways, on the default policy map or you can create a custom one and apply it on an interface, I am going to show you both, first the default, basically it will be like this: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Policy-map global_policy &lt;/P&gt;&lt;P&gt;&amp;nbsp; class class_default-inspection-traffic &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; inspect http &lt;STRONG&gt; URI-AND-MISMATCH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There in the layer 3/4 policy map, under the class default, the ASA knows already that when you put the inspect http on the class default, you are looking for http data on&amp;nbsp; port 80. Addtionally you can add your custom layer 7 inspection policy which is going to look for the URI and request-respond mismatch under the HTTP protocol. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other way will be almost the same, but instea applied on an interface and with the class maps and policy maps of Layer 3/4 configured by you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map HTTP &lt;/P&gt;&lt;P&gt; match port tcp eq 80&lt;/P&gt;&lt;P&gt;Policy-map HTTP &lt;/P&gt;&lt;P&gt; class HTTP &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; inspect http &lt;STRONG&gt;URI-AND-MISMATCH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Service-policy HTTP interface inside&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would be basically it. Now going back to your questions. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1-&lt;STRONG&gt;So the idea here is to leave the default policy active for all&amp;nbsp; interafaces (global) but use custom policies applied to individual&amp;nbsp; interfaces for specific types of traffic. Is this how it is typically&amp;nbsp; done?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R/ Class default inspection will have you fix ports-to-protocol mappings as you saw. If you want to be very granular, saying matchinn an access list or a non standard port, you cannot do that on the default class map as it only supports inspection option. That is where an when you need to create granular inspections and class maps, hence forcing you to configure per interface if you will. Depends most of all, on how granular you wan to be. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2-&lt;STRONG&gt;Also, what happens if I leave http inspection in the policy-map&amp;nbsp; global-policy along with the new policy? Which one takes precendence?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R/Basically first it goes to the ones applied on the interface and then the global policy, you can only have one policy per interface and one global policy. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;3/Does the ASA look at he global policy before looking at the interface policy?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No, first it goes to the interface one and then the global. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;Will the traffic coming from inside to the outside hit the global&amp;nbsp; policy and then the ASA will ignore the outside interface policy?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Policy just applies and action to the traffic defined on the class map, it will go per interface looking for a policy, if it finds a match, it applies the action, if not, it will look for the global. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A bit long explanation and I am sorry, but hope it makes some sense. Here, this explains how to apply HTTP inspection polices (both layer 3 and 7) it will give you better guidance and understanding. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a0080aee442.shtml"&gt;http://www.cisco.com/en/US/products/ps6120/products_configuration_example09186a0080aee442.shtml&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 00:10:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/traffic-inspection-best-practices/m-p/1932295#M437561</guid>
      <dc:creator>Maykol Rojas</dc:creator>
      <dc:date>2012-05-08T00:10:14Z</dc:date>
    </item>
    <item>
      <title>Traffic inspection best practices</title>
      <link>https://community.cisco.com/t5/network-security/traffic-inspection-best-practices/m-p/1932296#M437563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mike: great answer! Exactly what I was looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would also add, that I think at the end of the day, the ASA follows this procedure in regards to processing traffic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. NAT/PAT&lt;/P&gt;&lt;P&gt;2. Access list&lt;/P&gt;&lt;P&gt;3. QoS ingress policy&lt;/P&gt;&lt;P&gt;4. Set connection limits and TCP options&lt;/P&gt;&lt;P&gt;5. Send traffic to the CSC module&lt;/P&gt;&lt;P&gt;6. Application inspection (interface, then global)&lt;/P&gt;&lt;P&gt;7. Send traffic to the IPS module&lt;/P&gt;&lt;P&gt;8. QoS egress policy&lt;/P&gt;&lt;P&gt;9. QoS priority handling&lt;/P&gt;&lt;P&gt;10. QoS traffic shaping&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 14:06:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/traffic-inspection-best-practices/m-p/1932296#M437563</guid>
      <dc:creator>Colin Higgins</dc:creator>
      <dc:date>2012-05-08T14:06:58Z</dc:date>
    </item>
    <item>
      <title>Traffic inspection best practices</title>
      <link>https://community.cisco.com/t5/network-security/traffic-inspection-best-practices/m-p/1932297#M437565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Collin, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am glad that it helped you to understand a bit more about Modular policy framework. Just one thing, the ACL goes first, as if the packet is denied it wouldnt process the rest of it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 15:49:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/traffic-inspection-best-practices/m-p/1932297#M437565</guid>
      <dc:creator>Maykol Rojas</dc:creator>
      <dc:date>2012-05-08T15:49:12Z</dc:date>
    </item>
  </channel>
</rss>

