Tải bản đầy đủ (.ppt) (65 trang)

Bài giảng môn an toàn mạng Web Security

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (1.07 MB, 65 trang )

1
Network Security
Web Security
2
Web and HTTP
M t s khái ni mộ ố ệ
Trang Web là m t tài li u bao g m các đ i ộ ệ ồ ố
t ngượ
i t ng có th là v n b n, hình nh, Java Đố ượ ể ă ả ả
applet, file âm thanh,…
Trang Web có m t file HTML c s , ch a các ộ ơ ở ứ
đ i t ng ho c tham chi u t i đ i t ng.ố ượ ặ ế ớ ố ượ
M i đ i t ng đ c ch ra b i m t ỗ ố ượ ượ ỉ ở ộ URL
Ví d URL:ụ
/>host name
path name
3
T ng quan HTTPổ
HTTP: hypertext transfer
protocol
Giao th c t ng ng d ng ứ ầ Ứ ụ
c a Webủ
Mô hình client/server
client: Trình duy t, ệ
th c hi n vi c yêu ự ệ ệ
c u, thu nh n và hi n ầ ậ ể
th các đ i t ng Webị ố ượ
server: Máy ch Web ủ
g i các đ i t ng đáp ử ố ượ
ng các yêu c u c a ứ ầ ủ
client.


HTTP 1.0: RFC 1945
HTTP 1.1: RFC 2068
PC running
Explorer
Server
running
Apache Web
server
Mac running
Navigator
H
T
T
P

r
e
q
u
e
s
t
H
T
T
P

r
e
q

u
e
s
t
H
T
T
P

r
e
s
p
o
n
s
e
H
T
T
P

r
e
s
p
o
n
s
e

4
T ng quan HTTPổ
S d ng giao th c TCP t ng Giao v n:ử ụ ứ ở ầ ậ
Client kh i t o k t n i TCP (socket) t i máy ch ở ạ ế ố ớ ủ
Web t i c ng 80.ạ ổ
Máy ch ti p nh n k t n i TCP t client.ủ ế ậ ế ố ừ
Các thông đi p HTTP đ c trao đ i gi a trình ệ ượ ổ ữ
duy t (client) và máy ch Web.ệ ủ
K t n i TCP đóng khi h t nhu c u trao đ i.ế ố ế ầ ổ
5
HTTP request message
Hai lo i HTTP messages: ạ request, response
HTTP request message:
ASCII (human-readable format)
GET /somedir/page.html HTTP/1.1
Host: www.someschool.edu
User-agent: Mozilla/4.0
Connection: close
Accept-language:fr
(extra carriage return, line feed)
Dòng yêu cầu
(GET, POST,
HEAD commands)
Dòng tiêu đề
Ký tự xuống dòng,
Cho biết kết thúc request
6
HTTP request message:
general format
7

Uploading form input
POST method:
Trang Web có các
form input
Input đ c g i lên ượ ử
server trong ph n ầ
body c a request.ủ
URL method:
Dùng GET method
Input đ c g i lên ượ ử
trong tr ng URL c a ườ ủ
request.
/>8
Method types
HTTP/1.0
GET
POST
HEAD
Ch g i ph n ỉ ử ầ
header.
HTTP/1.1
GET, POST, HEAD
PUT
Upload file trong
ph n body lên ầ
đ ng d n n đ nh ườ ẫ ấ ị
trong URL.
DELETE
Xóa file đ c ch ượ ỉ
đ nh trong URLị

9
HTTP response message
HTTP/1.1 200 OK
Connection: close
Date: Thu, 06 Aug 1998 12:00:15 GMT
Server: Apache/1.3.0 (Unix)
Last-Modified: Mon, 22 Jun 1998 …
Content-Length: 6821
Content-Type: text/html

data data data data data
status line
(protocol
status code
status phrase)
header
lines
data, e.g.,
requested
HTML file
10
Web Security
Internet hai chi uề – d b t n công ễ ị ấ
(không gi ng các h th ng truy n ố ệ ố ề
thông c )ũ
tr c quan caoĐộ ự – d phát tán thông ễ
tin, ti t l bí m t, vi ph m b n quy nế ộ ậ ạ ả ề
Ph c t p v h th ngứ ạ ề ệ ố – giao th c đ n ứ ơ
gi n, nh ng các ng d ng ả ư ứ ụ
client/server ph c t pứ ạ

Các đi m d b t n côngể ễ ị ấ – web server
có th tr thành bàn đ p cho các t n ể ở ạ ấ
công khác.
11
Các m i đe d a v i an ố ọ ớ
toàn Web
12
Các ph ng án b o v ươ ả ệ
d li u Webữ ệ
Phân lo i các m i đe d a theo các v ạ ố ọ ị
trí: máy ch web, trình duy t, d li u ủ ệ ữ ệ
trao đ i qua m ng.ổ ạ
B o v d li u trong quá trình trao đ i:ả ệ ữ ệ ổ
IPsec
Secure Sockets Layer (SSL)
Transport Layer Security (TLS)
Secure Electronic Transaction (SET)
13
Ph ng án ti p c n ươ ế ậ
an toàn Web
Trong suốt với
người dùng
cuối
Nằm phía trên
TCP, nhúng
trong các gói
tin.
Mức độ ứng
dụng - SET
14

SSL
Gi i thi u b i ớ ệ ở Netscape
C nh tranh v i ạ ớ SHTTP
Version 3 tr thành khuy n ngh ở ế ị
Internet
TLS (Transport Layer Security) là
m t giao th c đ a ra đ t o 1 ộ ứ ư ể ạ
chu n chungẩ
SSLv3.1 = TLS
15
Ki n trúc SSLế
S d ng TCPử ụ đ t o d ch v truy n ể ạ ị ụ ề
tin c y.ậ
Hai l p giao th c:ớ ứ
SSL Record Protocol – các d ch ị
v an toàn c b n cho các l p ụ ơ ả ớ
trên
Ba giao th c b c cao h nứ ậ ơ – dùng
đ qu n lý các trao đ i SSL.ể ả ổ
16
SSL Protocol Stack
Basic Security
Services
Manages SSL
Exchanges
17
Khái ni m/Ki n trúc SSLệ ế
Connection – peer-to-peer relationships in
the transport layer. Every connection is
associated with one session

Session – an association between a client
and a server created by the Handshake
Protocol
Define a set of cryptographic security
parameters, which can be shared among
multiple connections
Avoid the expensive negotiation of new
security parameters for each connection
18
SSL Statefullness
Multiple secure connections in a
session
Number of states associated with
each session
Current operating state for read
and write (receive and send)
Pending read and write states
created during Handshake Protocol
19
Session State
Session identifier – arbitrary byte
sequence chosen by the server
Peer certificate – X.509.v3 digital
certificate of peer; may be null
Compression method
Cipher spec – algorithms used (AES,
MD5)
Master secret – 48 byte shared key
Is resumable – session can be used to
initiate new connections

20
Connection State
Server and client random – byte
sequences chosen for each connection
Server/Client write MAC secret – secret
key used in MAC operations on data
sent by the server/client
Server/Client write key – conventional
encryption key
Initialization vectors – needed for CBC
mode
Sequence numbers – separate for xmit
& recv
21
SSL Record Protocol
Provides two important services
for SSL connections:

Confidentiality – Handshake
Protocol defines a secret key for
conventional encryption of SSL
payloads

Integrity – Handshake Protocol
defines a shared secret key used
to form a message authentication
code (MAC)
22
SSL Record Protocol
Ops

message
optional
23
SSL Record Protocol
Ops
Fragmentation – block of 16K bytes
or less
Compression – optional, must not
increase content length beyond
1024 bytes
Message authentication code
(MAC) – uses shared secret key,
similar to HMAC algorithm
24
Recall: HMAC
Effort to develop a MAC derived
from a cryptographic hash code
Executes faster in software
No export restrictions
Relies on a secret key
RFC 2104 list design objectives
Used in IPsec
25
HMAC Structure
Message,
M

By passing
S
i

and
S
o

through the hash
algorithm, we have
pseudoradomly
generated two keys
from
K
.
secret key
output

×