ASA之URL过滤-拒绝与工作无关的网站

实施URL过滤一般分为三个步骤:

1.创建class-map(类映射),识别传输流量

2.创建policy-map(策略映射),关联class-map

3.应用policy-map到街口上

配置如下:

第一层

ciscoasa(config)#access-listtcp_filter1permittcp10.1.1.0255.255.255.0anyeqwww

匹配ACL:

ciscoasa(config)#class-maptcp_filter_class1

ciscoasa(config-cmap)#matchaccess-listtcp_filter1

按照http_url_policy规则检测http流量

ciscoasa(config-cmap)#policy-mapinside_http_url_policy

ciscoasa(config-pmap)#classtcp_filter_class1

ciscoasa(config-pmap-c)#inspecthttphttp_url_policy1

应用到接口上

ciscoasa(config)#service-policyinside_url_policyinterfaceinside

第二层

只要在检查http请求报文包头的host字段的过程中发现url_class1所规定的字段

ciscoasa(config-cmap)#matchrequestheaderhostregexcla
ciscoasa(config-cmap)#matchrequestheaderhostregexclassurl_class1

丢弃该报并记录到日志中

ciscoasa(config)#policy-maptypeinspecthttphttp_url_policy1
ciscoasa(config-pmap)#classhttp_url_class1
ciscoasa(config-pmap-c)#drop-connectionlog

第三层

URL_class1所规定的字段需要匹配正则表达则表达式url1

ciscoasa(config)#class-maptyperegexmatch-anyurl_class1
ciscoasa(config-cmap)#matchregexurl1