4 분 소요

방화벽

  • 침입차단 시스템

  • 내부 네트워크의 컴퓨터들을 외부로부터 보호하기 위한 보안 정책과 이를 수행하는 하드웨어 및 소프트웨어 등 침입 차단을 위한 모든 것

  • 외부의 해커나 인증되지 않은 사용자, 유해한 정보가 LAN으로 진입하지 못하도록 차단해 주는 보호 정책과 장치

# 구성 방식에 따른 분류

1. 패킷 필터링(Packet Filtering) 

2. 서킷 게이트웨이(Circuit Gateway) 

3. 애플리케이션 게이트웨이(Application Gateway) 

4. 하이브리드(Hybrid) 방식
# 형태에 의한 분류

1. 스크리닝 라우터(Screening Router) 

2. 베스천 호스트(Bastion Host) 

3. 듀얼 홈 호스트(Dual-Homed Host) 

4. 스크린 호스트 게이트웨이(Screened Host Gateway) 

5. 스크린 서브넷 게이트웨이(Screened Subnet Gateway) 
# 사용 기술에 따른 분류

1세대 : Packet Filtering 
         => ACL(Access Control List), L3/L4 기반 필터링. =>Stateless

2세대 : Application Layer Gateway(ALG)

3세대 : Stateful Packtet Inspection(SPI)
 
 New Generation Firewall(차세대 방화벽)

** 각 벤더마다 세대 구분이 다를 수 있다. **

IOS Firewall 실습

  • Cisco Router의 경우 모델과 IOS 버전에 따라 Router에서 Firewall 기능을 구현하 는 것이 가능하다.
 1. ACL(Access Control List) 
 
 2. RACL(Reflexive ACL) 
 
 3. DACL(Dynamic ACL) 
 
 4. CBAC(Context-Based ACL) 
 
 5. ZFW(Zone-based Firewall)

image

# 공통 설정

en
conf t
no ip domain lookup
line c 0
logg syn
exec-timeout 0
exit
ali exec c conf t
ali exec r sh run
ali exec i sh ip route
ali exec b sh ip int b 
hostname
# IP Address

HQ]
int f0/0
no shut
ip add 100.1.1.254 255.255.255.0
exit
int f0/1
no shut
ip add 1.1.100.1 255.255.255.252
exit

IOS_FW]
int f0/0
no shut
ip add 1.1.100.2 255.255.255.252
exit
int f0/1
no shut
ip add 1.1.100.5 255.255.255.252
exit

BB]
int f0/0
no shut
ip add 1.1.100.6 255.255.255.252
exit
int f0/1
no shut
ip add 1.1.100.9 255.255.255.252
exit
int f1/0
mac-address ffff.ffff.ffff
no shut
ip add dhcp

Branch]
int f0/1
no shut
ip add 200.1.1.254 255.255.255.0
exit
int f0/0
no shut
ip add 1.1.100.10 255.255.255.252
# OSPF

HQ]
router ospf 1
net 100.1.1.254 0.0.0.0 a 0
net 1.1.100.1 0.0.0.0 a 0

ISO_FW]
router ospf 1
net 1.1.100.2 0.0.0.0 a 0
net 1.1.100.5 0.0.0.0 a 0

BB]
ip route 0.0.0.0 0.0.0.0 f1/0 10.0.0.1
router ospf 1
net 1.1.100.6 0.0.0.0 a 0
net 1.1.100.9 0.0.0.0 a 0
default-information originate

Branch]
router ospf 1
net 1.1.100.10 0.0.0.0 a 0
net 200.1.1.254 0.0.0.0 a 0
# NAT

BB]
ip access-list standard BIBI
permit 100.1.1.0 0.0.0.255
permit 200.1.1.0 0.0.0.255
int f0/0
ip nat inside
exit
int f0/1
ip nat inside
exit
int f1/0
ip nat outside
# ACL

ISO_FW]
ip access-list extended OUT_IN
permit udp any host 100.1.1.250 eq 53
permit tcp any host 100.1.1.250 eq 80
deny ip any any
exit
int f0/1
ip access-group OUT_IN in => deny any any 때문에 OSPF가 끊긴다.
IP access-list extended OUT_IN
5 permit ospf host 1.1.100.6 any => source BB의 1.1.100.6

1024~65535 까지 출발지가 랜덤포트.
WIN701에서 google을 이용할때 WIN2016에서 나갈때 리쿼시브 커리로 구글을 물고 돌아올때 목적지를 모른다. 고로 인터넷이 안됨.

ip access-list extended OUT_IN
21 permit udp any 100.1.1.0 0.0.0.255
22 permit tcp any 100.1.1.0 0.0.0.255 established => 물고 나갔던것에 대한 ack를 다 허락하겠다. UDP는 established는 안먹는다. 그래서 인터넷은 여전히 안됨. 텔넷은 가능.

wireshark>> Ip.addr == 100.1.1.1 && tcp.port == 23

Branch]
line vty 0 4
password cisco
login
exit
enable password cisco

WIN701]
telnet 1.1.100.10 => 캡쳐한것을 확인하면 포트넘버 =>23 으로 ACK한것을 허용된것을 확인할 수 있다. 즉, established가 된 것을 확인.
# RACL (Reflexive ACL)

1세대에서 session정보를 해결하기위해 RACL이 있으나 여전히 stateless이다.


ISO_FW]
int f0/1
no ip access-group OUT_IN in
exit
no ip access-lsit extended
ip access-list extended RACL->OUT
permit tcp any any reflect RACL_T
permit udp any any reflect RACL_T
permit icmp any any reflect RACL_T
permit ip any any => 방화벽 정책에서 IN->OUT정책이 any any
exit
ip access-list extended RACL->IN
permit ospf host 1.1.100.6 any
permit udp any host 100.1.1.250 eq 53
permit tcp any host 100.1.1.250 eq 80
evaluate RACL_T => 들어오는 정책인데,  출발지 목적지가 바뀌는 변수도 적용될 수 있게 적어줌.
exit
int f0/1
ip access-group RACL->OUT out
ip access-group RACL->IN in
# DACL (dynamic ACL)

HQ]
line vty 0 4
password cisco
login

ISO_FW]
ip access-list extended RACL->IN
41 permit tcp any host 1.1.100.5 eq 23
42 dynamic permit tcp any host 1.1.100.1 eq 23 =>접근시 any 자리에 접근하는 ip가 들어오게된다. 
line vty 0 4
password cisco
login 
autocommand access-enable host timeout 10
# CBAC(Context-Based ACL) *SPI - 나갈때 기억했다가 들어올때도 기억하는방식

ISO_FW]
int f0/1
no ip access-group RACL->IN in
no ip access-group RACL->OUT out
exit
no ip access-list extended RACL->IN
no ip access-list extended RACL->OUT
ip inspect name CBAC_T tcp
ip inspect name CBAC_T udp
ip inspect name CBAC_T icmp
ip access-list extended OUT->IN
permit ospf host 1.1.100.6 any
permit udp any host 100.1.1.250 eq 53
permit tcp any host 100.1.1.250 eq 80
deny ip any any
exit
int f0/1
ip access-group OUT->IN in
ip insepct CBAC_T out   => tcp udp icmp 관련 프로토콜이 나갈때 기억했다가 들어올때도 기억됨

image

# urlfilter

ip urlfilter exclusive-domain deny .moon681.shop
ip urlfilter exclusive-domain deny .kedu.edu
ip urlfilter allow-mode on
ip urlfilter audit-trail
ip inspect name CBAC_T http urlfilter

=> http인 cloud.moon681.shop을 막은것을 확인할 수 있다.
   그러나 라우터로 url filtering 은 https가 안됨. 한계가 있다.

댓글남기기