Security in (inter)network
Jan 02, 2016
Security in (inter)network
2
So far…
• We looked at the methods by which the denial of services (such as the delay the delivery of messages or denial of system services) as well as the problem with IP authentication methods and the routing attacks.
3
In this lecture
• SMTP routing
• Functions of a wrapper and TCP wrappers
• Security provided in IP (IPSec) and that leads to…
4
Security in layered IP
• Security at the IP layer is related to the layer’s function of end-to-end datagram delivery.
• The security weakness are:– Network snooping
– Message replay
– Message alteration
– Message delay and denial
– Authentication issues
– Routing attacks
5
FIREWALL
INTERNET
Exterior Router
Internal Network
Perimeter Network
Interior Router
Bastion Host
SMTP Routing1. Route incoming/outgoing mail to bastion Host.2. Use Exterior Router to restrict connections from
external hosts to Bastion Host.3. Use Interior Router to restrict connections from
Bastion Host to specific internal servers.4. Internal systems send mail to Bastion Host.
SMTP ROUTING
SMTP Server
SMTP Sender/Recipient
ExternalSMTP Server
SMTP Client Inside SMTP Server
6
Exterior Router
Internal Network
Perimeter Network
Interior Router
Bastion Host
DNS NAME LOOKUP ITERATION
Outside DNS Server
DNS Client Inside DNS Server
root
edu gov
temple
sims
rootname server
eduname server
cssename server
templename server
Internetquery for address of [email protected]
referral to edu name server
referral to csse name server
referral to temple name server
address of [email protected]
FIREWALL
query for address of [email protected]
query for address of [email protected]
query for address of [email protected]
csse
7
NATs are based upon the idea that only a small part of the hosts in a private network will communicate outside that network. Nats are a solution for those organizations that use Non-routable IP addresses. A NAT, normally part of a Firewall, is positioned between the Private Network and the Internet and:
Dynamically translates the private IP address of an outgoing packet into an Internet IP address. Dynamically translates the return Internet IP address into a private IP address.
Only TCP/UDP Packets are translated by NAT. For example, the Private Network cannot be Pinged (ie. ICMP is not supported).
Network Address Translators
InternetPrivateNetwork
Translate
Map
Exclude
Network Address Translator
PoolStatic
Addresses
8
TCP/IP Security
9
Why Wrappers?
• These programs are born out of the need to modify the operating systems without access to the systems’ source code as well as security tools.– the security logic is encapsulated into a single program,
wrappers are simple and easy to validate.
– the wrapped program remains a separate entity, it can be upgraded without a need to re-certify the program that is wrapping it.
– wrappers call the wrapped program via the standard exec() system call, a single wrapper can be used to control access to a variety of wrapped programs.
10
Why Wrappers?
• Common use of wrappers is to limit the amount of information reaching a network-capable program.
• The above is an advantage because those programs are general in nature and are likely to be trusting and can accept too much information without validation.
11
TCP Wrapper The TCPWrapper is a utility program that can be "wrapped" around
existing servers connected to the Internet. A Firewall can be placed between your internal network and the
Internet to protect the entire internal network. The TCPWrapper is placed on an internal server and protects
the services of that machine. The combination of firewall and TCPWrapper provides defense
in-depth. The TCPWRapper was written by Wietse Venema and is used for:
Logging request for service made through /etc/inetd.confAnd intercepting and controlling TCP services that are started
by /etc/inetd.conf.
External User
Internal Server
INTERNET
RouterBastion Host
Firewall
TCP Wrapper
12
TCP Wrapper OperationThe TCPWrapper is installed on the internal server and inetd is configured to run
TCPwrapper, tcpd, instead of the the real server. inetd is the internet protocol starter program that, upon detecting a service
request, forks a process directly to the requested service. tcpd is is the TCPWrapper program that receives control from inetd when an
internal server has been "wrapped". tcpd evaluates the request against two TCPWrapper configuration files
/etc/hosts.allow tells tcpd which host to allow connections from. If no match found, then search
/etc/hosts.deny tells tcpd to deny all connections from that host. If no match is found the connection is allowed.
External User
INTERNET
inetd
/etc/hosts.allow
/etc/hosts.deny
tcpd
inetd.conf
telnetftprloginudp, etc
network services
RequestedService
tcpd
Router Bastion Host
Firewall
TCP Wrapper tcpd completes its function then transfers control to the requested service.
13
TCP Wrapper Functions
The TCPWrapper performs the following functions upon assuming control from inetd.
Compares the incoming hostname and requested service with previously created host.allow an hosts.deny files.
Performs a double-reverse lookup of the IP address to make sure the DNS entries for the IP address match the hostname.
Logs the result with syslog. This provides a way to log services that are normally not logged, e.g., finger and systat.
Optionally run a command, e.g., run finger to get a list of users on the connecting client computer.
Optionally substitute a different version of the requested service daemon, e.g., the calling host may require a special extended service.
Optionally send a banner to the connecting client.Passes control of the connection to the real network daemon.Reject the connection without providing a service.
14
Secure Sockets Layer
The Secure Sockets Layer (SSL) is a transport layer security protocol developed by Netscape to provide:
Data Privacy through Encryption.Validate a peer's identify through Authentication and
CertificatesAssure message integrity through a Message Authentication
Code (MAC). SSL, in practice, is only widely implemented in the Hypertext
Transport Transfer Protocol (HTTP), however, it is application independent and can be employed with other application types such as NNTP, TELNET, etc.
Interface
Internet
TCP
SSL Record Layer
SSL Handshake
Application
15
Secure Sockets Layer Contd
SSL is composed of two major protocols:The SSL Record Layer is a protocol for transferring data using variety of
predefined cipher and authentication combinations which are negotiated by the SSL Handshake Protocol.
The Sender performs the following tasks:Take the data from the upper application and fragment it into manageable blocks.
Optionally compress the data and apply a Message Authentication Code (MAC).
Encrypt the data and transmit it to the lower layer. The Receiver performs the following tasks:
Take the data from the lower layer and decrypt it.Verify the data with the negotiated MAC key and decompress it.Reassemble the message and transmit it to the upper layer.
Interface
Internet
TCP
SSL Record Layer
SSL Handshake
Application
16
SSL is composed of two major protocols:The SSL Record Layer is a protocol for transferring data using
variety of predefined cipher and authentication combinations which are negotiated by the SSL Handshake Protocol.
The SSL Handshake is a protocol for establishing: The protocol version The initial authentication, Public-Key encryption method Encryption methodology.
Interface
Internet
TCP
SSL Record Layer
SSL Handshake
Application
Secure Sockets Layer Contd
17
SSL Handshake
SSL VersionRandomSession IDCiphersSuiteCompression Method
Client Hello Message
Server Hello Message
ServerCertificate MessageServerKeyExchange MessageCertificateRequest MessageServerHelloDone Message
Server
Client Certificate MessageClientKeyExchange MessageCertificateVerify Message
ChangeCipherSpec MessageClientFinished Message
Client
ChangeCipherSpec MessageClientFinished Message
18
Internet Protocol Security
- IPSec -
19
IP SECURITY
Authentication: Allows the receiver to validate the identity of a user, client process or server process.Integrity: Provides assurance to the receiver that the transmitted data has not been changed.Confidentiality: Preventing the unwanted disclosure of information during transit.
SECURITY ISSUES
SECURITY STRATEGYMessage Digest 5(MD5): Used to satisfy Authentication and Data Integrity.Cipher Block Chaining/Data Encryption Standard (CBC-DES): Used to satisfy confidentiality.
20
IP Security
Interface
IPSec
TCP
Application
Internet Protocol Security (IPSec) is a Network layer security protocol proposed by IETF to provide:
Data Privacy through Encryption.Validate a peer's identify through Authentication.Assure message integrity through a Message Authentication Code
(MAC). IPSec is employed with both IPv4 and IPv6 but is a mandatory
component with IPv6. It is composed of two major components:Authentication Header (AH).Encapsulating Security Payload (ESP).
IPSec employs two major concepts:Security Association (SA).Tunneling.
Network
21
IPSecurity Contd
Interface
IPsec
TCP
Application
A Security Association is a logical simplex, connection between two IPSec systems composed of the following triple:
<Security Parameter Index, IP Destination Address, Security Protocol>An SPI is a 32 bit value used to distinguish between SAs. It has local significance only and is used as an index into the Security
Association Database (SAD) to identify SA parameter information so that the packet can be correctly processed.
The IP Destination address is self-explanatory.The Security Protocol can be either AH or ESP.
AH and ESP support the following two modes:Transport Mode: End-to-End communication,e.g., client to server.Tunnel Mode: Gateway to Gateway communication,e.g., Firewall to Firewall.
22
Authentication
23
IPv6 AUTHENTICATION OVERVIEW
Router Router
IPv6 NetworkIPv6 Network
IPv6 Network
DataMsgDigest
Authentcation Key
DataMsgDigest
Authentication Key
The source and destination share an authentication key.The source performs the MD5 algorithm using the data and the authentication key as input. It includes an SPI to identify the key. The destination identifies the authentication key through the SPI, performs the same calculation and compares the computed MD with the transmitted MD. If they are the same the message is authenticated. The actual message is transmitted in cleartext.
Each client and server is configured with a security table that contains the Security Parameter Index(SPI) and the Authentication Key.
DataSPI MD DataSPI MD
24
IPv6 AUTHENTICATION HEADER
VERS PRITY Flow Label4 bits 4 bits 24 bits
Payload Length16 bits
Nxt Hdr : 51
Source IP Address128 bits
Destination IP Address128 bits
Hop Limit8bits
Nxt Hdr : 6 Hdr Length
Authentication Data
TCP Header and Data
All IP packets begin with the basic IP Header. IP Authentication Headers are used to ensure that (1) the received data is authentic - not been altered in transit and (2) that it came from the real sender. Authentication is part of the enhanced security feature of IPv6. It is also designed to be used with IPv4. It specifies Message Digest 5(MD5) as the default authentication algorithm. The Security Association (SA) consists of the Security Parameter Index, the IP destination address and the Security Protocol.
Reserved
Secrity Parameter Index
Security Parameter Index(SPI) field: An index used by the server and the client to point to an internal table that contains the authentication key assigned to each IP address. Authentication Data field: A 128 bit digest containing the results of the MD5 algorithm as applied to the authentication key, the IP datagram and the IP address. It serves as a user authenticator.
25
IPv6 AUTHENTICATION SOURCE SPI
Destination IPAddress
Role Client SourceIP Address
SPIClient
AuthenticationKey
Client Authentication
Method
Client Encryption
Key
Client Encryption
Method130.15.20.2135.150.201.2
130.15.20.1
Source Security Information at Host 130.15.60.10
Host 12 130.15.60.10 x?34-15-4R-44-C0.... MD5 #$%FFGH&*()!#... CBC-DES
Host 42 130.15.60.10 MD5 CBC-DES
Host 62 130.15.60.10 MD5 None
..........
..........
........
........
The transmitting client looks up the destination IP address in its security table.The Message Digest is calculated using MD5.
The 128 bit key is retrieved from the table.The complete datagram is appended to the key.The key is appended once more to the end.This block of data is then passed through the MD5 algorithm. All fields that change during transit are treated as zeroes. The MD5 compresses the message into a one-way hash(message digest) of 128-bits.
The resulting message digest is then placed into the authentication header.The SPI, Message Digest and the cleartext datagram are then transmitted.
26
IPv6 AUTHENTICATION DESTINATION SPI
Client SourceIP Address
SPIClient
AuthenticationKey
Client Authentication
Method
Client Encryption
Key
Client Encryption
Method
Destination Security Information at Host 130.15.20.2
12 130.15.60.10 x?34-15-4R-44-C0.... MD5 #$%FFGH&*()!#... CBC-DES
42 130.150.201.20 MD5 CBC-DES
62 130.15.20.1 MD5 None.................... ........
........
The destination client uses the SPI to look up the source client in the table and compare the source IP address on the message with the source address of the table.The receiving station then calculates the Message Digest using MD5.
The 128 bit key is retrieved from the table.The complete cleartext datagram is appended to the key.The key is appended once more to the datagram.This block of data is then passed through the MD5 algorithm. All fields that change during transit are treated as zeroes.The MD5 compresses the message into a one-way hash(message digest) of 128-bits.
The resulting MD is then compared to the transmitted MD.
27
Encryption
28
CipherText
IPv6 ENCRYPTION OVERVIEW
Router Router
IPv6 NetworkIPv6 Network
IPv6 Network
ClearText
Encryption Key
The source and destination share an Encryption Key.The source performs the CBC-DES algorithm using the data, Initialization Vector (IV) and the encryption key as input. It includes an SPI to identify the key and the IV as the initializing random number.The destination identifies the encryption key through the SPI and decrypts the message utilizing the CBC-DES and the IV.
Each client and server is configured with a security table that contains the SPI and the Encryption Key.
E-DataSPI IV E-DataSPI IV
Encryption Key
CipherText ClearText
29
IPv6 ENCAPSULATING SECURITY PAYLOAD
VERS PRITY Flow Label4 bits 4 bits 24 bits
Payload Length16 bits
Nxt Hdr : 50
Source IP Address128 bits
Destination IP Address128 bits
Hop Limit8bits
Payload Data
All IP packets begin with the basic IP Header. IP Encapsulating Security Payload (ESP) is used for confidentiality,i.e., to prevent the unwanted disclosure of information. ESP is part of the enhanced security feature of IPv6.
It is also designed to be used with IPv4.
It specifies Cipher Block Chaining -Data Encryption Standard (CBC-DES) as the default encryption algorithm. The security association consists of the Security Parameter Index, the IP destination address and the Security Protocol.
Security Parameter Index
Security Parameter Index field: An index used by the server and the client to point to an internal table that contains the encryption key assigned to each IP address. Initialization Vector field: Used by the CBC-DES as a random number to start the encryption process. Padding: Added to force the ESP to be an integer multiple of 32. Padding Length: the length of the padding field. Payload Type: indicates which protocol has been encapsulated,e.g., 6 = TCP.
Initialization Vector
Padding(if needed) Pad Length Payload Type
30
IPv6 ENCRYPTION SOURCE SPI
Destination IPAddress
Role Client SourceIP Address
SPIClient
AuthenticationKey
Client Authentication
Method
Client Encryption
Key
Client Encryption
Method130.15.20.2135.150.201.2
130.15.20.1
Source Security Information at Host 130.15.60.10
Host 12 130.15.60.10 x?34-15-4R-44-C0.... MD5 #$%FFGH&*()!#... CBC-DES
Host 42 130.15.60.10 MD5 CBC-DES
Host 62 130.15.60.10 MD5 None
..........
..........
........
........
The transmitting client looks up the destination IP address in its security table.The message is encrypted using CBC-DES.
The encryption key is retrieved from the table.The first block of ciphertext is produced by XORing the IV with the first block of cleartext. The next block of data is produced by XORing the current cleartext block, the previous ciphertext block and the encryption key (the same key used for each block).In this fashion all blocks are chained together for encryption.
The resulting cipher blocks are concatenated for transmission.The SPI, Initialization Vector and the ciphertext datagram is then transmitted.
31
IPv6 ENCRYPTION DESTINATION SPI
Client SourceIP Address
SPIClient
AuthenticationKey
Client Authentication
Method
Client Encryption
Key
Client Encryption
Method
Destination Security Information at Host 130.15.20.2
12 130.15.60.10 x?34-15-4R-44-C0.... MD5 #$%FFGH&*()!#... CBC-DES
42 130.150.201.20 MD5 CBC-DES
62 130.15.20.1 MD5 None.................... ........
........
The destination client uses the SPI to look up the source client in the table and compares the source IP address on the message with the source address in the table. The message is decrypted using CBC-DES.
The encryption key is retrieved from the table.The key is applied against the first block of ciphertext and the result is XORed against the IV to produce the first block of cleartext.The key is applied against the second block of ciphertext and the result is XORed against the ciphertext of the previous stage to produce the second block of cleartext. In this fashion all blocks are chained together for decryption.
The cleartext is then passed to the higher level protocols.
32
Security at the Application Layer
• Application gateways are firewalls that operate at the application layer (note: screening router operates at Network and Transport layers while firewalls can operate in all the three layers including the application layer)– E.g of application gateways are: mail gateway (also known as
SMTP gateway), proxy (is used when a firewall separates the internal network from the rest of the world), server filter (host software that filters client access to its own servers).
ApplicationClient
ApplicationServer
Proxy
Client
Server
External Network Internal Network
OutboundRequest
InboundReplyt
33
Next 2 weeks of lectures
• Encryption and digital signatures
34
Assignment Allocation
• The current allocation is available on the web.
• Pl send me an email about the topic of your choice.