资源描述
Cisco路由器安全配置基线
中国移动通信有限公司 管理信息系统部
2012年 04月
版本
版本控制信息
更新日期
更新人
审批人
V1.0
创建
2009年1月
V2.0
更新
2012年4月
备注:
1. 若此文档需要日后更新,请创建人填写版本控制表格,否则删除版本控制表格。
目 录
第1章 概述 1
1.1 目的 1
1.2 适用范围 1
1.3 适用版本 1
1.4 实施 1
1.5 例外条款 1
第2章 帐号管理、认证授权安全要求 2
2.1 帐号管理 2
2.1.1 用户帐号分配* 2
2.1.2 删除无关的帐号* 3
2.1.3 限制具备管理员权限的用户远程登录* 4
2.2 口令 5
2.2.1 静态口令以密文形式存放 5
2.2.2 帐号、口令和授权 6
2.2.3 密码复杂度 7
2.3 授权 8
2.3.1 用IP协议进行远程维护的设备使用SSH等加密协议 8
第3章 日志安全要求 11
3.1 日志安全 11
3.1.1 对用户登录进行记录 11
3.1.2 记录用户对设备的操作 12
3.1.3 开启NTP服务保证记录的时间的准确性 13
3.1.4 远程日志功能* 14
第4章 IP协议安全要求 17
4.1 IP协议 17
4.1.1 配置路由器防止地址欺骗 17
4.1.2 系统远程服务只允许特定地址访问 18
4.1.3 过滤已知攻击 20
4.2 功能配置 21
4.2.1 功能禁用* 21
4.2.2 启用协议的认证加密功能* 23
4.2.3 启用路由协议认证功能* 24
4.2.4 防止路由风暴 26
4.2.5 防止非法路由注入 27
4.2.6 SNMP的Community默认通行字口令强度 28
4.2.7 只与特定主机进行SNMP协议交互 29
4.2.8 配置SNMPV2或以上版本 30
4.2.9 关闭未使用的SNMP协议及未使用RW权限 31
4.2.10 LDP协议认证功能 31
第5章 其他安全要求 33
5.1 其他安全配置 33
5.1.1 关闭未使用的接口 33
5.1.2 修改路由缺省器缺省BANNER语 34
5.1.3 配置定时账户自动登出 34
5.1.4 配置consol口密码保护功能 36
5.1.5 关闭不必要的网络服务或功能 37
5.1.6 端口与实际应用相符 38
第6章 评审与修订 40
第1章 概述
1.1 目的
本文档规定了中国移动管理信息系统部所维护管理的Cisco路由器应当遵循的设备安全性设置标准,本文档旨在指导系统管理人员进行Cisco路由器的安全配置。
1.2 适用范围
本配置标准的使用者包括:网络管理员、网络安全管理员、网络监控人员。
本配置标准适用的范围包括:中国移动总部和各省公司信息化部门维护管理的Cisco路由器。
1.3 适用版本
Cisco路由器。
1.4 实施
本标准的解释权和修改权属于中国移动集团管理信息系统部,在本标准的执行过程中若有任何疑问或建议,应及时反馈。
本标准发布之日起生效。
1.5 例外条款
欲申请本标准的例外条款,申请人必须准备书面申请文件,说明业务需求和原因,送交中国移动通信有限公司管理信息系统部进行审批备案。
第2章 帐号管理、认证授权安全要求
2.1 帐号管理
2.1.1 用户帐号分配*
安全基线项目名称
用户帐号分配安全基线要求项
安全基线编号
SBL-CiscoRouter-02-01-01
安全基线项说明
应按照用户分配帐号。避免不同用户间共享帐号。避免用户帐号和设备间通信使用的帐号共享。
检测操作步骤
1. 参考配置操作
Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# service password-encryption
Router(config)# username ruser1 password 3d-zirc0nia
Router(config)# username ruser1 privilege 1
Router(config)# username ruser2 password 2B-or-3B
Router(config)# username ruser2 privilege 1
Router(config)# end
Router#
2. 补充操作说明
基线符合性判定依据
1. 判定条件
I. 配置文件中,存在不同的帐号分配
II. 网络管理员确认用户与帐号分配关系明确
2. 检测操作
使用show running-config命令,如下例:
router#show running-config
Building configuration...
Current configuration:
!
service password-encryption
username ruser1 password 3d-zirc0nia
username ruser1 privilege 1
username ruser2 password 2B-or-3B
username ruser2 privilege 1
3. 补充说明
使用共享帐号容易造成职责不清
备注
需要手工检查,由管理员确认帐号分配关系。
2.1.2 删除无关的帐号*
安全基线项目名称
无关的帐号安全基线要求项
安全基线编号
SBL-CiscoRouter-02-01-02
安全基线项说明
应删除与设备运行、维护等工作无关的帐号。
检测操作步骤
1.参考配置操作
Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# no username ruser3
2.补充操作说明
基线符合性判定依据
1. 判定条件
I. 配置文件存在多帐号
II. 网络管理员确认所有帐号与设备运行、维护等工作有关
2. 检测操作
使用show running-config命令,如下例:
router#show running-config
Building configuration...
Current configuration:
!
username user1 privilege 1 password password1
username nobodyuse privilege 1 password password1
3. 补充说明
删除不用的帐号,避免被利用
备注
需要手工检查,由管理员判断是否存在无关帐号
2.1.3 限制具备管理员权限的用户远程登录*
安全基线项目名称
限制具备管理员权限的用户远程登录安全基线要求项
安全基线编号
SBL-CiscoRouter-02-01-03
安全基线项说明
限制具备管理员权限的用户远程登录。远程执行管理员权限操作,应先以普通权限用户远程登录后,再通过enable命令进入相应级别再后执行相应操作。
检测操作步骤
1. 参考配置操作
Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# service password-encryption
Router(config)# username normaluser password 3d-zirc0nia
Router(config)# username normaluser privilege 1
Router(config)# line vty 0 4
Router(config-line)# login local
Router(config-line)# exec-timeout 5 0
Router(config-line)# end
2. 补充操作说明
设定帐号密码加密保存
创建normaluser帐号并指定权限级别为1;
设定远程登录启用路由器帐号验证;
设定超时时间为5分钟;
基线符合性判定依据
1. 判定条件
I. VTY使用用户名和密码的方式进行连接验证
II. 2、帐号权限级别较低,例如:I
2. 检测操作
使用show running-config命令,如下例:
router#show running-config
Building configuration...
Current configuration:
!
service password-encryption
username normaluser password 3d-zirc0nia
username normaluser privilege 1
line vty 0 4
login local
3. 补充说明
会导致远程攻击者通过黑客工具猜解帐号口令
备注
根据业务场景,自动化系统如果无法实现可不选此项,人工登录操作需要遵守此项规范。
2.2 口令
2.2.1 静态口令以密文形式存放
安全基线项目名称
静态口令安全基线要求项
安全基线编号
SBL-CiscoRouter-02-02-01
安全基线项说明
静态口令必须使用不可逆加密算法加密,以密文形式存放。如使用enable secret配置Enable密码,不使用enable password配置Enable密码。
检测操作步骤
1. 参考配置操作
Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#service password-encryption
Router(config)# enable secret 2-mAny-rOUtEs
Router(config)# no enable password
Router(config)# end
2. 补充操作说明
基线符合性判定依据
1. 判定条件
配置文件无明文密码字段
2. 检测操作
使用show running-config命令,如下例:
router#show running-config
Building configuration...
Current configuration:
!
service password-encryption
enable secret 5 $1oxphetTb$rTsF$EdvjtWbi0qA2g
username ciscoadmin password 7 Wbi0qA1$rTsF$Edvjt2gpvyhetTb
3. 补充说明
如果不加密,使用show running-config命令,可以看到未加密的密码
备注
2.2.2 帐号、口令和授权
安全基线项目名称
帐号、口令和授权安全基线要求项
安全基线编号
SBL-CiscoRouter-02-02-02
安全基线项说明
设备通过相关参数配置,与认证系统联动,满足帐号、口令和授权的强制要求。
检测操作步骤
1. 参考配置操作
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#aaa new-model
Router(config)#aaa authentication login default group tacacs+
Router(config)#aaa authentication enable default group tacacs+
Router(config)#tacacs-server host 192.168.6.18
Router(config)#tacacs-server key Ir3@1yh8n#w9@swD
Router(config)#end
Router#
2. 补充操作说明
与外部TACACS+ server 192.168.6.18 联动,远程登录使用TACACS+ serverya验证
基线符合性判定依据
1. 判定条件
帐号、口令配置,指定了认证系统
2. 检测操作
使用show running-config命令,如下例:
router#show running-config
Building configuration...
Current configuration:
!
aaa new-model
aaa authentication login default group tacacs+
aaa authentication enable default group tacacs+
tacacs-server host 192.168.6.18
tacacs-server key Ir3@1yh8n#w9@swD
补充说明
备注
2.2.3 密码复杂度
安全基线项目名称
密码复杂度安全基线要求项
安全基线编号
SBL-CiscoRouter-02-02-03
安全基线项说明
对于采用静态口令认证技术的设备,口令长度至少8位,并包括数字、小写字母、大写字母和特殊符号四类中至少两类。且5次以内不得设置相同的口令。密码应至少每90天进行更换。
检测操作步骤
1. 参考配置操作
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#aaa new-model
Router(config)#aaa authentication login default group tacacs+
Router(config)#aaa authentication enable default group tacacs+
Router(config)#tacacs-server host 192.168.6.18
Router(config)#tacacs-server key Ir3@1yh8n#w9@swD
Router(config)#end
Router#
2. 补充操作说明
与外部TACACS+ server 192.168.6.18 联动,远程登录使用TACACS+ serverya验证;口令强度由TACACS+ server控制
基线符合性判定依据
备注
2.3 授权
2.3.1 用IP协议进行远程维护的设备使用SSH等加密协议
安全基线项目名称
IP协议进行远程维护的设备安全基线要求项
安全基线编号
SBL-CiscoRouter-02-03-01
安全基线项说明
对于使用IP协议进行远程维护的设备,设备应配置使用SSH等加密协议。
检测操作步骤
1. 参考配置操作
I. 配置主机名和域名
router# config t
Enter configuration commands, one per line. End with CNTL/Z.
router(config)# hostname Router
Router(config)# ip domain-name Router.domain-name
II. 配置访问控制列表
Router(config)# no access-list 12
Router(config)# access-list 12 permit host 192.168.0.200
Router(config)# line vty 0 4
Router(config-line)# access-class 12 in
Router(config-line)# exit
III. 配置帐号和连接超时
Router(config)# service password-encryption
Router(config)# username normaluser password 3d-zirc0nia
Router(config)# username normaluser privilege 1
Router(config)# line vty 0 4
Router(config-line)# login local
Router(config-line)# exec-timeout 5 0
IV. 生成rsa密钥对
Router(config)# crypto key generate rsa
The name for the keys will be: Router.domain-name
Choose the size of the key modulus in the range of 360 to
2048 for your General Purpose Keys. Choosing a key modulus
greater than 512 may take a few minutes.
How many bits in the modulus [512]: 2048
Generating RSA Keys ...
[OK]
V. 配置仅允许ssh远程登录
Router(config)# line vty 0 4
Router(config-line)# transport input ssh
Router(config-line)# exit
Router(config)#
2. 补充操作说明
配置描述:
I. 配置ssh要求路由器已经存在主机名和域名
II. 配置访问控制列表,仅授权192.168.0.200访问192.168.0.100 ssh
III. 配置远程访问里连接超时
IV. 生成rsa密钥对,如果已经存在可以使用以前的。默认存在rsa密钥对sshd就启用,不存在rsa密钥对sshd就停用。
V. 配置远程访问协议为ssh
基线符合性判定依据
1. 判定条件
I. 存在rsa密钥对
II. 远程登录指定ssh协议
2. 检测操作
I. 使用show crypto key mypubkey rsa命令,如下例:
Router(config)# show crypto key mypubkey rsa
% Key pair was generated at: 06:07:49 UTC Jan 13 1996
Key name:
Usage: Signature Key
Key Data:
005C300D 06092A86 4886F70D 01010105 00034B00 30480241 00C5E23B 55D6AB22
04AEF1BA A54028A6 9ACC01C5 129D99E4 64CAB820 847EDAD9 DF0B4E4C 73A05DD2
BD62A8A9 FA603DD2 E2A8A6F8 98F76E28 D58AD221 B583D7A4 71020301 0001
% Key pair was generated at: 06:07:50 UTC Jan 13 1996
Key name:
Usage: Encryption Key
Key Data:
00302017 4A7D385B 1234EF29 335FC973 2DD50A37 C4F4B0FD 9DADE748 429618D5
18242BA3 2EDFBDD3 4296142A DDF7D3D8 08407685 2F2190A0 0B43F1BD 9A8A26DB
07953829 791FCDE9 A98420F0 6A82045B 90288A26 DBC64468 7789F76E EE21
II. 使用show running-config命令,如下例:
router#show running-config
Building configuration...
Current configuration:
!
line vty 0 4
transport input ssh
3. 补充说明
使用非加密协议在传输过程中容易被截获口令
备注
第3章 日志安全要求
3.1 日志安全
3.1.1 对用户登录进行记录
安全基线项目名称
用户登录进行记录安全基线要求项
安全基线编号
SBL-CiscoRouter-03-01-01
安全基线项说明
与记账服务器(如RADIUS 服务器或TACACS服务器)配合,设备应配置日志功能,对用户登录进行记录,记录内容包括用户登录使用的帐号,登录是否成功,登录时间,以及远程登录时,用户使用的IP地址。
检测操作步骤
1. 参考配置操作
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#aaa new-model
Router(config)#aaa accounting connection default start-stop group tacacs+
Router(config)#aaa accounting exec default start-stop group tacacs+ Router(config)#end
Router1#
2. 补充操作说明
使用TACACS+ server
基线符合性判定依据
1. 判定条件
配置了AAA模板的上述具体条目
2. 检测操作
使用show running-config命令,如下例:
router1#show runn | include aaa
Building configuration...
Current configuration:
!
aaa new-model
aaa authentication login default group tacacs+
aaa authorization exec default group tacacs+
aaa session-id common
补充说明
备注
3.1.2 记录用户对设备的操作
安全基线项目名称
用户对设备记录安全基线要求项
安全基线编号
SBL-CiscoRouter-03-01-02
安全基线项说明
与记账服务器(如TACACS服务器)配合,设备应配置日志功能,记录用户对设备的操作,如帐号创建、删除和权限修改,口令修改,读取和修改设备配置,读取和修改业务用户的话费数据、身份数据、涉及通信隐私数据。记录需要包含用户帐号,操作时间,操作内容以及操作结果。
检测操作步骤
1. 参考配置操作
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#aaa new-model
Router(config)#aaa accounting commands 1 default start-stop group tacacs+
Router(config)#aaa accounting commands 15 default start-stop group tacacs+
Router(config)#end
Router1#
2. 补充操作说明
使用TACACS+ server
基线符合性判定依据
1. 判定条件
配置了AAA模板的上述具体条目
2. 检测操作
使用show running-config命令,如下例:
router1#show runn | include aaa
Building configuration...
Current configuration:
!
aaa new-model
aaa accounting commands 1 default start-stop group tacacs+
aaa accounting commands 15 default start-stop group tacacs+
补充说明
备注
3.1.3 开启NTP服务保证记录的时间的准确性
安全基线项目名称
记录的时间的准确性安全基线要求项
安全基线编号
SBL-CiscoRouter-03-01-03
安全基线项说明
开启NTP服务,保证日志功能记录的时间的准确性。
检测操作步骤
1. 参考配置操作
配置命令如下:
Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# interface eth0/0
Router(config-if)# no ntp disable
Router(config-if)# exit
Router(config)# ntp server 14.2.9.2 source loopback0
Router(config)# exit
2. 补充操作说明
需要到每个端口开启NTP
基线符合性判定依据
1. 判定条件
I. 存在 ntp server 配置条目
II. 日志记录时间准确
2. 检测操作
I. 使用show running-config命令,如下例:
router#show running-config
Building configuration...
Current configuration:
!
…
no ntp disable
ntp update-calendar
ntp server 128.237.32.2
ntp server 142.182.31.6
II. show logging | include NTP
000019: Jan 29 10:57:52.633 EST: %NTP-5-PEERSYNC: NTP synced to peer 172.25.1.5
000020: Jan 29 10:57:52.637 EST: %NTP-6-PEERREACH: Peer 172.25.1.5 is reachable
3. 补充说明
日志时间不准确导致安全事件定位的不准确
备注
3.1.4 远程日志功能*
安全基线项目名称
远程日志功能安全基线要求项
安全基线编号
SBL-CiscoRouter-03-01-04
安全基线项说明
设备应支持远程日志功能。所有设备日志均能通过远程日志功能传输到日志服务器。设备应支持至少一种通用的远程标准日志接口,如SYSLOG、FTP等。
检测操作步骤
1. 参考配置操作
路由器侧配置:
Router# config t
Enter configuration commands, one per line. End with CNTL/Z
Router(config)# logging on
Router(config)# logging trap information
Router(config)# logging 192.168.0.100
Router(config)# logging facility local6
Router(config)# logging source-interface loopback0
Router(config)# exit
Router# show logging
Syslog logging: enabled (0 messages dropped, 11 flushes, 0overruns)
Console logging: level notifications, 35 messages logged
Monitor logging: level debugging, 35 messages logged
Buffer logging: level informational, 31 messages logged
Logging to 192.168.0.100, 28 message lines logged
..
Router#
2. 补充操作说明
I. 假设把router日志存储在192.168.0.100的syslog服务器上
路由器侧配置描述如下:
启用日志
记录日志级别设定“information”
记录日志类型设定“local6”
日志发送到192.168.0.100
日志发送源是loopback0
配置完成可以使用“show logging”验证
服务器侧配置参考如下:
Syslog服务器配置参考:
在Syslog.conf上增加一行
# Save router messages to routers.log
local6.debug /var/log/routers.log
创建日志文件
#touch /var/log/routers.log
II. 如果使用snmp存储日志参考配置如下:
Router# config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)# logging trap information
Router(config)# snmp-server host 192.168.0.100 traps public
Router(config)# snmp-server trap-source loopback0
Router(config)# snmp-server enable traps syslog
Router(config)# exit
基线符合性判定依据
1. 判定条件
I. Syslog logging和SNMP logging至少有一个为“enabled”
II. Logging to后面的主机名或IP指向日志服务器
III. 通常记录日志数不为0
2. 检测操作
使用show logging命令,如下例:
Router# show logging
Syslog logging: enabled
Console logging: disabled
Monitor logging: level debugging, 266 messages logged.
Trap logging: level informational, 266 messages logged.
Logging to 192.180.2.238
SNMP logging: disabled, retransmission after 30 seconds
0 messages logged
Router#
3. 补充说明
备注
根据应用场景的不同,如部署场景需开启此功能,则强制要求此项。建议核心设备必选,其它根据实际情况启用
第4章 IP协议安全要求
4.1 IP协议
4.1.1 配置路由器防止地址欺骗
安全基线项目名称
配置路由器防止地址欺骗安全基线要求项
安全基线编号
SBL-CiscoRouter-04-01-01
安全基线项说明
配置路由器,防止地址欺骗。
检测操作步骤
1. 参考配置操作
对向内流量配置:
Router(config)# no access-list 100
Router(config)# access-list 100 deny ip 192.168.10.0 0.0.0.255 any log
Router(config)# access-list 100 deny ip 127.0.0.0 0.255.255.255 any log
Router(config)# access-list 100 deny ip 10.0.0.0 0.255.255.255 any log
Router(config)# access-list 100 deny ip 0.0.0.0 0.255.255.255 any log
Router(config)# access-list 100 deny ip 172.16.0.0 0.15.255.255 any log
Router(config)# access-list 100 deny ip 192.168.0.0 0.0.255.255 any log
Router(config)# access-list 100 deny ip 192.0.2.0 0.0.0.255 any log
Router(config)# access-list 100 deny ip 169.254.0.0 0.0.255.255 any log
Router(config)# access-list 100 deny ip 224.0.0.0 15.255.255.255 any log
Router(config)# access-list 100 deny ip host 255.255.255.255 any log
Router(config)# access-list 100 permit ip any 192.168.10.0 0.0.0.255
Router(config)# access-list 100 deny ip any any log
Router(config)# interface eth0
Router(config-if)# description External interface to 192.168.0./16 net
Router(config-if)# ip address 192.168.10.20 255.255.0.0
Router(config-if)# ip access-group 100
展开阅读全文