Showing results for 
Search instead for 
Did you mean: 

Issue with blocking one site on ASA




I am trying to block a Web page, I have followed this guide.

But unfortunately that blocks (almost) all web pages. What I mean with almost all is that I´ve tried to access quite many webpages, none works except for some reason.
I have gone through the guide many times and double-checked the settings, I have also checked that regxp is correct by running the test function.

For testing purposes I´ve tried to block this webpage regex domainlist1 "\.op\.se"

I have tried to only set DomainBlockClass in the http_inspection_policy, just to be sure that none of the BlockURLClass or AppHeaderClass would interfere.

This is part of the configuration, I have bolded the MPF part.

Result of the command: "sh run"

: Saved
ASA Version 9.0(1) 
hostname gbgASA
enable password xxxxx encrypted
passwd xxxxx encrypted
ip local pool anyVPNPool mask
interface Ethernet0/0
 switchport access vlan 2
interface Ethernet0/1
interface Ethernet0/2
interface Ethernet0/3
interface Ethernet0/4
interface Ethernet0/5
interface Ethernet0/6
interface Ethernet0/7
interface Vlan1
 nameif inside
 security-level 100
 ip address 
interface Vlan2
 nameif outside-telia
 security-level 0
 ip address xxxxx 
regex urllist1 ".*\.([Ee][Xx][Ee]|[Cc][Oo][Mm]|[Bb][Aa][Tt]) HTTP/1.[01]"
regex urllist2 ".*\.([Pp][Ii][Ff]|[Vv][Bb][Ss]|[Ww][Ss][Hh]) HTTP/1.[01]"
regex urllist3 ".*\.([Dd][Oo][Cc]|[Xx][Ll][Ss]|[Pp][Pp][Tt]) HTTP/1.[01]"
regex urllist4 ".*\.([Zz][Ii][Pp]|[Tt][Aa][Rr]|[Tt][Gg][Zz]) HTTP/1.[01]"
regex domainlist1 "\.op\.se"
regex contenttype "Content-Type"
regex applicationheader "application/.*"

ftp mode passive
clock timezone CEST 1
clock summer-time CEDT recurring last Sun Mar 2:00 last Sun Oct 3:00
same-security-traffic permit inter-interface
same-security-traffic permit intra-interface

object-group service httpgrp tcp
 port-object eq 8080

access-list inside_access_in extended permit ip any any 
access-list inside_access_in extended permit object-group DM_INLINE_SERVICE_3 any4 any inactive 
access-list inside_access_in extended permit gre any any inactive 
access-list inside_mpc extended permit object http any any  
access-list inside_mpc extended permit tcp any any object-group httpgrp
pager lines 24
logging enable
logging asdm informational
mtu inside 1500
mtu outside-telia 1500
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
no arp permit-nonconnected
object network obj_any
 nat (inside,outside-telia) dynamic interface
object network vpn_nat_outside
 nat (any,outside-telia) dynamic interface
access-group inside_access_in in interface inside
access-group outside-telia_access_in in interface outside-telia
route outside-telia 128
timeout xlate 3:00:00
timeout pat-xlate 0:00:30
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
timeout floating-conn 0:00:00
dynamic-access-policy-record DfltAccessPolicy
user-identity default-domain LOCAL
http server enable
http inside
http inside
http inside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart warmstart

dhcpd auto_config outside-telia
threat-detection basic-threat
threat-detection statistics port
threat-detection statistics protocol
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
ntp server source outside-telia prefer

class-map global-class
 match default-inspection-traffic
class-map type regex match-any DomainBlockList
 match regex domainlist1
class-map type regex match-any URLBlockList
 match regex urllist3
 match regex urllist4
 match regex urllist1
 match regex urllist2
class-map type inspect http match-all BlockURLClass
 match request uri regex class URLBlockList
class-map type inspect http match-all asdm_medium_security_methods
 match not request method post
 match not request method get
 match not request method head
class-map type inspect http match-all BlockDomainClass
 match request header host regex class DomainBlockList
class-map type inspect http match-all AppHeaderClass
 match request header regex contenttype regex applicationheader
class-map type inspect http match-all asdm_high_security_methods
 match not request method get
 match not request method head
class-map httptraffic
 match access-list inside_mpc
policy-map type inspect http http_inspection_policy
  protocol-violation action drop-connection
 match request method connect
  drop-connection log
 class BlockURLClass
  reset log
 class AppHeaderClass
  drop-connection log
 class BlockDomainClass
  reset log

policy-map global-policy
 class global-class
  inspect ftp 
  inspect pptp 
  inspect dns 
  inspect icmp 
  inspect icmp error 
  inspect http 
policy-map inside-policy
 class httptraffic
  inspect http http_inspection_policy 
service-policy global-policy global
service-policy inside-policy interface inside
prompt hostname context 
no call-home reporting anonymous
hpm topN enable
: end


Any help is appreciated

Thanks in advance,



Vibhor Amrodia
Cisco Employee
Cisco Employee


if i am not wrong , I think only the HTTPS Websites are working for you ?

Can you remove these REGEX and attached classes and see of this resolves the issue:-

regex contenttype "Content-Type"
regex applicationheader "application/.*"

Thanks and Regards,

Vibhor Amrodia

Hi and thanks for replying.

Yes, you were correct, it´s https that are working.
I tried removing these
regex urllist1 ".*\.([Ee][Xx][Ee]|[Cc][Oo][Mm]|[Bb][Aa][Tt]) HTTP/1.[01]"
regex urllist2 ".*\.([Pp][Ii][Ff]|[Vv][Bb][Ss]|[Ww][Ss][Hh]) HTTP/1.[01]"
regex urllist3 ".*\.([Dd][Oo][Cc]|[Xx][Ll][Ss]|[Pp][Pp][Tt]) HTTP/1.[01]"
regex urllist4 ".*\.([Zz][Ii][Pp]|[Tt][Aa][Rr]|[Tt][Gg][Zz]) HTTP/1.[01]"
regex contenttype "Content-Type"
regex applicationheader "application/.*"

But it made no difference



try to remove this Policy itself and see if this works:-

no service-policy inside-policy interface inside

Thanks and Regards,

Vibhor Amrodia

But if I remove that service policy rule I will at the same time remove http_inspection_policy which contains the Domain Class to block
If I may ask, what do you want to achieve by removing that rule?

Or am I missing something :)

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: