访问控制列表

ACL

ACL可用于接口,也有全局的

接口访问控制列表只能控制穿越流量(session连接除外)

所有到ASA终结的流量,被不同的管理访问列表控制(如:ssh 0 0 DMZ)

ASA发起的都被允许

ASA配置相同优先级的acl是将原来的挤下去,路由器是直接替换

接口规则和安全

默认:outbound(高->低)允许,inbound(低->高)拒绝

接口规则:input(主要)控制改接口进入, output控制出去

enablepasswordcisco//Telnet需要enable密码same-security-trafficpermitinter-interfacesame-security-trafficpermitintra-interface写ACLaccess-listoutextendedpermittcpanyhost192.168.117.100eqtelnet//两条名为out的aclaccess-listoutextendedpermittcpanyhost192.168.112.100eqwwwaccess-listoutextendeddenyipanyanylog//logdeny的数据包调用ACLaccess-groupoutininterfaceoutside//将outacl-list应用在outside接口in方向access-groupoutoutinterfaceoutside//将outacl-list应用在outside接口out方向access-groupoutglobal//全局调用定时ACLtime-rangeonwork//设置一个时间范围periodicweekdays9:00to19:15access-listoutline1extendedpermittcphost192.168.116.100host192.168.117.100eqtelnettime-rangeonwork//acl在时间范围内生效

Objet-Group

可将网段协议端口做成一个集合以供调用,并且可以嵌套调用

ASA(config)#object-group?configuremodecommands/options:icmp-typeSpecifiesagroupofICMPtypes,suchasechonetworkSpecifiesagroupofhostorsubnetIPaddresses//IP或网段protocolSpecifiesagroupofprotocols,suchasTCP,etc//协议securitySpecifiesidentityattributessuchassecurity-groupserviceSpecifiesagroupofTCP/UDPports/services//协议加端口号userSpecifiessingleuser,localorimportusergroup例:objectnetworkInside-Server1//object只能装一个,object-group可以装多个host10.1.1.1objectnetworkInside-Server2host10.1.1.2object-groupnetworkInside-Server//并支持嵌套network-objectobjectInside-Server1network-objectobjectInside-Server2object-groupservicetest1tcp-udp//服务组port-objecteq21port-objecteq22实例:access-listOutside_access_inextendedpermitobject-groupInsideService202.100.1.0255.255.255.0object-groupInside-Server//替换ACL对应位置即可

URPF

ASA可以使用URPF技术抵御IP地址欺骗
1.ASA使用路由表确认源地址(严格uRPF)
2.仅仅检查流中的第一个包(可以状态化处理的协议)
3.uRPF默认是禁用的

ipverifyreverse-pathinterfaceOutside

shunn

ASA可以使用shunning技术丢弃源自于一个特性主机的数据包

Shunning配置规则:


手动配置,或者被IPS动态配置

覆盖所有的接口访问规则

重启之后就消失

用于对某个事件紧急响应时使用

ASA(config)#shun192.168.12.1Shun192.168.12.1addedincontext:single_vfShun192.168.12.1successfulASA(config)#showshunshun(DMZ)192.168.12.10.0.0.0000ASA(config)#showshunstatisticsmgmt=OFF,cnt=0inside=OFF,cnt=0outside=OFF,cnt=0DMZ=ON,cnt=0Shun192.168.12.1cnt=0,time=(0:00:30)ASA(config)#clearshun

基于用户策略( CUT‐Through Proxy)

当一个用户第一次访问一个需要被认证的资源时, Cisco ASA会要求这个用户提供用户名和密码。

一个用户为所有的认证规则,只需要认证一次,因为ASA缓存用户的源IP地址。(注:由于是根据ip确定一个用户,故在多个用户共享一个IP地址( PAT,代理),不建议部署基于用户的策略,后果一个用户认证通过,这ip下的其他用户全部通过)

用户必须使用HTTP, HTTPS, FTP或者TELNET去访问资源以触发认证。

注:只有HTTP, HTTPS, FTP或者TELNET才会触发,一些非标准的不会直接认证

解决ASA对Telnet的直接认证上述不安全问题

思路:与虚拟HTTP一样

设置一组ACL:把Telnet 3088 和Telnet虚拟ip的写到一块

认证匹配该ACL组的流量

Outside(config)#linevty04Outside(config-line)#rotary88//Telnet开启3088端口ASA(config)#access-listin_telnet_outextendedpermittcpanyanyeq3088//这句相当于把virtualTelnet和Telnetoutside3088绑定到一块了//实际上只要这组ACL触发了认证并且通过,该ACL组都会对认证的ip生效ASA(config)#aaaauthenticationmatchin_telnet_outinside3araInside#telnet192.168.16.1003088Trying192.168.16.100,3088...OpenError:Mustauthenticatebeforeusingthisservice.[Connectionto192.168.16.100closedbyforeignhost]Inside#Inside#telnet192.168.17.110//先去认证只有标准的HTTP,HTTPS,FTP或者TELNET才能正常认证Trying192.168.17.110...OpenLOGINAuthenticationAuthenbyECITUsername:test1Password:WelcometoECITAuthenticationSuccessful[Connectionto192.168.17.110closedbyforeignhost]Inside#Inside#telnet192.168.16.1003088//再去访问ACL中允许的流量Trying192.168.16.100,3088...OpenOutside>




用户被认为已经通过了认证,直到他们注销,或者认证缓存信息超时。

注意:http在认证时账号密码是直接通过get包纯明文直接发过去的,很不安全,且PAT不合适



ASA(config)#aaa-server3araprotocolradius//协议ASA(config-aaa-server-group)#exitASA(config)#aaa-server3ara(DMZ)host192.168.12.200cisco//radius的IP和keyASA(config-aaa-server-host)#exitASA(config)#testaaa-serverauthentication3ara//测试用户ASA(config)#access-listautelpermittcpanyanyeqtelnet//设置ACLASA(config)#aaaauthenticationmatchautelinside3ara//在inside口匹配该ACL的启用AAA认证ASA(config)#timeoutuauth1:00:00absolute//绝对超时时间ASA(config)#timeoutuauth0:10:00inactivity//闲置超时时间Inside#telnet192.168.112.100Trying192.168.112.100...OpenUsername:test1Password:UserAccessVerificationPassword:DMZ#exit提示消息ASA(config)#auth-promptpromptAuthenbyECITASA(config)#auth-promptacceptWelcometoECITASA(config)#auth-promptrejectDenybyECITInside#telnet192.168.112.100Trying192.168.112.100...OpenAuthenbyECITUsername:test1Password:WelcometoECITUserAccessVerificationPassword://这是DMZ的vty密码DMZ#

解决ASA对HTTP的直接认证上述不安全问题


HTTP重定向

虚拟HTTP

Secure HTTP


HTTP重定向

ASA(config)#aaaauthenticationlistenerhttpDMZporthttpredirect

Secure HTTP

ASA(config)#aaaauthenticationsecure-http-client//不能和上面一起用//与HTTP重定向几乎一样,只是在①那一段是加密的

虚拟HTTP

//原理几乎一样,只是在①那一段被重定向到ASA的一个虚拟接口上,当然这个虚拟接口在策略上可达ASA(config)#virtualhttp202.100.1.101warning这个地址一般设为ASA接口所在网段的一个地址


授权

Download ACL 优先于接口和全局ACL

ASA(config)#virtualtelnet192.168.17.110ASA(config)#access-listinextendedpermittcpanyhost192.168.17.110eqtelnetASA(config)#aaaauthenticationmatchininside3araASA(config)#access-groupinininterfaceinsideper-user-override//per-user-override表示将dacl覆盖该接口的acl,切记要敲,否则dacl不生效

注:切记要用IE,什么谷歌,火狐,欧朋都有问题,这个破ACS,心好累



审计

ASA(config)#access-listactelnetpermittcpanyanyeqtelnetASA(config)#aaaaccountingmatchactelnetinside3ara