Recently in 走向CCIE之路-Security Category
虽然以前在生产网上就用过CBAC,但是对于inspect http和inspect ftp某些具体的行为还是有些不清楚,夜里下定决心一定要做实验弄明白。
实验前提:inspect http或者inspect ftp如果用在边界路由器连接ISP的接口出向,并且同时有访问控制列表用在该接口的入向,并且该acl不包含明确允许返回流量的条目(如:permit tcp any any或者permit ip any any)
在netlab上实验的结果得到下面2个结论:
1. inspect http和inspect ftp等使用时不需要与inspect tcp同时使用:既一旦使用了inspect http或者inspect ftp,那么对应的协议的返回流量会自动被允许。当然,需要是标准的服务端口,如果不是的话,需要手动设置PAM映射。
2. inspect http后面的java-list如果不使用的话,则所有内部访问外部的流量中的java applet都会被过滤,但是同一个页面中的其他内容(文字、图片等)不会受到影响。
之前看到很多文档都没有明确说明这点,有些文档甚至说不写java-list就不会过滤java applet。我做实验的结论是如果只写ip inspect name
*使用debug ip inspect http和debug ip inspect ftp可以看到等详细的连接检查过程。
据说CBAC这种IOS防火墙的功能是靠纯软件完成的,开启了之后会影响设备的性能。我曾经在某个Cisco高端设备上尝试CBAC功能,流量在几百兆的时候CPU基本上被占满了,设备几乎不响应。因此上述实验不推荐在任何生产设备上做!
9-11那天去考了安全的lab,感觉题目内容有些地方比较变态,但是整体看来还算是合理。
晚上得到的结果是76分,没能通过,虽然只需要再对一个题目就能pass。不过有些部分的得分低于我的预期了。也许确实是有些知识上的缺陷,也许我做的答案和所谓的标准答案有区别。深夜的时候提交了reread,我觉得自己对题目的理解和作答都是合理的,至于考官会怎么理解我的答案那就不知道了……据说整个reread过程需要3周,等3周之后再看了。
不论怎样对技术的学习和追求将一直继续下去。
由于订购的IP Phone迟迟没有到货,没法自己做实验检验在配置voice vlan的接口上如何同时配置port security。网上有些文档说需要将连接Cisco IP Phone的交换机接口最大mac数目设置成至少3个,有的说设置成至少2个,但是都没有给出明确的原因,让人不知道该怎么办。
晚上在Cisco的网站上逛,看到了一篇文档Cisco Unified Communications SRND Based on Cisco Unified CallManager 5.x (需要CCO)
Voice Security章节里面有下面一段话:
Either port security or dynamic port security can be used to inhibit a MAC flooding attack. A customer with no requirement to use port security as an authorization mechanism would want to use dynamic port security with the number of MAC addresses appropriate to the function attached to a particular port. For example, a port with only a workstation attached to it would want to limit the number of learned MAC addresses to one. A port with a Cisco Unified IP Phone and a workstation behind it would want to set the number of learned MAC addresses to two (one for the IP phone itself and one for the workstation behind the phone) if a workstation is going to plug into the PC port on the phone. This setting in the past has been three MAC addresses, used with the older way of configuring the port in trunk mode. If you use the multi-VLAN access mode of configuration for the phone port, this setting will be two MAC addresses, one for the phone and one for the PC plugged into the phone. If there will be no workstation on the PC port, then the number of MAC addresses on that port should be set to one. These configurations are for a multi-VLAN access port on a switch. The configuration could be different if the port is set to trunk mode (not the recommended deployment of an access port with a phone and PC).
看过之后明白了——通常在交换机上端口上设置voice vlan有两种办法:
(1) Switch(config-if)#switchport trunk encapsulation dot1q
Switch(config-if)#switchport trunk native vlan id !--- This is the VLAN with untagged frames used by the PC.
Switch(config-if)#switchport mode trunk !--- This enables trunking on the port for two VLANs, data and voice.
Switch(config-if)#switchport voice vlan id
Switch(config-if)#spanning-tree portfast trunk
(2)
interface Fa0/1
switchport access vlan data vlan id
switchport mode access
switchport voice vlan voice vlan id
spanning-tree portfast
第一种配置方法是比较老式的,并且按照文档上说,不推荐在PC和phone同时使用的时候用这样的配置模式。在使用第一种配置方式的时候,电话的MAC会出现在voice vlan和native vlan中,因此算上PC需要占用至少3个MAC;
第二种配置方法被称为“multi-VLAN access port”模式。在这样的情况下电话的MAC只会出现在voice vlan中,因此只需要2个MAC。
其实在Cisco的交换机中内置了一些已经写好的非常好用的macro,可以很方便我们直接配置特定类型的端口。比如cisco-phone这个宏:
C3750#show parser macro name cisco-phone
Macro name : cisco-phone
Macro type : default interface
# Cisco IP phone + desktop template
# macro keywords $access_vlan $voice_vlan
# VoIP enabled interface - Enable data VLAN
# and voice VLAN
# Recommended value for access vlan should not be 1
switchport access vlan $access_vlan
switchport mode access
# Update the Voice VLAN value which should be
# different from data VLAN
# Recommended value for voice vlan should not be 1
switchport voice vlan $voice_vlan
# Enable port security limiting port to a 2 MAC
# addressess -- One for desktop on data vlan and
# one for phone on voice vlan
switchport port-security
switchport port-security maximum 2
# Ensure port-security age is greater than one minute
# and use inactivity timer
switchport port-security violation restrict
switchport port-security aging time 2
switchport port-security aging type inactivity
# Enable auto-qos to extend trust to attached Cisco phone
auto qos voip cisco-phone
# Configure port as an edge network port
spanning-tree portfast
spanning-tree bpduguard enable
需要使用的时候接口模式调用即可:
C3750(config-if)#macro apply cisco-phone $access_vlan 20 $voice_vlan 80
C3750(config-if)#do sh run int g1/0/1
Building configuration...
Current configuration : 573 bytes
!
interface GigabitEthernet1/0/28
switchport access vlan 20
switchport mode access
switchport voice vlan 80
switchport port-security maximum 2
switchport port-security
switchport port-security aging time 2
switchport port-security violation restrict
switchport port-security aging type inactivity
srr-queue bandwidth share 10 10 60 20
srr-queue bandwidth shape 10 0 0 0
queue-set 2
mls qos trust device cisco-phone
mls qos trust cos
macro description cisco-phone
auto qos voip cisco-phone
spanning-tree portfast
spanning-tree bpduguard enable
end
具体怎么做shell command authorization不写了,遍地都是文档,记录一个经常被忽略的问题。
其实在cisco关于ACS的文档上写的很清楚,我们输入到设备上的命令并不一定是按照原样吐给ACS服务器去进行命令授权验证的。
Cisco文档中的例子,用户输入“interface FASTETHERNET 0/1”,吐给ACS服务器的命令和参数实际上是“interface FastEthernet 0 1”。实际上并不只是大小写变化和去掉"/"这么简单,如果打开"debug aaa authorization",我们可以看到设备吐出的实际命令。
几个有意思的实验:
1.执行copy startup flash:
输出入下:
时间: AAA: parse name=tty66 idb type=-1 tty=-1
时间: AAA: name=tty66 flags=0x11 type=5 shelf=0 slot=0 adapter=0 port=66 channel=0
时间: AAA/MEMORY: create_user (0x83CE97C0) user='sec' ruser='Router' ds0=0 port='tty66' rem_addr='10.0.1.2' authen_type=ASCII service=NONE priv=15 initial_task_id='0', vrf= (id=0)
时间: tty66 AAA/AUTHOR/CMD(712228085): Port='tty66' list='acs' service=CMD
时间: AAA/AUTHOR/CMD: tty66(712228085) user='sec'
时间: tty66 AAA/AUTHOR/CMD(712228085): send AV service=shell
时间: tty66 AAA/AUTHOR/CMD(712228085): send AV cmd=copy
时间: tty66 AAA/AUTHOR/CMD(712228085): send AV cmd-arg=startup-config
时间: tty66 AAA/AUTHOR/CMD(712228085): send AV cmd-arg=flash:c2600-jk9o3s-mz.123-22.bin
时间: tty66 AAA/AUTHOR/CMD(712228085): send AV cmd-arg=flash:123
时间: tty66 AAA/AUTHOR/CMD(712228085): send AV cmd-arg=<cr>
时间: tty66 AAA/AUTHOR/CMD(712228085): found list "acs"
时间: tty66 AAA/AUTHOR/CMD(712228085): Method=tacacs+ (tacacs+)
时间: AAA/AUTHOR/TAC+: (712228085): user=sec
时间: AAA/AUTHOR/TAC+: (712228085): send AV service=shell
时间: AAA/AUTHOR/TAC+: (712228085): send AV cmd=copy
时间: AAA/AUTHOR/TAC+: (712228085): send AV cmd-arg=startup-config
时间: AAA/AUTHOR/TAC+: (712228085): send AV cmd-arg=flash:c2600-jk9o3s-mz.123-22.bin
时间: AAA/AUTHOR/TAC+: (712228085): send AV cmd-arg=flash:123
时间: AAA/AUTHOR/TAC+: (712228085): send AV cmd-arg=<cr>
可以注意要送到ACS上进行授权的命令是copy,命令参数有3个,分别是startup-config(自动补齐)、flash:(2个flash中已经有的文件自动列出都作为参数送出)、<cr>(换行)
如果用ACS授权允许,则可以将命令参数写为"permit ^startup-config flash:"
2.执行copy start tftp:
过程如下:
Router#copy startup-config tftp://1.1.1.1
时间: AAA: parse name=tty66 idb type=-1 tty=-1
时间: AAA: name=tty66 flags=0x11 type=5 shelf=0 slot=0 adapter=0 port=66 channel=0
时间: AAA/MEMORY: create_user (0x8392F428) user='sec' ruser='Router' ds0=0 port='tty66' rem_addr='10.0.1.2' authen_type=ASCII service=NONE priv=15 initial_task_id='0', vrf= (id=0)
时间: tty66 AAA/AUTHOR/CMD(3197202628): Port='tty66' list='acs' service=CMD
时间: AAA/AUTHOR/CMD: tty66(3197202628) user='sec'
时间: tty66 AAA/AUTHOR/CMD(3197202628): send AV service=shell
时间: tty66 AAA/AUTHOR/CMD(3197202628): send AV cmd=copy
时间: tty66 AAA/AUTHOR/CMD(3197202628): send AV cmd-arg=startup-config
时间: tty66 AAA/AUTHOR/CMD(3197202628): send AV cmd-arg=<cr>
时间: tty66 AAA/AUTHOR/CMD(3197202628): found list "acs"
时间: tty66 AAA/AUTHOR/CMD(3197202628): Method=tacacs+ (tacacs+)
时间: AAA/AUTHOR/TAC+: (3197202628): user=sec
时间: AAA/AUTHOR/TAC+: (3197202628): send AV service=shell
时间: AAA/AUTHOR/TAC+: (3197202628): send AV cmd=copy
时间: AAA/AUTHOR/TAC+: (3197202628): send AV cmd-arg=startup-config
时间: AAA/AUTHOR/TAC+: (3197202628): send AV cmd-arg=<cr>
比较有意思的是tftp及后面url中所带的内容都没有被送到ACS上,而仅仅送了一个<cr>过去。我对此的理解是路由器无法事先登录到远端的服务器(tftp)上来列出更多的参数,因此直接送出<cr>替代。
3.执行copy tftp: null:
命令的含义是从tftp服务器上复制一个文件直接送到null文件系统(实际上是直接丢弃),可以用来测试tftp服务器是否能连接上。
过程如下:
Router#copy tftp: null:
时间: AAA: parse name=tty66 idb type=-1 tty=-1
时间: AAA: name=tty66 flags=0x11 type=5 shelf=0 slot=0 adapter=0 port=66 channel=0
时间: AAA/MEMORY: create_user (0x83973290) user='sec' ruser='Router' ds0=0 port='tty66' rem_addr='10.0.1.2' authen_type=ASCII service=NONE priv=15 initial_task_id='0', vrf= (id=0)
时间: tty66 AAA/AUTHOR/CMD(674610135): Port='tty66' list='acs' service=CMD
时间: AAA/AUTHOR/CMD: tty66(674610135) user='sec'
时间: tty66 AAA/AUTHOR/CMD(674610135): send AV service=shell
时间: tty66 AAA/AUTHOR/CMD(674610135): send AV cmd=copy
时间: tty66 AAA/AUTHOR/CMD(674610135): send AV cmd-arg=<cr>
时间: tty66 AAA/AUTHOR/CMD(674610135): found list "acs"
时间: tty66 AAA/AUTHOR/CMD(674610135): Method=tacacs+ (tacacs+)
时间: AAA/AUTHOR/TAC+: (674610135): user=sec
时间: AAA/AUTHOR/TAC+: (674610135): send AV service=shell
时间: AAA/AUTHOR/TAC+: (674610135): send AV cmd=copy
时间: AAA/AUTHOR/TAC+: (674610135): send AV cmd-arg=<cr>
可以看到由于tftp和null都没有办法直接通过设备访问到,没法列出更具体的参数,即无法补齐,因此送到ACS的命令仅仅是命令copy和参数<cr>。
4.是否所有的带有":"的都会被当作<cr>直接送给ACS呢?在2600系列路由器上测试之后的结论是nvram: system: flash: 会将所有的文件作为参数的一部分自动补齐送给ACS作授权。我推测在其他的设备上类似的disk0: disk1:之类实际上可以被直接访问到的存储设备也都会将设备内的文件作为参数补齐自动送到ACS上参数授权过程。
连续几天都在做各种FW和VPN的实验。有了之前的路由和交换的知识作为基础,外加对ACL的理解,一段时间以来做实验都还算顺利。
发现做安全方面的实验和做路由方面的实验感觉不太一样——做安全实验的时在作配置的同时脑中似乎浮现出了一幅三维的网络拓扑图,不同的流量穿越不同的设备,走各种各样的路径;有些流量经过VPN的时候被转换成了ESP,穿过防火墙的时候acl似乎就是留给特定“形状”流量的一个一个小洞;不同的流量和不同的设备的颜色似乎也是不一样的。
不知道为什么会有这样的感觉,之前做路由和交换实验的时候,脑子里面确实也有图像,但是那只是网络的拓扑,在做安全实验的时候拓扑变成立体的了!
今天在某个设备上配了个IPSEC vpn隧道。在配置结束后遇到了个问题就是ezvpn客户端拨入之后如果跨设备访问丢包,并且偶尔在console上会出%CRYPTO-4-RECVD_PKT_MAC_ERR的错误。网上搜索了一下发现这个报错有可能和route-cache有关。
在应用crypto map的接口上敲上no ip route-cache解决了问题。
但是如果完全禁用route-cache由担心设备的cpu受不了,在接口上尝试了ip route-cache cef、ip route-cache flow两种方式,发现其实是cef方式的route-cache造成的丢包。
对cef的工作原理还不是很了解,只知道大概的原理。虽然仍然不太明白根本的原因是什么,但是解决了问题—我想在接口上使用ip route-cache flow的方式可能要比单纯的禁用route-cache好。
IPSec隧道有个问题,只能传递单播的流量。如果想利用IPSec隧道传递组播和广播流量,那么只能采用在IPSec中封一层GRE隧道,让组播和广播流量在GRE中传递。
GRE over IPSec的配置方法和IPSec L2L没有什么特别大的区别,需要注意的是,定义感兴趣流时应为tunnel的source ip和destination ip,流量类型为GRE。
测试方法:
1.测试IPSec隧道是否建立成功。
2.在tunnel上互相ping,或者建立OSPF邻居以便检查组播流量是否成功传递。
crypto ipsec client ezvpn ez
connect manual 手动连接
group vpngroup key groupkey 组名vpngroup,组密码groupkey
local-address FastEthernet0/1 使用fa0/1发起连接
mode client 使用客户模式
peer 10.0.1.1 ezvpn服务器10.0.1.1
interface Loopback0
ip address 9.9.9.9 255.255.255.0
crypto ipsec client ezvpn ez inside 使用咯opback口模拟内部用户
interface FastEthernet0/1
ip address 10.0.1.2 255.255.255.0
crypto ipsec client ezvpn ez标记使用fa0/1发起vpn连接(outside)
配置完成后手动建立vpn连接:
R1#cry ipsec client ezvpn connect 建立连接
R1#crypto ipsec client ezvpn connect
EZVPN(ez): IPSec connection terminated
R1#crypto ipsec client ezvpn xauth 输入认证的用户名密码
Username: cisco
Password:
R1#show crypto ipsec client ezvpn 检查建立好的连接
Easy VPN Remote Phase: 2
Tunnel name : ez
Inside interface list: Loopback0
Outside interface: FastEthernet0/1
Current State: IPSEC_ACTIVE
Last Event: SOCKET_UP
Address: 7.7.7.1
Mask: 255.255.255.255
1. 建立一个用户(vpn登录本地验证) username cisco password cisco
2.phase 1 制定ISAKMP策略
crypto isakmp enable outside 在outside接口上启用isakmp,默认isakmp是不启用的,这点与路由器不一样
crypto isakmp policy 10 建立isakmp策略
authentication pre-share 预共享密钥验证
encryption aes aes加密
hash sha 使用sha1 hash校验
group 2 使用DH group2
lifetime 86400 有效期1天(默认)
3. "phase 1.5" 配置组
group-policy vpngroup internal 内部组策略
access-list sp extended permit ip 1.1.1.0 255.255.255.0 any建立一个用于标记流量分割的acl
group-policy vpngroup attributes 组策略
vpn-tunnel-protocol IPSec 使用IPSec作为隧道协议
split-tunnel-policy tunnelspecified 表示分割流量是acl明确标记出来的
split-tunnel-network-list value sp acl名为sp的流量需要使用加密隧道传输
tunnel-group vpngroup type ipsec-ra 组vpngroup是ipsec remote access类型的
ip local pool localpool 192.168.1.1-192.168.1.100 建立一个地址池名为localpool
tunnel-group vpngroup general-attributes 针对该组的一般属性(地址、dns等)
address-pool localpool 地址池使用名为localpool的
default-group-policy vpngroup 该组使用的策略名叫做vpngroup
tunnel-group vpngroup ipsec-attributes 针对该组的ipsec属性
pre-shared-key groupkey 共享密钥为"groupkey",配置好之后show run看到的共享密钥应该显示为"*"。
4.配置phase 2
crypto ipsec transform-set ts esp-3des esp-md5-hmac 建立一个转换集使用3des加密,md5验证
crypto dynamic-map dmap 10 set transform-set ts 建立一个动态map调用该转换集
crypto map cmap 1000 ipsec-isakmp dynamic dmap 建立一个静态map调用动态map dmap
crypto map cmap interface outside在接口上应用静态map cmap
1.启用AAA
aaa new-model 启用AAA
aaa authentication login vpnauth local 建立一个叫做vpnauth的认证组使用路由器本地用户名密码做登录认证
aaa authorization network vpnauthor local 建立一个叫做vpnauthor的授权组用来给vpn拨入用户分配地址使用
username cisco password cisco 建立一个本地用户cisco密码为cisco作为vpn用户
2.配置phase 1
crypto isakmp policy 10
encr aes 使用AES加密
authentication pre-share 使用预共享密钥
group 2 使用DH group2
3.配置"phase 1.5" (xauth)
crypto isakmp xauth timeout 10 设置xauth认证超时时间10秒
crypto isakmp client configuration group vpngroup 建立一个ezvpn的组,组名为vpngroup
key groupkey 组密码为groupkey
pool localpool针对改组分配ip的地址池为localpool
acl lo 针对该组的split tunnel acl
crypto isakmp profile isapro 建立一个isakmp profile,使用profile的好处是可以针对不同的组采用不同的认证和授权策略
match identity group vpngroup 该profile对应的组为vpngroup
client authentication list vpnauth 针对客户端使用vpnauth进行认证
isakmp authorization list vpnauthor 针对客户端使用vpnauth进行授权(针对该配置是地址的分配)
client configuration address respond 回应客户端发起的地址请求,针对新版的cisco vpn client通常都使用respond方式
keepalive 10 retry 3 保持10秒,最多重试认证3次
ip local pool localpool 9.9.9.1 9.9.9.10建立一个本地地址池
4.配置phase 2
crypto ipsec transform-set ts esp-aes esp-sha-hmac建立转换集使用aes加密和sha hash验证
!
crypto dynamic-map dmap 10 建立动态map
set transform-set ts 调用转换集ts
set isakmp-profile isapro 调用isakmp-profile
reverse-route 当客户端拨入后在路由器上注入客户端的静态主机路由
!
!
crypto map cmap 1000 ipsec-isakmp dynamic dmap 建立一个静态map并且调用刚建立的动态map dmap
在vpn拨入请求可能进入的接口上调用crypto map cmap
5.使用VPN客户端连接
组名使用vpngroup,组密码使用groupkey。用户名使用cisco,密码使用cisco。
phase 1主要作用是vpn客户端和vpn接入点互相认证,以便确认对方的身份;phase2主要作用是协商针对特定的流量采用什么样的加密传输策略以及传输数据的完整性校验策略。
phase 1分为3步(共6个数据包),举例说明:
(1)A-->B :我支持的针对认证的加密策略有AES,DES,3DES...hash方法有md5/sha,认证方法采用pre-sharekey,rsa加密,rs签名,Diffie-Hellman使用Group1,2,或5,认证有效时间为x秒等
B-->A:你提出的针对认证策略第N项我同意接受使用
(2)A<-->B 执行Diffie-Hellman交换,产生公共密钥
(3)A<-->B 使用协商好的认证策略以及产生的会话密钥传输加密的pre-sharekey或者证书等,互相进行认证。
对应的Cisco Router配置举例如下:
R1(config)#crypto isakmp policy 10
R1(config-isakmp)# encr aes //使用AES加密
R1(config-isakmp)# authentication pre-share //使用预共享密钥验证
R1(config-isakmp)# group 2 //使用DH group2
R1(config-isakmp)#crypto isakmp key r1r2cisco address 172.30.2.2 //将密钥与对端进行绑定
phase 2分为2步(共3个数据包),举例说明:
(1)A-->B: 我支持的针对数据传输的策略有ah-md5-hmac,ah-sha-hmac,esp-3des,esp-md5-hmac,感兴趣的数据流为某个流,是否启用PFS等
B-->A: 我们选用其中的某个策略来作为加密传输的策略
(2)A-->B: OK,开始用这个策略传输吧
R1(config-isakmp-peer)#crypto ipsec transform-set ts esp-3des esp-sha-hmac //定义传输数据和完整性验证的策略
R1(cfg-crypto-trans)#crypto map cmap 10 ipsec-isakmp
R1(config-crypto-map)# set peer 172.30.2.2 //对端ip
R1(config-crypto-map)# set transform-set ts //将transfor-set与ipsec策略进行绑定
R1(config-crypto-map)# set pfs group2 //启用完美向前
R1(config-crypto-map)# match address loop //匹配感兴趣流
R1(config)#ip access-list extended loop
R1(config-ext-nacl)# permit ip host 1.1.1.1 host 2.2.2.2 //定义感兴趣流的访问控制列表
以上都配置好之后对于网络设备还需进行下面配置:
1. 在流量送出的接口上应用crypto map
2. 将感兴趣流的目的地址加入到路由表中(不一定非要精确匹配,只要能覆盖即可),然后将流量引导到送出接口
有些情况可能会出现返回的流量从另外的接口进入的情况,流量进入的接口不一定非要有crypto map,但是如果在所有可能返回流量的接口上写上crypto map是有好处的:当流量被crypto map中的感兴趣流匹配后,如果发现是没有被加密的流量,则直接丢弃,这样可以从一定程度上防止spoofing。
IPSEC L2L VPN使用的都是标准的公开的协议,任何厂家的设备只要支持标准的IPSEC VPN都可以实现互通。对于cisco设备默认的ISAKMP SA有效期是86400秒(1天),IPSEC SA有效期是1小时。在不同厂家互联的时候有些时候可能会忽略到有效期的问题,如果有效期不一致则一样没法连通。
|
| PIX/ASA
| Router IOS
|
| ACL的格式 | 使用netmask access-list test extended permit ip host 1.1.1.1 120.1.1.0 255.255.255.0 | 使用wildcard mask access-list 100 permit ip host 1.1.1.1 120.1.1.0 0.255.255.255 |
| 应用ACL | 在全局应用 access-group test in interface inside | 在接口下应用 Access-group 100 in |
| 作用范围 | 只对穿越的流量有效,并且只匹配无状态信息的数据包 | 所有到达该接口的流量都会先经过acl的检查,然后才会送到接口做进一步处理 |
PIX和ASA在7.x上默认是不检查穿越防火墙的icmp的状态的,这意味着从内向外做出的ping操作只能单向穿越防火墙,被ping设备回应的icmp echo-reply无法穿越防火墙——防火墙会认为这些数据包是来自安全级别低的外网的,不可以穿过。
默认情况下,PIX/ASA 7.x会监控下面这些协议的状态:
policy-map type inspect dns preset_dns_map
parameters
message-length maximum 512
policy-map global_policy
class inspection_default
inspect dns preset_dns_map
inspect ftp
inspect h323 h225
inspect h323 ras
inspect rsh
inspect rtsp
inspect esmtp
inspect sqlnet
inspect skinny
inspect sunrpc
inspect xdmcp
inspect sip
inspect netbios
inspect tftp
!
service-policy global_policy global
在PIX/ASA不做任何安全配置的情况下,内网用户是可以正常发起向外的TCP请求,也可以正常使用FTP等需要反向穿越防火墙的协议的(inspect FTP)。使用下面的命令可以实现让内网用户可以收到正常ping到外网的echo-reply回应:
pixfirewall(config)# policy-map global_policy
pixfirewall(config-pmap)# class inspection_default
pixfirewall(config-pmap-c)# inspect icmp
感谢PP提供的资料。
由于PIX和ASA这样的防火墙为了防止TCP会话劫持通常都会对穿越防火墙的tcp会话序列号做主动的扰乱,而BGP会话如果启用了md5认证会把包头部分作为md5 hash计算的一部分,一旦PIX/ASA主动修改了tcp的序列号,那么作为md5 hash计算部分的包头显然也和以前的不一样了。
这时会在路由器上看到类似下面的信息:
%TCP-6-BADAUTH: Invalid MD5 digest from 源IP:源端口 to 目的IP:179
在6.x上的解决办法是针对启用BGP的路由器禁用TCP序列号扰乱功能:
static (inside,outside) a.b.c.d a.b.c.d netmask 255.255.255.255 norandomseq
在7.x上如果只做类似上面这样的配置是仍然有问题的:如果不做特殊配置,用作BGP md5认证的tcp option19会在穿越7.x版本的PIX/ASA防火墙时被直接"抹平"。为了支持带有md5认证的BGP还需要做出类似下面的配置,以便允许TCP option 19穿越防火墙:
class-map BGP-MD5-CLASSMAP
match port tcp eq 179
tcp-map BGP-MD5
tcp-options range 19 19 allow
policy-map global_policy
class BGP-MD5-CLASSMAP
set connection advanced-options BGP-MD5
service-policy global_policy global
更多资料可以参考下面的文档:
1. Sample Configurations of BGP Across a PIX Firewall
2. Guide for Cisco PIX 6.2 and 6.3 Users Upgrading to Cisco PIX Software Version 7.0
其实大多数情况下不会用防火墙跑动态路由协议的,动态路由协议本身严格的说就是一种不确定因素,所欧的不确定因素都是有可能影响最终的安全的。从技术的角度上看,PIX是可以支持动态路由协议的,如果一定要去支持的话……
在PIX 7.2上配置RIP MD5方式认证的方法很简单:
1. 启用rip协议,7.x之后的版本PIX的CLI界面和IOS的操作界面几乎一样了:
router rip
no auto-summary
version 2
network ...
2.在接口上指名要使用MD5认证:
interface Ethernet0
nameif 名称
security-level 某个代表安全级别的数字
ip address ...
rip authentication mode md5
rip authentication key 预先约定的key-string key_id 某个数字
其实和路由器上的配置基本上一样,区别在于:
1.在PIX上不是单独配置的key-chain
2.PIX是接口下的命令直接写rip,在路由器上需要写ip rip...
前几天收到cisco的信件说CCIE Security的笔试1.0版的考试时间延长到4月24号(CCIE Security Written v1.0 Extension)。抓紧时间复习了几天,今天下午考了1.0版的350-018,顺利通过。
刚才对照了一下1.0版的考纲和2.0版的考纲,似乎2.0版的内容更加琐碎了。不知道相应的辅导资料什么时候能出来,继续买书,继续做实验……
...



