Các lo i Firewalls ạPacket Filtering Router Application Level Gateway Circuit Level Gateway... Packet Filtering Rulesconnection to our SMTP port * * 25 OUR-GW allow we don’t trust these
Trang 1Network Security
Firewalls
Trang 2T i sao c n có firewall ạ ầ
Các k t n i Internet cho phép các m ng ế ố ạriêng n i vào h th ng m ng toàn c u.ố ệ ố ạ ầFirewall được chèn vào gi a m ng riêng ữ ạ
Trang 3M c tiêu thi t k ụ ế ế
T t c các truy c pấ ả ậ , k c t bên trong ể ả ừ
ra hay bên ngoài vào đ u ph i đi qua ề ảfirewall
Ch cho phép ỉ các truy c p h p lậ ợ ệ (được
đ nh ngh a trong ị ĩ chính sách an ninh)
Trang 4Các k thu t đi u khi n truy ỹ ậ ề ể
c p ậ
Service Control – i u khi n theo hĐ ề ể ướng
d ch v (Internet) i vào ho c ra.ị ụ Đ ặ
Direction Control – i u khi n theo chi u Đ ề ể ề
Trang 5Kh n ng c a Firewalls ả ă ủ
Single choke point – i m ki m tra duy Đ ể ể
nh t - b o v các d ch v nh y c m kh i ấ ả ệ ị ụ ạ ả ỏcác lo i t n công khác nhau (spoofing, ạ ấDOS …)
Singular monitoring point – i m giám Đ ểsát, ki m soát các hành vi.ể
Trang 6Scope of Firewalls
Platform for non-security functions –
N n t ng cho các d ch v khác - dùng ề ả ị ụcho các d ch v chuy n đ i đ a ch ị ụ ể ổ ị ỉ
(NAT), qu n lý m ng …ả ạ
Platform for IPSec – N n t ng cho IPSec ề ả
- th c thi VPN qua ch đ đự ế ộ ường h m.ầ
Trang 7H n ch c a Firewalls ạ ế ủ
Không th ch ng l i các t n công b ể ố ạ ấ ỏ
qua firewall (bypass)
Không ch ng l i đố ạ ược các m i đe d a t ố ọ ừbên trong
Không ch ng đố ược s lây nhi m các ự ễ
chương trình virus và mã đ c.ộ
Trang 8Các lo i Firewalls ạ
Packet Filtering Router
Application Level Gateway
Circuit Level Gateway
Trang 9Packet Filtering
OSI Layers Addressed
Trang 10Packet Filtering Router
Áp d ng m t ụ ộ t p các lu tậ ậ cho m i gói tin ỗ
đi qua Router và quy t đ nh s chuy n ế ị ẽ ể
ti p hay h y gói tin đó ế ủ
L c gói tin theo ọ c hai h ả ướ ng
Trang 11Packet Filtering Router
Các lu t d a trên ậ ự đ a ch ngu n, ị ỉ ồ đ a ch ị ỉ đích và s c ng ố ổ đ l c gói tinể ọ
Danh sách các lu t ậ được kh p v i các ớ ớtham s gói tin.ố
N u không có lu t nào kh p, hành đ ng ế ậ ớ ộ
m c đ nh đặ ị ược áp d ng.ụ
Trang 12Packet Filtering Router
Trang 13Packet Filtering Rules
connection to our SMTP port
*
* 25
OUR-GW allow
we don’t trust these guys
* SPIGOT
*
* block
comment port
theirhost port
ourhost action
• Cho phép gửi mail vào (port 25), nhưng chỉ được gửi cho gateway
• Không cho phép lưu lượng đến từ máy SPIGOT
Trang 14Packet Filtering Rules
comment port
theirhost port
ourhost action
• Chính sách mặc định
• Luôn luôn là luật cuối cùng
• Luật này cấm tất cả các lưu lượng khác
Trang 15Packet Filtering Rules
Connection to their SMTP port
25
*
*
* allow
comment port
theirhost port
ourhost action
• Các trạm trong mạng có thể gửi mail ra ngoài
• Một vài ứng dụng có thể kết nối tới cổng 25
• Hacker có thể truy cập qua cổng 25
Trang 16Packet Filtering Rules
their replies ACK
*
* 25
* allow
flags
connection to their SMTP port
25
*
*
our hosts allow
comment port
dest port
src action
• Cải tiến trường hợp trước
• Các trạm bên trong có thể truy cập tới bất kỳ SMTP server nào
• Cho phép các xác nhận từ SMTP server bên ngoài
Trang 17Packet Filtering Rules
replies to our calls ACK
*
*
*
* allow
comment port
dest port
src action
• Xử lý các kết nối FTP
• Hai kết nối được sử dụng: Một dùng để điều khiển và 1
để truyền dữ liệu; dùng 2 cổng khác nhau (20, 21)
• Các kết nối ra ngoài sử dụng các cổng chỉ số cao (> 1023)
Trang 19Packet Filtering Attacks
IP address spoofing – các gói tin t bên ừngoài có s d ng đ a ch IP gi (tin c y) ử ụ ị ỉ ả ậtrong trường đ a ch ngu n.ị ỉ ồ
Source routing attacks – hacker n đ nh ấ ịtuy n ngu n đ gói tin tránh các đi m ế ồ ể ể
ki m soát.ể
Tiny fragment attack – hacker phân nh ỏgói tin đ qua m t các lu t l c gói tin ể ặ ậ ọ
d a trên tiêu đ TCP.ự ề
Trang 20Real Life Example
Trang 22Stateful Inspection
Layers Addressed By Stateful Inspection
Trang 23Stateful Inspection
Firewalls
Tr ng thái c a 1 k t n i: Open or ạ ủ ế ố
Closed
State: Th t c a gói tin trong cu c trao đ i ứ ự ủ ộ ổ
Th ườ ng cho bi t gói tin có ph i thu c v m t ế ả ộ ề ộ
k t n i đang m hay không ế ố ở
Trang 24trong m ng t i các máy ch ngoài m ng ạ ớ ủ ạ
Các gói tin trao đ i ti p theo gi a các máy này ổ ế ữ
t i các c ng này là đ ạ ổ ượ c phép mà không c n ầ
ph i xem xét k ả ỹ
B n ghi b xóa kh i b ng tr ng thái khi k t n i ả ị ỏ ả ạ ế ố TCP ng t ắ
Trang 25Stateful Inspection Firewall
Operation I
External Webserver 123.80.5.34
2.
Establish
TCP SYN Segment From: 60.55.33.12:62600 To: 123.80.5.34:80
Stateful Firewall
Type
TCP
Internal IP 60.55.33.12
Internal Port 62600
External IP 123.80.5.34
External Port 80
Status OK Connection Table
Note: Outgoing Connections Allowed By Default
Trang 26Stateful Inspection Firewall
Operation I
External Webserver 123.80.5.34
Stateful Firewall
Type
TCP
Internal IP 60.55.33.12
Internal Port 62600
External IP 123.80.5.34
External Port 80
Status OK Connection Table
Trang 27Internal Port 62600 63206
External IP 123.80.5.34 1.8.33.4
External Port 80 69
Status OK OK Connection Table
Trang 28N u có m t phân đo n TCP SYN/ACK đ ế ộ ạ ượ c
g i, không th bi t đ ử ể ế ượ c tr ướ c đó đã có
phân đo n SYN đ yêu c u m k t n i hay ạ ể ầ ở ế ố
ch a (các stateful firewall có th ki m tra ư ể ể
đ ượ c).
Trang 29Stateful Firewall
Operation II
Attacker Spoofing External Webserver 10.5.3.4
Internal
Client PC
60.55.33.12
Stateful Firewall
2.
Check Connection Table:
No Connection Match: Drop
1.
Spoofed TCP SYN/ACK Segment From: 10.5.3.4.:80 To: 60.55.33.12:64640
Type
TCP
UDP
Internal IP 60.55.33.12 60.55.33.12
Internal Port 62600 63206
External IP 123.80.5.34 222.8.33.4
External Port 80 69
Status OK OK Connection Table
Trang 31Port-Switching Applications
with Stateful Firewalls
External FTP Server 123.80.5.34
2.
To Establish
TCP SYN Segment From: 60.55.33.12:62600 To: 123.80.5.34:21
Stateful Firewall
Type TCP
Internal IP 60.55.33.12
Internal Port 62600
External IP 123.80.5.34
External Port 21
Status OK State Table
Step 2
Trang 32Port-Switching Applications
with Stateful Firewalls
External FTP Server 123.80.5.34
Use Ports 20 and 55336 for Data Transfers
5.
To Allow, Establish Second Connection
4.
TCP SYN/ACK Segment From: 123.80.5.34:21 To: 60.55.33.12:62600
Use Ports 20 and 55336 for Data Transfers
Stateful Firewall
Type TCP TCP
Internal IP 60.55.33.12 60.55.33.12
Internal Port 62600 55336
External IP 123.80.5.34 123.80.5.34
External Port 21 20
Status OK OK
State Table
Step 2
Step 5
Trang 33Application Level
Gateway
Trang 34Application Gateway
Firewalls
Layers Addressed by Application-Proxy Gateway Firewalls
Trang 35hi n TELNET t i máy ch xa, ngệ ớ ủ ở ười
dùng được ch ng th c, sau đó gateway ứ ự
k t n i t i máy ch xa và thông tin ế ố ớ ủ ở
được chuy n ti p gi a 2 bên.ể ế ữ
Trang 36Application Level Gateway
Proxy có th t ch i chuy n ti p thông tin ể ừ ố ể ế
n u ch ng th c ngế ứ ự ười dùng th t b i ho c ấ ạ ặ
ng d ng
Có th ki m tra gói tin qua l i đ đ m b o ể ể ạ ể ả ả
an toàn - full packet awareness
D dàng ghi l i thông tin vì toàn b n i ễ ạ ộ ộ
dung gói tin có th hi u để ể ược
Nh ượ c đi m: ể C n ph i th c hi n thêm các ầ ả ự ệ
x lý – t ng đ ph c t p x lý.ử ă ộ ứ ạ ử
Trang 37Circuit-Level Gateway
Trang 38Circuit Level Gateway
Không cho phép các k t n i TCP end-to-endế ốThi t l p ế ậ hai k t n i TCP ế ố : M t gi a gateway ộ ữ
và tr m bên trong, m t gi a gateway và ạ ộ ữ
tr m bên ngoài.ạ
Chuy n ti p các phân đo n TCP ể ế ạ t m t k t ừ ộ ế
n i bên này t i k t n i bên kia ố ớ ế ố mà không
th c hi n ki m tra n i dungự ệ ể ộ
Trang 39Circuit Level Gateway
Ch c n ng an ninh ứ ă (th c hi n theo chính ự ệsách) s xác đ nh k t n i nào đẽ ị ế ố ược phép
c dùng khi ng i dùng bên trong là
tin c y v i t t c các d ch v bên ngoài.ậ ớ ấ ả ị ụ
Thường được s d ng k t h p v i m t ử ụ ế ợ ớ ộ
proxy cho các d ch v bên trong.ị ụ
Ch y u dùng đ che gi u thông tin c a ủ ế ể ấ ủcác m ng riêng bên trong.ạ
Trang 40Dedicated Proxy Servers
Trang 42Only essential services
Trang 43Bastion Host
Allows access only to specific hosts
Maintains detailed audit information by logging all traffic
terminating intruder attacks
Each proxy is a small, highly secure
subset of the general application
Trang 44Proxies run as non-privileged users
Trang 45Bastion Host,
Single-Homed
Trang 46Bastion Host, Single-Homed
host
For traffic from the Internet, only IP packets
For traffic from the internal network, only relayed packets from the bastion host are allowed out
Trang 47Bastion Host, Single-Homed
Bastion host performs authentication
Implements both packet level and application level filtering
Intruder penetrates two separate systems
before internal network is compromised
May contain a public information server
What happens if
this is compromised?
Trang 48Bastion Host, Dual-Homed
Trang 49Bastion Host, Dual-homed
Bastion host second defense layer
Internal network is completely isolated
Packet forwarding is turned off
More secure
Trang 50Screened Subnet
Trang 51Screened Subnet
Most secure
Isolated subnet with bastion host between two packet filtering routers
Traffic across screened subnet is blocked
Three layers of defense
Internal network is invisible to the Internet
Trang 52Typical DMZ
Internet
Primary DNS Server
Secondary DNS Server
Clients
Packet Filtering Routers BGP-4 Frac/T3 Frac/T3
.10 11
Trang 53DMZ Building Guidelines
Keep It Simple - KISS principle - the more
simple the firewall solution, the more secure and more manageable
Use Devices as They Were Intended to Be
Used – don’t make switches into firewalls
Create Defense in Depth – use layers,
routers and servers for defense
Pay Attention to Internal Threats – “crown
jewels” go behind internal firewall – adage:
“all rules are meant to be broken”
Trang 54Taming the DNS
Don’t want to reveal internal names and addresses
Internal network has an isolated,
pseudo-root DNS
“Split DNS” or “Split Brain”
Trang 55Taming the DNS
Trang 56Gateways to disparate networks
Hides internal addresses
Port Address Translation (PAT) – a variation using ports
Trang 58VPN’s Another Type of
Firewall
Connecting remote users
across the Internet
Connecting offices across Internet
Trang 59Other Types Of Firewalls
Host Based Firewalls – comes with some operating systems (LINUX, WIN/XP) –
ipfilter is a popular one
http://coombs.anu.edu.au/~avalon/
and crunchy on the outside, soft and
chewy on the inside
Trang 60Other Types Of Firewalls
Personal Firewalls
Appliances – personal
firewall appliances are
designed to protect small
networks such as
networks that might be
found in home offices
Provide: print server,
shared broadband use,
firewall, DHCP server and
NAT
(NB: This is not an endorsement of any product)
Trang 61Network Security
Trusted Systems
Trang 62Access Matrix
General model of access control:
• Subject – entity capable of accessing
objects (user = process= subject)
• Object – anything to which access is
controlled (files, programs, memory)
• Access right – way in which an object is accessed by a subject (read, write, exe)
Trang 63Access Matrix
Trang 64Access Control List
Trang 65Different requirement is to protect data
or resources on the basis of security
levels (unclassified, confidential, secret and top secret)
Trang 66No read up: Subject can only read an object
of less or equal security level
No write down: Subject can only write into
an object of greater or equal security level
Trang 67Reference Monitor
Trang 68Reference monitor is a controlling
element in hardware and OS
Enforces the security rules in the
security kernel database (no read up, no write down)
Trang 69Trusted System
Properties
Complete mediation – security rules enforced on every access
Isolation – reference monitor and
database are protected from
unauthorized modification
Verifiability – reference monitor’s
correctness must be mathematically provable
Trang 70Trojan Horse Defense
Alice installs trojan horse program and gives Bob write only permission
Trang 71Trojan Horse Defense
Alice induces Bob to invoke the trojan horse Program detects it is being executed by Bob, reads the sensitive character string and writes it into Alice’s back-pocket file
Trang 72Trojan Horse Defense
Two security levels are assigned, sensitive(higher) and public Bob’s stuff
is sensitive and Alice’s stuff is public.
Trang 73Trojan Horse Defense
If Bob invokes the trojan horse program, that program acquires Bob’s security and is able to read the character string However, when the
program attempts to store the string, the no write down policy is invoked
Trang 74A classic in the field published in 1994 Know for its
“bombs” which
indicated a serious risk
Trang 75Important URLs
Evolution of the Firewall Industry - Discusses different architectures and their differences, how packets are processed, and provides a
timeline of the evolution
http://csrc.nist.gov/publications/nistpubs/800-4 1/sp800-41.pdf
NIST Guidelines On Firewalls and Firewall Policy
Trusted Computing Group
Vendor group involved in developing and
promoting trusted computer standards
Trang 76Read “An Evening With Berferd” – notice the techniques used (traces, protocols, etc.) – Do not attempt this at home
Trang 77Remember Hans Brinker