本文主要介绍ASA5520防火墙的基本知识和配置
环境搭建
Linux eveng 5.17.8-eve-ng-uksm-wg+ #1 SMP PREEMPT Mon May 16 10:08:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
导入 asa 8.42 镜像,搭建简单网络
网络拓扑图:
配置:
#主机名,网卡ip配置
hostname ASA
interface GigabitEthernet0/0
nameif Outside
security-level 0
ip address 202.100.1.10 255.255.255.0
no shutdown
interface GigabitEthernet0/1
nameif Inside
security-level 100
ip address 10.1.1.10 255.255.255.0
no shutdown
#路由配置
route outside 0 0 202.100.1.1
route Inside 10.1.0.0 255.255.0.0 10.1.1.1
#允许ping配置
access-list OUTSIDE_IN_ACL permit icmp any any echo-reply
access-group OUTSIDE_IN_ACL in interface outside
#保存
wr
#重启
reload
#VPC1
ip 202.100.1.1/24 202.100.1.10
show ip
#保存
save
#VPC2
ip 10.1.1.1/24 10.1.1.10
show ip
#保存
save
连通性测试:
VPC-inside -> VPC-outside OK
VPC-outside -> VPC-inside Can't reach
ASA 机制
ciscoasa# sh run
: Saved
:
: Serial Number: JMX1203L0NN
: Hardware: ASA5520, 2048 MB RAM, CPU Pentium II 1000 MHz
:
ASA Version 9.1(5)16
!
hostname ciscoasa
enable password 8Ry2YjIyt7RRXU24 encrypted
xlate per-session deny tcp any4 any4
xlate per-session deny tcp any4 any6
xlate per-session deny tcp any6 any4
xlate per-session deny tcp any6 any6
xlate per-session deny udp any4 any4 eq domain
xlate per-session deny udp any4 any6 eq domain
xlate per-session deny udp any6 any4 eq domain
xlate per-session deny udp any6 any6 eq domain
names
!
interface Ethernet0
nameif Outside
security-level 0
ip address 202.100.1.10 255.255.255.0
!
interface Ethernet1
nameif Inside
security-level 100
ip address 10.1.1.10 255.255.255.0
!
interface Ethernet2
shutdown
no nameif
no security-level
no ip address
!
interface Ethernet3
shutdown
no nameif
no security-level
no ip address
!
ftp mode passive
access-list OUTSIDE_IN_ACL extended permit icmp any any echo-reply
pager lines 24
mtu Outside 1500
mtu Inside 1500
no failover
icmp unreachable rate-limit 1 burst-size 1
no asdm history enable
arp timeout 14400
no arp permit-nonconnected
access-group OUTSIDE_IN_ACL in interface Outside
route Outside 0.0.0.0 0.0.0.0 202.100.1.1 1
route Inside 10.1.0.0 255.255.0.0 10.1.1.1 1
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-pat0
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnec0
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
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstartt
crypto ipsec security-association pmtu-aging infinite
crypto ca trustpoint _SmartCallHome_ServerCA
no validation-usage
crl configure
crypto ca trustpool policy
telnet timeout 5
ssh stricthostkeycheck
ssh timeout 5
ssh key-exchange group dh-group1-sha1
console timeout 0
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
anyconnect-essentials
!
class-map inspection_default
match default-inspection-traffic
!
!
policy-map type inspect dns preset_dns_map
parameters
message-length maximum client auto
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 ip-options
inspect netbios
inspect rsh
inspect rtsp
inspect skinny
inspect esmtp
inspect sqlnet
inspect sunrpc
inspect tftp
inspect sip
inspect xdmcp
!
service-policy global_policy global
prompt hostname context
call-home reporting anonymous
call-home
profile CiscoTAC-1
no active
destination address http https://tools.cisco.com/its/service/oddce/se
destination address email callhome@cisco.com
destination transport-method http
subscribe-to-alert-group diagnostic
subscribe-to-alert-group environment
subscribe-to-alert-group inventory periodic monthly
subscribe-to-alert-group configuration periodic monthly
subscribe-to-alert-group telemetry periodic daily
crashinfo save disable
Cryptochecksum:6821d180ac1f59cef90bb94bddd213c1
: end
具体解释:
这是一个防火墙的配置,主要涉及网络访问控制、路由设置、超时设置、安全策略等。以下是对该配置的分析:
FTP 模式:
配置为被动模式 (ftp mode passive)。被动模式在处理数据传输时更加安全,因为它避免了潜在的端口冲突。
访问控制列表 (ACL):
access-list OUTSIDE_IN_ACL extended permit icmp any any echo-reply:允许从任何源到任何目的地的 ICMP echo-reply(ping)请求。
网络接口和 MTU:
mtu Outside 1500 和 mtu Inside 1500:分别为外部和内部接口设置了 MTU 为 1500 字节。
no failover:关闭了 Failover 功能,表示如果一个接口失败,流量不会自动切换到另一个接口。
ICMP 不可达速率限制:
icmp unreachable rate-limit 1 burst-size 1:限制 ICMP 不可达消息的发送速率。
ARP 设置:
arp timeout 14400:ARP 表的超时时间为 4 小时。
no arp permit-nonconnected:不允许非连接的 ARP 请求。
路由设置:
配置了到外部和内部的静态路由。
超时设置:
各种超时时间被详细设置,例如连接超时、半关闭超时、UDP 超时等。
安全策略:
dynamic-access-policy-record DfltAccessPolicy:定义了一个默认的动态访问策略。
user-identity default-domain LOCAL:用户身份验证的默认域设置为 LOCAL。
snmp-server enable traps snmp authentication linkup linkdown coldstart:启用了 SNMP 相关事件的警报。
crypto ipsec security-association pmtu-aging infinite:IPSec 安全关联的 PMTU 老化设置为无限。
telnet timeout 5 和 ssh timeout 5:分别设置了 Telnet 和 SSH 的超时时间为 5 秒。
Inspection 和安全策略:
定义了一个名为 inspection_default 的类映射,并为其指定了多个需要检查的服务(例如 FTP、DNS 等)。然后,该类映射被应用到了全局策略中。
全局策略(global_policy)定义了对多种服务的检查,并将该策略应用到了全局服务上。
报告和上报:
call-home reporting anonymou:启用了匿名报告功能,可能用于发送设备状态和警报到远程服务器。
从配置中可以看出,这是一个相对复杂且细致的防火墙配置,涉及到多种服务和网络功能。分析这样的配置需要深入了解每个设置的含义和用途,并根据实际环境和需求进行评估。
这段配置是关于 Cisco 设备的“call-home”功能,该功能允许设备自动向指定的目的地发送警报和诊断信息,以便于远程监控和故障排除。以下是详细分析:
call-home profile CiscoTAC-1: 定义了一个名为“CiscoTAC-1”的 call-home 配置文件。
no active: 当前不激活 call-home 功能。
destination address http https://tools.cisco.com/its/service/oddce/se: 指定了一个 HTTP 的 call-home 目的地,指向 Cisco 的在线工具。
destination address email callhome@cisco.com: 指定了一个电子邮件地址作为 call-home 的目的地。
destination transport-method http: 指定使用 HTTP 作为传输方法。
subscribe-to-alert-group diagnostic: 订阅诊断警报组。
subscribe-to-alert-group environment: 订阅环境警报组。
subscribe-to-alert-group inventory periodic monthly: 定期(每月)订阅库存警报组。
subscribe-to-alert-group configuration periodic monthly: 定期(每月)订阅配置警报组。
subscribe-to-alert-group telemetry periodic daily: 定期(每天)订阅遥测数据警报组。
crashinfo save disable:
禁用了自动保存崩溃信息的功能。
Cryptochecksum:6821d180ac1f59cef90bb94bddd213c1:
这是一个校验和,用于验证配置文件的完整性。
此配置文件主要关注远程监控和警报功能,允许设备定期发送诊断、环境、库存、配置和遥测数据到 Cisco 的在线工具或指定的电子邮件地址。这对于远程管理和故障排除非常有用。
使用 binwalk 解包
文件系统 root-fs
类 linux 的文件系统,进行具体的协议逆向分析和漏洞挖掘
AIP-SSM入侵防御服务
高级检测和防御 (AIP) 安全服务模块
Cisco AIP-SSM 采用技术
准确的在线防御技术–既能积极预防各种威胁,又不会丢弃合法流量。这种独特的技术能够对数据进行智能、自动、关联分析,以保证客户能充分发挥入侵防御解决方案的优势。
多种威胁识别–通过L2到L7的详细流量检测,防止用户违背网络策略、盗用各种漏洞并执行异常操作。
独特网络协作–通过网络协作提高可扩展性和永续性,包括有效的流量捕获技术、负载均衡功能以及对加密流量的可视性。
强大的管理、事件关联和支持服务–提供完整的解决方案,包括配置、管理、数据关联和高级支持服务。对于网络级入侵防御解决方案,思科安全监控、分析和响应系统(Cisco Security MARS)能够发现、隔离和准确删除恶意组件。利用思科意外控制系统(ICS),由于网络能够快速适应和提供分布式响应,因而能有效防止新的蠕虫和病毒发作。
威胁检测功能
版本 > 8.0(2)
虽然威胁检测不能替代专用IDS/IPS解决方案,但是可以在IPS不可用的环境中使用,为ASA的核心功能提供额外的保护层。
威胁检测功能有三个主要组件:
基本威胁检测
高级威胁检测
扫描威胁检测
1 基本威胁检测(系统级速率)
默认情况下,在运行8.0(2)及更高版本的所有ASA上启用基本威胁检测。
基本威胁检测监控由于各种原因而由整个ASA丢弃数据包的速率。这意味着基本威胁检测生成的统计信息仅应用于整个设备,通常不够精细,无法提供有关威胁源或特定性质的信息。相反,ASA会监控以下事件的丢弃数据包:
访问控制列表ACL(Access Control List)是由一条或多条规则组成的集合。所谓规则,是指描述报文匹配条件的判断语句,这些条件可以是报文的源地址、目的地址、端口号等。
ACL作为一个过滤器,设备通过应用ACL来阻止和允许特定流量的流入和流出,如果没有它,任何流量都会自由流入和流出,使得网络容易受到攻击。
如下图所示,为保证财务数据安全,企业在路由设备上应用ACL可以阻止内网内部研发部门主机对财务服务器的访问,同时允许总裁办公室访问财务服务器。为了保护企业内网的安全,在路由设备上应用ACL可以封堵网络病毒常用的端口,防止Internet上的恶意流量入侵。
ACL丢弃(acl-drop) — 访问列表拒绝数据包。
Bad Pkts(bad-packet-drop) — 无效的数据包格式,包括不符合RFC标准的L3和L4报头。
Conn Limit(conn-limit-drop) — 超过已配置或全局连接限制的数据包。
DoS攻击(dos-drop) — 拒绝服务(DoS)攻击。
防火墙(fw-drop) — 基本的防火墙安全检查。
ICMP攻击(icmp-drop) — 可疑ICMP数据包。
Inspect(inspect-drop) — 应用检测拒绝。
Interface(interface-drop) — 接口检查丢弃的数据包。
扫描(扫描威胁) — 网络/主机扫描攻击。
SYN攻击(syn-attack) — 不完整的会话攻击,包括没有返回数据的TCP SYN攻击和单向UDP会话。
配置
基本威胁检测
使用threat-detection basic-threat命令启用基本威胁检测。
可以使用show run all threat-detection命令查看默认速率。
为了使用这些自定义值调整这些速率,只需为相应的威胁类别重新配置threat-detection rate命令。
参考:https://www.cisco.com/c/zh_cn/support/docs/security/asa-5500-x-series-next-generation-firewalls/113685-asa-threat-detection.html
高级
使用threat-detection statistics命令以启用高级威胁检测。如果未提供特定功能关键字,该命令将启用所有统计信息的跟踪。
要配置主机、端口、协议或ACL统计信息跟踪的速率间隔数,请使用number-of-rate关键字。
number-of-rate关键字将威胁检测配置为仅跟踪最短n个间隔。
要启用TCP拦截统计信息,请使用threat-detection statistics tcp-intercept命令。
要配置TCP拦截统计数据的自定义速率,请使用rate-interval、average-rate和burst-rate关键字。
扫描
要启用扫描威胁检测,请使用threat-detection scanning-threat命令。要调整扫描威胁的速率,请使用基本威胁检测所用的threat-detection rate命令。
ciscoasa(config)# threat-detection rate scanning-threat rate-interval 1200 average-rate 250 burst-rate 550
要允许ASA避开扫描攻击者IP,请将shun关键字添加到threat-detection scanning-threat命令。
ciscoasa(config)# threat-detection scanning-threat shun
这样,扫描威胁检测可以为攻击者创建一个避开一小时的时间。要调整shun的持续时间,请使用threat-detection scanning-threat shun duration命令。
ciscoasa(config)# threat-detection scanning-threat shun duration 1000
在某些情况下,您可以防止ASA避开某些IP。为此,请使用threat-detection scanning-threat shun except命令创建例外。
%ASA-1-733100: [ Scanning] drop rate-1 exceeded. Current burst rate is 17 per second,
max configured rate is 10; Current average rate is 0 per second,
max configured rate is 5; Cumulative total count is 404
%ASA-4-733101: Host 10.10.10.10 is attacking. Current burst rate is 17 per second,
max configured rate is 10; Current average rate is 0 per second,
max configured rate is 5; Cumulative total count is 700
%ASA-4-733102: Threat-detection adds host 10.10.10.10 to shun list
– END –
::: block-2
一个只记录最真实学习网络安全历程的小木屋,最新文章会在公众号更新,欢迎各位师傅关注!
公众号名称:网安小木屋
博客园主页:
博客园-我记得https://www.cnblogs.com/Zyecho/
:::