<?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 Blocking any HTTP URLs that contain IPs (but not domain-names) in Network Security</title>
    <link>https://community.cisco.com/t5/network-security/blocking-any-http-urls-that-contain-ips-but-not-domain-names/m-p/1659846#M561307</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Based on: &lt;/SPAN&gt;&lt;A class="jive-link-wiki-small" href="https://community.cisco.com/docs/DOC-1268" target="_blank"&gt;https://supportforums.cisco.com/docs/DOC-1268&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have tried...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regex blockex1 "/test/"&lt;/P&gt;&lt;P&gt;regex blockex2 "cisco\.com"&lt;/P&gt;&lt;P&gt;regex blockex3 "\d*\.\d*\.\d*\.\d*"&lt;/P&gt;&lt;P&gt;regex blockex4 "(0|1|2|3|4|5|6|7|8|9)*\.(0|1|2|3|4|5|6|7|8|9)*\.(0|1|2|3|4|5|6|7|8|9)*\.(0|1|2|3|4|5|6|7|8|9)*\."&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;regex blockex6 "^&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://\d*\.\d*\.\d*\.\d*(/" target="_blank"&gt;http://\d*\.\d*\.\d*\.\d*(/&lt;/A&gt;&lt;SPAN&gt;|$)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;regex blockex7 "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://\d*\.\d*\.\d*\.\d*" target="_blank"&gt;http://\d*\.\d*\.\d*\.\d*&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map type inspect http match-any block-url-class&lt;/P&gt;&lt;P&gt; match request uri regex blockex7&amp;nbsp; &amp;lt;--- I've tried each of the ones above individually here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map type inspect http block-url-policy&lt;/P&gt;&lt;P&gt; parameters&lt;/P&gt;&lt;P&gt; class block-url-class&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop-connection log&lt;/P&gt;&lt;P&gt;policy-map global_policy&lt;/P&gt;&lt;P&gt; class inspection_default&lt;/P&gt;&lt;P&gt;&amp;nbsp; inspect http block-url-policy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;service-policy global_policy global&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...What I'm trying to accomplish is prevent any site from being visited by IP address directly.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example I want &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.example.com" target="_blank"&gt;http://www.example.com&lt;/A&gt;&lt;SPAN&gt; to work but &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://192.0.32.10" target="_blank"&gt;http://192.0.32.10&lt;/A&gt;&lt;SPAN&gt; to be blocked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The practical applicaiton for this is so clever students cannot bypass our DNS-based internet filter (as implemented by systems like DNS Redirector, OpenDNS, and others)&lt;/P&gt;&lt;P&gt;Basically I need to ensure only a URL will a domain name will load, but not a URL with an IP address.&amp;nbsp; There is no good reason anyone should be accessing sites by IP in our environment, in the rare case we need that I would make a DNS record for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the above I have experienced...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;blockex1 - works for blocking any URL with /test/ in it, ok, so I know my regex blocking is possible/working&lt;/P&gt;&lt;P&gt;blockex2 - works for blocking any URL with cisco.com in it, ok, so I know my regex blocking is possible/working&lt;/P&gt;&lt;P&gt;blockex3 blocks everything, nobody can surf anywhere, not what I want&lt;/P&gt;&lt;P&gt;blockex4 blocks everything, nobody can surf anywhere, not what I want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;blockex6 does nothing, not what I want&lt;/P&gt;&lt;P&gt;blockex7 does nothing, not what I want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions??&amp;nbsp; I tried different variants becuase I could not verify if all special meaning regex characters were supported by the ASA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently the only way I am able to accomplish this is with a BHO object in the browser, changes to which are locked out by AD group-policy, but I have only found this solution for IE - I'd like to provide other browsers &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our DNS-based blacklist has over 12000 keywords, blocking even more than that in currently active domain-names and even future, yet to be registered, suspicious domains.&amp;nbsp; Adding these all to the ASA is not practical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other network appliance that can do this?&amp;nbsp; Or have I uncovered a bug in ASA's filtering URLs via regex?&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2019 20:42:05 GMT</pubDate>
    <dc:creator>Delete Account</dc:creator>
    <dc:date>2019-03-11T20:42:05Z</dc:date>
    <item>
      <title>Blocking any HTTP URLs that contain IPs (but not domain-names)</title>
      <link>https://community.cisco.com/t5/network-security/blocking-any-http-urls-that-contain-ips-but-not-domain-names/m-p/1659846#M561307</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Based on: &lt;/SPAN&gt;&lt;A class="jive-link-wiki-small" href="https://community.cisco.com/docs/DOC-1268" target="_blank"&gt;https://supportforums.cisco.com/docs/DOC-1268&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have tried...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regex blockex1 "/test/"&lt;/P&gt;&lt;P&gt;regex blockex2 "cisco\.com"&lt;/P&gt;&lt;P&gt;regex blockex3 "\d*\.\d*\.\d*\.\d*"&lt;/P&gt;&lt;P&gt;regex blockex4 "(0|1|2|3|4|5|6|7|8|9)*\.(0|1|2|3|4|5|6|7|8|9)*\.(0|1|2|3|4|5|6|7|8|9)*\.(0|1|2|3|4|5|6|7|8|9)*\."&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;regex blockex6 "^&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://\d*\.\d*\.\d*\.\d*(/" target="_blank"&gt;http://\d*\.\d*\.\d*\.\d*(/&lt;/A&gt;&lt;SPAN&gt;|$)"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;regex blockex7 "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://\d*\.\d*\.\d*\.\d*" target="_blank"&gt;http://\d*\.\d*\.\d*\.\d*&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;class-map type inspect http match-any block-url-class&lt;/P&gt;&lt;P&gt; match request uri regex blockex7&amp;nbsp; &amp;lt;--- I've tried each of the ones above individually here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;policy-map type inspect http block-url-policy&lt;/P&gt;&lt;P&gt; parameters&lt;/P&gt;&lt;P&gt; class block-url-class&lt;/P&gt;&lt;P&gt;&amp;nbsp; drop-connection log&lt;/P&gt;&lt;P&gt;policy-map global_policy&lt;/P&gt;&lt;P&gt; class inspection_default&lt;/P&gt;&lt;P&gt;&amp;nbsp; inspect http block-url-policy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;service-policy global_policy global&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...What I'm trying to accomplish is prevent any site from being visited by IP address directly.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For example I want &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.example.com" target="_blank"&gt;http://www.example.com&lt;/A&gt;&lt;SPAN&gt; to work but &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://192.0.32.10" target="_blank"&gt;http://192.0.32.10&lt;/A&gt;&lt;SPAN&gt; to be blocked.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The practical applicaiton for this is so clever students cannot bypass our DNS-based internet filter (as implemented by systems like DNS Redirector, OpenDNS, and others)&lt;/P&gt;&lt;P&gt;Basically I need to ensure only a URL will a domain name will load, but not a URL with an IP address.&amp;nbsp; There is no good reason anyone should be accessing sites by IP in our environment, in the rare case we need that I would make a DNS record for it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Based on the above I have experienced...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;blockex1 - works for blocking any URL with /test/ in it, ok, so I know my regex blocking is possible/working&lt;/P&gt;&lt;P&gt;blockex2 - works for blocking any URL with cisco.com in it, ok, so I know my regex blocking is possible/working&lt;/P&gt;&lt;P&gt;blockex3 blocks everything, nobody can surf anywhere, not what I want&lt;/P&gt;&lt;P&gt;blockex4 blocks everything, nobody can surf anywhere, not what I want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;blockex6 does nothing, not what I want&lt;/P&gt;&lt;P&gt;blockex7 does nothing, not what I want&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions??&amp;nbsp; I tried different variants becuase I could not verify if all special meaning regex characters were supported by the ASA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently the only way I am able to accomplish this is with a BHO object in the browser, changes to which are locked out by AD group-policy, but I have only found this solution for IE - I'd like to provide other browsers &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Our DNS-based blacklist has over 12000 keywords, blocking even more than that in currently active domain-names and even future, yet to be registered, suspicious domains.&amp;nbsp; Adding these all to the ASA is not practical.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other network appliance that can do this?&amp;nbsp; Or have I uncovered a bug in ASA's filtering URLs via regex?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 20:42:05 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/blocking-any-http-urls-that-contain-ips-but-not-domain-names/m-p/1659846#M561307</guid>
      <dc:creator>Delete Account</dc:creator>
      <dc:date>2019-03-11T20:42:05Z</dc:date>
    </item>
    <item>
      <title>Re: Blocking any HTTP URLs that contain IPs (but not domain-name</title>
      <link>https://community.cisco.com/t5/network-security/blocking-any-http-urls-that-contain-ips-but-not-domain-names/m-p/1659847#M561309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi JP,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think with a slight modification to blockex3, you should be able to achieve what you are trying.&lt;/P&gt;&lt;P&gt;You currently have: &lt;STRONG&gt;regex blockex3 "\d*\.\d*\.\d*\.\d*"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, * means 0 or more. This means that the regex would match "...", "2.3.4.", and many other non ip addresses as well.&lt;/P&gt;&lt;P&gt;(Though I am still clueless as to why it would block all traffic.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The symbol + means 1 or more, and should match ip addresses only.&lt;/P&gt;&lt;P&gt;So please try the following regex and let me know if it works: &lt;STRONG&gt;regex blockex3 "\d+\.\d+\.\d+\.\d+"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Shrikant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.S.: Please mark the question as answered if it has been resolved. Do rate helpful posts. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 05:59:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/blocking-any-http-urls-that-contain-ips-but-not-domain-names/m-p/1659847#M561309</guid>
      <dc:creator>Shrikant Sundaresh</dc:creator>
      <dc:date>2011-06-03T05:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Blocking any HTTP URLs that contain IPs (but not domain-name</title>
      <link>https://community.cisco.com/t5/network-security/blocking-any-http-urls-that-contain-ips-but-not-domain-names/m-p/1659848#M561312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried&amp;nbsp; regex blockex3 "\d+\.\d+\.\d+\.\d+"&amp;nbsp; as you suggested, but that ended up blocking eveything (nobody could surf anywhere)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jun 2011 13:51:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/blocking-any-http-urls-that-contain-ips-but-not-domain-names/m-p/1659848#M561312</guid>
      <dc:creator>Delete Account</dc:creator>
      <dc:date>2011-06-03T13:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Blocking any HTTP URLs that contain IPs (but not domain-name</title>
      <link>https://community.cisco.com/t5/network-security/blocking-any-http-urls-that-contain-ips-but-not-domain-names/m-p/1659849#M561313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;It would seem that regex blocking should never include the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://"&gt;http://&lt;/A&gt;&lt;SPAN&gt; or &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://"&gt;https://&lt;/A&gt;&lt;SPAN&gt; part of the URL, is that correct? can someone confirm that's how it's supposed to work on the ASA?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I turn on logging in ASDM I can see my URLs with a domain, or with an IP, go flying by, but I always notice that an IP is out in front before the &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://"&gt;http://&lt;/A&gt;&lt;SPAN&gt; is the whole line being checked against a regex?&amp;nbsp; If that's the case, I think it's broken, but I can see why everything would come up blocked with a regex like "\d+\.\d+\.\d+\.\d+" then.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2011 20:47:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-security/blocking-any-http-urls-that-contain-ips-but-not-domain-names/m-p/1659849#M561313</guid>
      <dc:creator>Delete Account</dc:creator>
      <dc:date>2011-06-06T20:47:16Z</dc:date>
    </item>
  </channel>
</rss>

