温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

ASA防火墙上做基于域名的URL过滤

发布时间:2020-06-29 19:47:09 来源:网络 阅读:1870 作者:sxw900725 栏目:安全技术

实验


实验拓扑图:

ASA防火墙上做基于域名的URL过滤

实验环境:

 

server2008服务器上搭建WEB网站和DNS服务,分别创建域名为benet.comaccp.com两个网站。

 

实验要求:

 

首先客户端可以访问服务器上的两个网站,成功后在防火墙上做URL过滤使客户端无法访问accp.com网站。

 

实验步骤:


首先在ASA防火墙上配置各区域名称和IP地址:

 

ciscoasa(config)# int e0/0

ciscoasa(config-if)# nameif inside

ciscoasa(config-if)# ip add 192.168.10.1 255.255.255.0

ciscoasa(config-if)# no shut

ciscoasa(config-if)# int e0/1

ciscoasa(config-if)# nameif outside

ciscoasa(config-if)# ip add 13.0.0.1 255.255.255.0

ciscoasa(config-if)# no shut

 

 

在服务器上创建两个网站,指定网站存放位置和域名:


创建accp.com网站:

ASA防火墙上做基于域名的URL过滤

创建benet.com网站:


ASA防火墙上做基于域名的URL过滤



指定DNS主机A记录:

ASA防火墙上做基于域名的URL过滤


ASA防火墙上做基于域名的URL过滤


测试用客户端访问者两个网站:


ASA防火墙上做基于域名的URL过滤

ASA防火墙上做基于域名的URL过滤


测试访问成功:

 

 

接下来在防火墙上做URL过滤使客户端无法访问accp.com网站。

 

ASA上的配置:

 

URL过滤需要下面三个步骤;

 

url过滤

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

 

ciscoasa(config)# access-list aclfile permit tcp 192.168.10.0 255.255.255.0 an$   //定义ACL访问控制列表aclfile

ciscoasa(config)# class-map aclclass   //建立类映射aclclass

ciscoasa(config-cmap)# match access-list aclfile  //匹配访问控制列表。

ciscoasa(config-cmap)# regex url "\.accp\.com"  //定义正则表达式,过滤不允许访问的网站。

ciscoasa(config)# class-map type regex match-any urlclass  //建立类映射urlclass,关键字match-any表示匹配任何一个。

ciscoasa(config-cmap)# match regex url  //调用匹配正则表达式。

ciscoasa(config-cmap)# ex

ciscoasa(config)# class-map type inspect http httpclass  //建立检查流量的类映射

ciscoasa(config-cmap)# match request header host regex class urlclass  //调用之前已配置好的urlclass

 

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

 

ciscoasa(config)# policy-map type inspect http httppolicy  //建立策略映射。

ciscoasa(config-pmap)# class httpclass  //调用已经做好的检查http头部的类映射。

ciscoasa(config-pmap-c)# drop-connection log   //丢弃并记录日志。

ciscoasa(config-pmap-c)# policy-map insidepolicy  //对访问控制列表进行操作,定义相应策略。

ciscoasa(config-pmap)# class aclclass  //调用访问控制列表的类映射。

ciscoasa(config-pmap-c)# inspect http httppolicy  //检查定义好的策略映射。

 

 

三, 应用class-map到接口上。

 

ciscoasa(config)# service-policy insidepolicy interface inside //应用在端口。

 

测试使用客户端访问accp.com网站:


ASA防火墙上做基于域名的URL过滤


结果显示为无法访问:

 

实验完成


向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI