• No results found

Network Layer Security

In document Designing Network Security (Page 42-47)

Network layer security pertains to security services at the IP layer of the TCP/IP protocol stack. Many

years of work have produced a set of standards from the IETF that, collectively, define how to secure services at the IP Network layer.

The IP Security Protocol Suite

The IP Security (IPsec) protocol suite comprises a set of standards used to provide privacy and authentication services at the IP layer. The current ratified IPsec standards include four

algorithm-independent base specifications:

RFC 2401, the IP Security Architecture, defines the overall architecture and specifies elements common to both the IP Authentication Header (AH) and the IP Encapsulating Security Payload (ESP).

RFC 2402, the IP Authentication Header (AH), defines an algorithm-independent mechanism for providing exportable cryptographic authentication without encryption

to IPv4 and IPv6 packets. ●

RFC 2406, the IP Encapsulating Security Payload (ESP), defines an algorithm-independent mechanism for providing encryption to IPv4 and IPv6 packets.

RFC 2408, the Internet Security Association and Key Management Protocol (ISAKMP) defines procedures and packet formats to establish, negotiate, modify, and delete Security Associations (SA).

The set of security services IPsec can provide includes access control, connectionless integrity, data origin authentication, rejection of replayed packets (a form of partial sequence integrity), confidentiality

(encryption), and limited traffic flow confidentiality. Because these services are provided at the IP layer, they can be used by any higher layer protocol (such as TCP, UDP, ICMP, BGP, and so on).

Security Services

IPsec uses two protocols to provide traffic security, each of which defines a new set of headers to be added to IP datagrams:

Authentication Header (AH). This header, when added to an IP datagram, ensures the integrity and

data origin authentication of the data, including the invariant fields in the outer IP header. It does not provide confidentiality protection. AH commonly uses a keyed hash function rather than digital signatures, because digital signature technology is too slow and greatly reduces network throughput. AH is an appropriate protocol to employ when confidentiality is not required (or is not permitted, as when government regulations restrict the use of encryption).

Encapsulating Security Payload (ESP). This header, when added to an IP datagram, protects the

confidentiality, integrity, and data origin authentication of the data. The scope of the authentication offered by ESP is narrower than it is for AH (the IP header "outside" the ESP header is not

protected). If only the upper-layer protocols must be authenticated, ESP authentication is an appropriate choice and is more space efficient than using AH to encapsulate ESP.

AH and ESP can be used independently or in combination to provide a desired set of security services. For both of these protocols, IPsec does not define the specific security algorithms to use; rather, it provides an open framework for implementing industry-standard algorithms. Initially, most

implementations of IPsec will support MD5 from RSA Data Security or the Secure Hash Algorithm (SHA) as defined by the U.S. government for integrity and authen-tication. The Data Encryption Standard (DES) is currently the most commonly offered bulk encryption algorithm, although

specifications in various RFCs are available that define how to use many other encryption systems, including IDEA, Blowfish, and RC4.

Each protocol supports two modes of use: transport mode and tunnel mode.

In transport mode, two hosts provide protection primarily for upper-layer protocols; the cryptographic endpoints (where the encryption and decryption take place) are the source and destination of the data packet. In IPv4, a transport mode security protocol header appears immediately after the IP header and before any higher-layer protocols (such as TCP or UDP). This process is shown in Figure 2-22.

Figure 2-22: The IPsec IPv4 Transport Mode

In the case of AH in transport mode, all upper-layer information is protected, and all fields in the IPv4 header excluding the fields typically are modified in transit. The fields of the IPv4 header that are not included are, therefore, set to 0 before applying the authentication algorithm. These fields are as follows:

TOS ● TTL ● header checksum ● hoffset ● flags ●

In the case of ESP in transport mode, security services are provided only for the higher-layer protocols, not for the IP header.

A tunnel is a vehicle for encapsulating packets inside a protocol that is understood at the entry and exit points of a given network. These entry and exit points are defined as tunnel interfaces. Tunnel mode can be supported by data packet endpoints as well as by intermediate security gateways. In tunnel mode, there is an "outer" IP header that specifies the IPsec processing destination, plus an "inner" IP header that specifies the ultimate destination for the packet. The source address in the outer IP header is the initiating cryptographic endpoint; the source address in the inner header is the true source address of the packet. The security protocol header appears after the outer IP header and before the inner IP header (see Figure 2-23).

Figure 2-23: IPsec IPv4 Tunnel Mode

If AH is employed in tunnel mode, portions of the outer IP header are given protection (those same fields as for transport mode, described earlier in this section), as well as all of the tunneled IP packet (that is, all of the inner IP header is protected as are the higher-layer protocols). If ESP is employed, the protection is afforded only to the tunneled packet, not to the outer header.

Security Associations

The concept of a Security Association (SA) is fundamental to IPsec. An SA is a relationship between two or more entities that describes how the entities will use security services to communicate securely. The SA includes the following:

An encryption algorithm ●

An authentication algorithm ●

A shared session key ●

Because an SA is unidirectional, two SAs (one in each direction) are required to secure typical,

bi-directional communication between two entities. The security services associated with an SA can be used for AH or ESP, but not for both. If both AH and ESP protection is applied to a traffic stream, two (or more) SAs are created for each direction to protect the traffic stream.

The SA is uniquely identified by a randomly chosen unique number called the security parameter index

(SPI) and the destination IP address of the destination. When a system sends a packet that requires IPsec

protection, it looks up the SA in its database and applies the specified processing and security protocol (AH/ESP), inserting the SPI from the SA into the IPsec header. When the IPsec peer receives the packet, it looks up the SA in its database by destination address, protocol, and SPI and then processes the packet as required.

Key Management

IPsec uses cryptographic keys for authentication/integrity and encryption services. Both manual and automatic distribution of keys is supported.

The lowest (but least desirable) level of management is manual management, in which a person manually configures each system by keying material and SA management data relevant to secure communication with other systems. Manual techniques are practical in small, static environments but they do not scale well. If the number of sites using IPsec security services is small, and if all the sites come under a single administrative domain, manual key management techniques may be appropriate. Manual key

management may also be appropriate when only selected communications must be secured within an organization for a small number of hosts or gateways. Manual management techniques often employ statically configured, symmetric keys, although other options also exist.

The default automated key management protocol selected for use with IPsec is Internet Key Management

Protocol (IKMP), sometimes simply referred to as the Internet Key Exchange (IKE). IKE authenticates

each peer involved in IPsec, negotiates the security policy, and handles the exchange of session keys.

Note Although IKE is specified as the public-key-based approach for automatic key management, other

automated key distribution techniques can be used. For example, KDC-based systems such as Kerberos and other public-key systems such as SKIP can be employed.

IKE is a hybrid protocol, combining parts of the following protocols to negotiate and derive keying

material for SAs in a secure and authenticated manner. IKE is derived from the following three protocols, as stated in RFC 2409:

ISAKMP (Internet Security Association and Key Management Protocol), which provides a

framework for authentication and key exchange but does not define them. ISAKMP is designed to be key exchange independent; that is, it is designed to support many different key exchanges. ●

Oakley, which describes a series of key exchanges, called modes, and details the services provided by each (for example, perfect forward secrecy for keys, identity protection, and authentication). ●

SKEMI (Secure Key Exchange Mechanism for Internet), which describes a versatile key exchange technique that provides anonymity, repudiability, and quick key refreshment.

IKE creates an authenticated, secure tunnel between two entities and then negotiates the security association for IPsec. This is performed in two phases.

In Phase 1, the two ISAKMP peers establish a secure, authenticated channel with which to communicate. This channel is called the ISAKMP SA.

Aggressive Mode can be used to further reduce round trips.

The following attributes are used by IKE and are negotiated as part of the ISAKMP SA: Encryption algorithm

Hash algorithm ●

Authentication method (can be digital signature, public-key encryption, or pre-shared key) ●

Information about a group on which to perform Diffie-Hellman ●

After the attributes are negotiated, both parties must be authenticated to each other. IKE supports multiple authentication methods. At this time, the following mechanisms are generally implemented:

Preshared keys. The same key is pre-installed on each host. IKE peers authenticate each other by

computing and sending a keyed hash of data that includes the preshared key. If the receiving peer can independently create the same hash using its preshared key, it knows that both parties must share the same secret, and thus the other party is authenticated.

Public key cryptography. Each party generates a pseudo-random number (a nonce) and encrypts it

and its ID using the other party's public key. The ability for each party to compute a keyed hash containing the other peer's nonce and ID, decrypted with the local private key, authenticates the parties to each other. This method does not provide nonrepudiation; either side of the exchange could plausibly deny that it took part in the exchange. Currently, only the RSA public key algorithm is supported.

Digital signature. Each device digitally signs a set of data and sends it to the other party. This

method is similar to the public-key cryptography approach except that it provides nonrepudiation. Currently, both the RSA public-key algorithm and the digital signature standard (DSS) are

supported. ●

Note Both digital signature and public-key cryptography require the use of digital certificates to validate

the public/private key mapping. IKE allows the certificate to be accessed independently or by having the two devices explicitly exchange certificates as part of IKE.

Both parties must have a shared session key to encrypt the IKE tunnel. The Diffie-Hellman protocol is used to agree on a common session key. The exchange is authenticated as just described to guard against "man-in-the-middle" attacks.

In Phase 2 of the IKE process, SAs are negotiated on behalf of services such as IPsec AH or ESP. IPsec uses a different shared key than does IKE. The IPsec shared key can be derived by using Diffie-Hellman again or by refreshing the shared secret derived from the original Diffie-Hellman exchange that

generated the IKE SA by hashing it with nonces. The first method provides greater security but is slower. After this step is complete, the IPsec SAs are established. Now the data traffic can be exchanged with the negotiated IPsec parameters.

Figure 2-24 shows the creation of an IPsec protected datastream.

IPsec is designed to protect IP packets from modification or snooping. It is starting to become widely available in many vendor implementations.

In document Designing Network Security (Page 42-47)