chapter6-22
chapter6-22
Network
communications Security
1
Outline
2
Network Security Concepts
Any organization/entity having its own local network should conceive and
3
Digital communication Security Analogy
4
Reminder: Communication Layered Model
5
Communication across OSI model
6
OSI vs TCP/IP model
7
OSI Security Architecture
8
Possible placement of security services in
OSI protocol layers (X.800)
9
Security Protocols
Many different security protocols have been specified and
implemented for different purposes such as CIA, Key
establishment/Exchange,…
This lecture discusses the operation of two network-related
protocols that are in common use:
Transport Layer Security (TLS): used extensively on the web, email, VoIP
IP Security (IPSec): provides security services at the IP level and is used to provide
Virtual Private Network (VPN) services.
10
Transport Layer Security
(TLS)
11
TLS: Overview
Port 443 is reserved for HTTP over TLS/SSL and the protocol https is
used with this port.
http://www.xxx.com implies using standard HTTP using port 80.
https://www.xxx.com implies HTTP over TLS/SSL with port 443.
12
TLS operates at the layer 4 of the OSI model.
TLS is the successor of SSL
13
History: SSL/TLS
1994: Netscape Communications developed the network authentication protocol Secure
Sockets Layer, SSLv2. Badly broken
1995: Netscape release their own improvements SSLv3. Widely used for many years.
1996: SSLv3 was submitted to the IETF as an Internet draft, and an IETF working group was
formed to develop a recommendation.
In January 1999, RFC 2246 was issued by the IETF, Transport Layer Security Protocol: TLS
1.0 Similar to, but incompatible with SSLv3
Currently TLS 1.2 (2008) (allows backwards compatibility with SSL)
Draft TLS 1.3 (2016) (totally bans SSL)
Firefox browser enabled TLS 1.3 by default in February 2017
14
TLS: Architecture Overview
The TLS Record Protocol provides the practical encryption and integrity
services to various application protocols.
16
TLS: Protocol Stack
17
TLS: Handshake Protocol
The handshake protocol:
Negotiates the encryption to be used
Establishes a shared session key
Authenticates the server
Authenticates the client (optional)
Completes the session establishment
18
TLS: Handshake Four phases
19
Simplified RSA-based Handshake
20
Elements of Handshake
Client hello: Advertises available cipher suites (e.g. RSA, AES, SHA256)
Server hello:
Returns the selected cipher suite
Server adapts to client capabilities
RSA and Client Certificate: Optionally, the client can send its X.509 certificate to
server, in order to provide mutual authentication, assumes RSA algorithm
Anonymous Diffie-Hellman :Optionally, the client and server can establish session
key using the Diffie-Hellman algorithm
21
Record Protocol Overview
2. Message Integrity:
Ensure that the receiver can detect if a message is modified in transmission.
The Handshake Protocol establishes a shared secret key used to construct a
MAC.
22
SSL/TLS Challenges
23
SSL Stripping Attack
MitM server can connect to client over https in msg (6) with server certificate that has
similar domain name as real server.
Attacker can leave the connection after stealing credentials, then the client connects
directly to real server with https 24
Preventing SSL Stripping with HSTS
A secure server can instruct browsers to only use https
When requesting website that uses HTTP Strict Transport Security (HSTS), the
browser automatically forces connect with https.
Disadvantages
HSTS websites can not use both http and https
Difficult for a website to stop using https
Can cause denial of service, e.g. no fallback to http in case of expired server certificate.
25
Preventing SSL Stripping with HSTS
Limitation of HSTS:
Requires first visit to secure website to set HSTS policy in browser
Can be solved by browser having preloaded list of HSTS websites
27
Popular sites using HTTP Strict Transport
Security
Google.com
Youtube.com
Facebook.com
Wikipedia.org
Reddit.com
Yahoo.com
Google.co.in
Amazon.com
Tmall.com
Twitter.com
28
Phishing and failed authentication
29
30
IPSec and VPN
31
IPSec Overview
Internet Protocol security (IPSec) is standard for secure communications
over Internet Protocol (IP) networks, through the use of cryptographic
security services.
Uses encryption, authentication and key management algorithms
Based on an end-to-end security model at the IP level
Provides a security architecture for both IPv4 and IPv6
Mandatory for IPv6
Optional for IPv4
Message Confidentiality
Protects against unauthorized data disclosure.
Accomplished by the use of encryption mechanisms.
Message Integrity
IPsec can determine if data has been changed (intentionally or unintentionally) during
transit.
Integrity of data can be assured by using a MAC.
34
Security Services provided by IPSec (2)
Selectively provides ….
35
IPsec and the IP protocol stack
IPsec puts the two main protocols in between IP and the other
protocols: AH and ESP
37
IPSEC Protocol Suite
38
Internet Key Exchange (IKE)
Two phase protocol used to establish parameters and keys for session
39
Phase 1
Sample of a key establishment based on DH
40
Security Association (Phase2)
A security association (SA) contains info needed by an
IPSec endpoint to support one end of an IPSec
connection.
Can include cryptographic keys and algorithms, key
lifetimes, security parameter index (SPI), and security
protocol identifier (ESP or AH).
The SPI is included in the IPSec header to associate a
packet with the appropriate SA.
Security Associations are simplex
need one for each direction of connection
stored in a security association database (SAD).
41
Authentication Header (AH)
43
Modifications to the packet format
(AH Mode)
44
IPSec Authentication
Authentication data
Hash of packet contents include IP header as as specified by SPI
Treat transient fields (TTL, header checksum) as zero
45
Encapsulating Security Payload (ESP)
Confidentiality, authenticity and integrity
via encryption and HMAC
over IP payload (data)
46
Modifications to the packet format
(ESP Mode)
47
Transport Mode ESP
48
ESP in Transport Mode
The data after the original IP header is padded by adding an ESP trailer and
the result is then encrypted using the symmetric cipher and key in the SA.
An ESP header is prepended.
If an SA uses the authentication service, an ESP MAC is calculated over the
data prepared so far and appended.
The original IP header is prepended.
However, some fields in the original IP header must be changed. For example,
Protocol field changes from TCP to ESP.
Total Length field must be changed to reflect the addition of the AH header.
Checksums must be recalculated.
49
Tunnel Mode ESP
50
ESP in Tunnel Mode
The entire original packet is padded by adding an ESP trailer and the result is
then encrypted using the symmetric cipher and key agreed in the SA.
An ESP header is prepended.
If an SA uses the authentication service, an ESP MAC is calculated over the data
prepared so far and appended.
A new ‘outer’ IP header is prepended.
The ‘inner’ IP header of the original IP packet carries the ultimate source and destination
addresses.
The ‘outer’ IP header may contain distinct IP addresses such as addresses of security gateways.
The ‘outer’ IP header Protocol field is set to ESP.
51
VPN: Typical usage of IPSec
52
IPSec: Common Architectures
1. Gateway-to-Gateway Architecture
2. Host-to-Gateway Architecture
3. Host-to-Host Architecture
(NIST Special Publication 800-77)
53
Gateway to Gateway architecture
54
Host to Gateway Architecture
55
Host to Host Architecture
56
Comparison of VPN Architecture Models
57
Risks of using VPN
IPSec typically used for VPN (Virtual Private Networks)
A VPN client at external location may be connected to the Internet (e.g.
from hotel room or café) while at the same time being connected to home
network via VPN.
VPN gives direct access to resources in home network.
Internet access from external location may give high exposure to cyber
threats: No network firewall, no network IDS
Attacks against the VPN client at external location can directly access the
home network through VPN tunnel.
58
Risks of VPN
59
Conclusion
Communication security enables to protect traffic moving on unprotected
networks.
In this chapter we focused on two security protocols present at the
application and network layers respectively TLS and IPSec.
The next chapter deals with network perimeter security which presents the
second axis of network security.
60