Security in internetwork So far We looked at

  • Slides: 34
Download presentation
Security in (inter)network

Security in (inter)network

So far… • We looked at the methods by which the denial of services

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. 2

In this lecture • SMTP routing • Functions of a wrapper and TCP wrappers

In this lecture • SMTP routing • Functions of a wrapper and TCP wrappers • Security provided in IP (IPSec) and that leads to… 3

Security in layered IP • Security at the IP layer is related to the

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: 4 – Network snooping – Message replay – Message alteration – Message delay and denial – Authentication issues – Routing attacks

SMTP ROUTING External SMTP Server INTERNET SMTP Sender/Recipient SMTP Server Bastion Host SMTP Routing

SMTP ROUTING External SMTP Server INTERNET SMTP Sender/Recipient SMTP Server Bastion Host SMTP Routing 1. 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. Exterior Router Perimeter Network FIREWALL Interior Router Internal Network 5 SMTP Client Inside SMTP Server

DNS NAME LOOKUP ITERATION Outside DNS Server root name server Internet root query for

DNS NAME LOOKUP ITERATION Outside DNS Server root name server Internet root query for address of host@temple. csse. monash. edu. au referral to edu name server referral to csse name server Bastion Host csse name server referral to temple name server query for address of host@temple. csse. monash. edu. au gov edu query for address of host@temple. csse. monash. edu. au csse sims temple name server temple Exterior Router Perimeter Network FIREWALL Interior Router Internal Network 6 DNS Client Inside DNS Server

Network Address Translators l NATs are based upon the idea that only a small

Network Address Translators l NATs are based upon the idea that only a small part of the hosts in a private network will communicate outside that network. l Nats are a solution for those organizations that use Non-routable IP addresses. l A NAT, normally part of a Firewall, is positioned between the Private Network and the Internet and: 4 Dynamically translates the private IP address of an outgoing packet into an Internet IP address. 4 Dynamically translates the return Internet IP address into a private IP address. l Only TCP/UDP Packets are translated by NAT. For example, the Private Network cannot be Pinged (ie. ICMP is not supported). Network Address Translator Private Network Translate Map Exclude 7 Pool Static Addresses Internet

TCP/IP Security 8

TCP/IP Security 8

Why Wrappers? • These programs are born out of the need to modify the

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. 9

Why Wrappers? • Common use of wrappers is to limit the amount of information

Why Wrappers? • Common use of wrappers is to limit the amount of information reaching a networkcapable 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. 10

TCP Wrapper l The TCPWrapper is a utility program that can be "wrapped" around

TCP Wrapper l The TCPWrapper is a utility program that can be "wrapped" around existing servers connected to the Internet. l A Firewall can be placed between your internal network and the Internet to protect the entire internal network. 4 The TCPWrapper is placed on an internal server and protects the services of that machine. 4 The combination of firewall and TCPWrapper provides defense in-depth. l The TCPWRapper was written by Wietse Venema and is used for: 4 Logging request for service made through /etc/inetd. conf 4 And intercepting and controlling TCP services that are started by /etc/inetd. conf. Firewall INTERNET External User Router Bastion Host TCP Wrapper 11 Internal Server

TCP Wrapper Operation l The TCPWrapper is installed on the internal server and inetd

TCP Wrapper Operation l The TCPWrapper is installed on the internal server and inetd is configured to run TCPwrapper, tcpd, instead of the real server. 4 inetd is the internet protocol starter program that, upon detecting a service request, forks a process directly to the requested service. 4 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. l tcpd completes its function then transfers inetd TCP Wrapper control to the requested service. /etc/hosts. allow inetd. conf Firewall Requested Service INTERNET Router External User 12 tcpd Bastion Host telnet ftp rlogin udp, etc network services /etc/hosts. deny

TCP Wrapper Functions l. The TCPWrapper performs the following functions upon assuming 13 control

TCP Wrapper Functions l. The TCPWrapper performs the following functions upon assuming 13 control from inetd. 4 Compares the incoming hostname and requested service with previously created host. allow an hosts. deny files. 4 Performs a double-reverse lookup of the IP address to make sure the DNS entries for the IP address match the hostname. 4 Logs the result with syslog. This provides a way to log services that are normally not logged, e. g. , finger and systat. 4 Optionally run a command, e. g. , run finger to get a list of users on the connecting client computer. 4 Optionally substitute a different version of the requested service daemon, e. g. , the calling host may require a special extended service. 4 Optionally send a banner to the connecting client. 4 Passes control of the connection to the real network daemon. 4 Reject the connection without providing a service.

Secure Sockets Layer Application SSL Handshake SSL Record Layer TCP Internet Interface l The

Secure Sockets Layer Application SSL Handshake SSL Record Layer TCP Internet Interface l The Secure Sockets Layer (SSL) is a transport layer security protocol developed by Netscape to provide: 4 Data Privacy through Encryption. 4 Validate a peer's identify through Authentication and Certificates 4 Assure message integrity through a Message Authentication Code (MAC). l SSL, in practice, is only widely implemented in the Hypertext Transport Transfer Protocol (HTTP), however, it is application 14 independent and can be employed with other application types such as NNTP, TELNET, etc.

Secure Sockets Layer Contd Application SSL Handshake SSL Record Layer TCP Internet Interface l

Secure Sockets Layer Contd Application SSL Handshake SSL Record Layer TCP Internet Interface l SSL is composed of two major protocols: 4 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. 4 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. 4 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. 15 *Reassemble the message and transmit it to the upper layer.

Secure Sockets Layer Contd Application SSL Handshake SSL Record Layer TCP Internet Interface l

Secure Sockets Layer Contd Application SSL Handshake SSL Record Layer TCP Internet Interface l SSL is composed of two major protocols: 4 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. 4 The SSL Handshake is a protocol for establishing: * The protocol version * The initial authentication, * Public-Key encryption method * Encryption methodology. 16

SSL Handshake Client Hello Message Client SSL Version Random Session ID Ciphers. Suite Compression

SSL Handshake Client Hello Message Client SSL Version Random Session ID Ciphers. Suite Compression Method Server Hello Message Server. Certificate Message Server. Key. Exchange Message Certificate. Request Message Server. Hello. Done Message Client Certificate Message Client. Key. Exchange Message Certificate. Verify Message Change. Cipher. Spec Message Client. Finished Message 17

Internet Protocol Security - IPSec 18

Internet Protocol Security - IPSec 18

IP SECURITY l. SECURITY ISSUES 4 Authentication: Allows the receiver to validate the identity

IP SECURITY l. SECURITY ISSUES 4 Authentication: Allows the receiver to validate the identity of a user, client process or server process. 4 Integrity: Provides assurance to the receiver that the transmitted data has not been changed. 4 Confidentiality: Preventing the unwanted disclosure of information during transit. l. SECURITY STRATEGY 4 Message Digest 5(MD 5): Used to satisfy Authentication and Data Integrity. 4 Cipher Block Chaining/Data Encryption Standard (CBC -DES): Used to satisfy confidentiality. 19

IP Security Application TCP Network IPSec Interface l Internet Protocol Security (IPSec) is a

IP Security Application TCP Network IPSec Interface l Internet Protocol Security (IPSec) is a Network layer security protocol proposed by IETF to provide: 4 Data Privacy through Encryption. 4 Validate a peer's identify through Authentication. 4 Assure message integrity through a Message Authentication Code (MAC). l IPSec is employed with both IPv 4 and IPv 6 but is a mandatory component with IPv 6. It is composed of two major components: 4 Authentication Header (AH). 4 Encapsulating Security Payload (ESP). l IPSec employs two major concepts: 4 Security Association (SA). 4 Tunneling. 20

IPSecurity Contd Application TCP IPsec Interface l A Security Association is a logical simplex,

IPSecurity Contd Application TCP IPsec Interface l 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> 4 An SPI is a 32 bit value used to distinguish between SAs. 4 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. 4 The IP Destination address is self-explanatory. 4 The Security Protocol can be either AH or ESP. l. AH and ESP support the following two modes: 4 Transport Mode: End-to-End communication, e. g. , client to server. 21 4 Tunnel Mode: Gateway to Gateway communication, e. g. , Firewall to Firewall.

Authentication 22

Authentication 22

IPv 6 AUTHENTICATION OVERVIEW Router IPv 6 Network l. Each client and server is

IPv 6 AUTHENTICATION OVERVIEW Router IPv 6 Network l. Each client and server is configured with a Authentcation Key Msg Digest security table that contains the Security Parameter Index(SPI) and the Authentication Key. SPI MD Data Authentication Key Msg Digest Data l. The source and destination share an authentication key. l. The source performs the MD 5 algorithm using the data and the authentication key as input. It includes an SPI to identify the key. l 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. 23 l The actual message is transmitted in cleartext.

IPv 6 AUTHENTICATION HEADER l All IP packets begin with the basic IP VERS

IPv 6 AUTHENTICATION HEADER l All IP packets begin with the basic IP VERS PRITY Flow Label 4 bits 24 bits Payload Length Nxt Hdr : 51 16 bits Hop Limit Source IP Address 128 bits Destination IP Address 128 bits Nxt Hdr : 6 Hdr Length Reserved Secrity Parameter Index Authentication Data TCP Header and Data 8 bits Header. l 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. l Authentication is part of the enhanced security feature of IPv 6. It is also designed to be used with IPv 4. l It specifies Message Digest 5(MD 5) as the default authentication algorithm. l The Security Association (SA) consists of the Security Parameter Index, the IP destination address and the Security Protocol. l 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. l Authentication Data field: A 128 bit digest containing the results of the MD 5 algorithm as applied to the authentication key, the IP datagram and the IP 24 address. It serves as a user authenticator.

IPv 6 AUTHENTICATION SOURCE SPI Source Security Information at Host 130. 15. 60. 10

IPv 6 AUTHENTICATION SOURCE SPI Source Security Information at Host 130. 15. 60. 10 Destination IP Address Role 130. 15. 20. 2 Host 135. 150. 201. 2 Host 130. 15. 20. 1 Host SPI 12 42 62 Client Source Authentication IP Address Method Key 130. 15. 60. 10 x? 34 -15 -4 R-44 -C 0. . . MD 5 Client Encryption Key #$%FFGH&*()!#. . . . . Client Encryption Method CBC-DES None l. The transmitting client looks up the destination IP address in its security table. l. The Message Digest is calculated using MD 5. 3 The 128 bit key is retrieved from the table. 3 The complete datagram is appended to the key. 3 The key is appended once more to the end. 3 This block of data is then passed through the MD 5 algorithm. All fields that change during transit are treated as zeroes. 3 The MD 5 compresses the message into a one-way hash(message digest) of 128 -bits. l. The resulting message digest is then placed into the authentication header. 25 l. The SPI, Message Digest and the cleartext datagram are then transmitted.

IPv 6 AUTHENTICATION DESTINATION SPI Destination Security Information at Host 130. 15. 20. 2

IPv 6 AUTHENTICATION DESTINATION SPI Destination Security Information at Host 130. 15. 20. 2 SPI Client Source IP Address 12 130. 15. 60. 10 42 62 130. 150. 201. 20 130. 15. 20. 1 Client Authentication Method Key x? 34 -15 -4 R-44 -C 0. . . MD 5 Client Encryption Key Method #$%FFGH&*()!#. . . . . CBC-DES None l. 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. l. The receiving station then calculates the Message Digest using MD 5. 3 The 128 bit key is retrieved from the table. 3 The complete cleartext datagram is appended to the key. 3 The key is appended once more to the datagram. 3 This block of data is then passed through the MD 5 algorithm. All fields that change during transit are treated as zeroes. 3 The MD 5 compresses the message into a one-way 26 hash(message digest) of 128 -bits. l. The resulting MD is then compared to the transmitted MD.

Encryption 27

Encryption 27

IPv 6 ENCRYPTION OVERVIEW Router IPv 6 Network l. Each client and server is

IPv 6 ENCRYPTION OVERVIEW Router IPv 6 Network l. Each client and server is configured with a Encryption Key security table that contains the SPI and the Encryption Key. Cipher. Text Clear. Text SPI IV E-Data SPI IV Encryption Key E-Data Cipher. Text Clear. Text l. The source and destination share an Encryption Key. l. 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. l. The destination identifies the encryption key through the SPI 28 and decrypts the message utilizing the CBC-DES and the IV.

IPv 6 ENCAPSULATING SECURITY PAYLOAD l All IP packets begin with the basic IP

IPv 6 ENCAPSULATING SECURITY PAYLOAD l All IP packets begin with the basic IP VERS PRITY Flow Label 4 bits 24 bits Payload Length 16 bits Nxt Hdr : 50 Hop Limit 8 bits Source IP Address 128 bits Destination IP Address 128 bits Security Parameter Index Initialization Vector Payload Data Padding(if needed) Pad Length Payload Type Header. l IP Encapsulating Security Payload (ESP) is used for confidentiality, i. e. , to prevent the unwanted disclosure of information. l ESP is part of the enhanced security feature of IPv 6. * It is also designed to be used with IPv 4. l It specifies Cipher Block Chaining -Data Encryption Standard (CBC-DES) as the default encryption algorithm. l The security association consists of the Security Parameter Index, the IP destination address and the Security Protocol. l 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. l Initialization Vector field: Used by the CBC-DES as a random number to start the encryption process. l Padding: Added to force the ESP to be an integer multiple of 32. 29 l Padding Length: the length of the padding field. l Payload Type: indicates which protocol has been encapsulated, e. g. , 6 = TCP.

IPv 6 ENCRYPTION SOURCE SPI Source Security Information at Host 130. 15. 60. 10

IPv 6 ENCRYPTION SOURCE SPI Source Security Information at Host 130. 15. 60. 10 Destination IP Address Role 130. 15. 20. 2 Host 135. 150. 201. 2 Host 130. 15. 20. 1 Host SPI 12 42 62 Client Source Authentication IP Address Method Key 130. 15. 60. 10 x? 34 -15 -4 R-44 -C 0. . . MD 5 Client Encryption Key #$%FFGH&*()!#. . . . . Client Encryption Method CBC-DES None l. The transmitting client looks up the destination IP address in its security table. l. The message is encrypted using CBC-DES. 3 The encryption key is retrieved from the table. 3 The first block of ciphertext is produced by XORing the IV with the first block of cleartext. 3 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). 3 In this fashion all blocks are chained together for encryption. l. The resulting cipher blocks are concatenated for transmission. 30 l. The SPI, Initialization Vector and the ciphertext datagram is then transmitted.

IPv 6 ENCRYPTION DESTINATION SPI Destination Security Information at Host 130. 15. 20. 2

IPv 6 ENCRYPTION DESTINATION SPI Destination Security Information at Host 130. 15. 20. 2 SPI Client Source IP Address 12 130. 15. 60. 10 42 62 130. 150. 201. 20 130. 15. 20. 1 Client Authentication Method Key x? 34 -15 -4 R-44 -C 0. . . MD 5 Client Encryption Key Method #$%FFGH&*()!#. . . . . CBC-DES None l. 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. l. The message is decrypted using CBC-DES. 3 The encryption key is retrieved from the table. 3 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. 3 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. 31 3 In this fashion all blocks are chained together for decryption. l. The cleartext is then passed to the higher level protocols.

Security at the Application Layer Proxy Outbound Request Client Application Server Inbound Replyt External

Security at the Application Layer Proxy Outbound Request Client Application Server Inbound Replyt External Network Application Client Server Internal Network • 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). 32

Next 2 weeks of lectures • Encryption and digital signatures 33

Next 2 weeks of lectures • Encryption and digital signatures 33

Assignment Allocation • The current allocation is available on the web. • Pl send

Assignment Allocation • The current allocation is available on the web. • Pl send me an email about the topic of your choice. 34