Unit-3 Full Notes
Unit-3 Full Notes
EAP-Exchanges:
Whatever method is used for authentication, the authentication information and
authentication protocol information are carried in EAP messages.
RFC 3748 defines the goal of the exchange of EAP messages to be successful
authentication.
In the context of RFC 3748, successful authentication is an exchange
of EAP messages, as a result of which the authenticator decides to allow access
by the peer, and the peer decides to use this access.
The authenticator’s decision typically involves both authentication and authorization
aspects; the peer may successfully authenticate to the authenticator, but access may
be denied by the authenticator due to policy reasons.
indicates a typical arrangement in which EAP is used. The following components are involved:
■ EAP peer:
Client computer that is attempting to access a network.
■ EAP authenticator:
An access point or NAS that requires EAP authentication
prior to granting access to a network.
■ Authentication server:
A server computer that negotiates the use of a specific EAP method with an EAP peer,
validates the EAP peer’s credentials, and authorizes access to the network. Typically, the
authentication server is a Remote Authentication Dial-In User Service (RADIUS) server.
The authentication server functions as a backend server that can authenticate peers as a service to a
number of EAP authenticators. The EAP authenticator then makes the decision of whether to grant
access. This is referred to as the EAP pass-through mode. Less commonly, the authenticator takes
over the role of the EAP server; that is, only two parties are involved in the EAP execution.
As a first step, a lower-level protocol, such as PPP (point-to-point protocol) or IEEE 802.1X, is used
to connect to the EAP authenticator. The software entity in the EAP peer that operates at this level is
referred to as the supplicant.
EAP messages containing the appropriate information for a chosen EAP method are
then exchanged between the EAP peer and the authentication server.
EAP messages may include the following fields:
■ Code: Identifies the Type of EAP message. The codes are Request (1),
Response (2), Success (3), and Failure (4).
■ Identifier: Used to match Responses with Requests.
■ Length: Indicates the length, in octets, of the EAP message, including the Code, Identifier, Length,
and Data fields.
Data: Contains information related to authentication.
Typically, the Data field consists of a Type subfield, indicating the type of data carried, and a Type-
Data field.
The Success and Failure messages do not include a Data field.
IEEE 802.1X Port-Based Network Access Control was designed to provide access
control functions for LANs. Table 16.1 briefly defines key terms used in the IEEE
802.11 standard. The terms supplicant, network access point, and authentication server correspond to
the EAP terms peer, authenticator, and authentication server, respectively.
Authenticator
An entity at one end of a point-to-point LAN segment that facilities authentication of the entity to the
other end of the link.
Authentication exchange
The two-party conversation between systems performing an authentication process.
Authentication process
The cryptographic operations and supporting data frames that perform the actual authentication.
Authentication server (AS)
An entity that provides an authentication service to an authenticator. This service determines, from the
credentials provided by supplicant, whether the supplicant is authorized to access the services
provided by the system in which the authenticator resides.
Authentication transport
The datagram session that actively transfers the authentication exchange between two systems.
Bridge port
A port of an IEEE 802.1D or 802.1Q bridge.
Edge port
A bridge port attached to a LAN that has no other bridges attached to it.
Network access port
A point of attachment of a system to a LAN. It can be a physical port, such as a single LAN MAC
attached to a physical LAN segment, or a logical port, for example, an IEEE 802.11 association
between a station and an access point.
Port access entity (PAE)
The protocol entity associated with a port. It can support the protocol functionality associated with the
authenticator, the supplicant, or both.
Supplicant
An entity at one end of a point-to-point LAN segment that seeks to be authenticated by an
authenticator attached to the other end of that link.
Until the AS authenticates a supplicant (using an authentication protocol), the authenticator
only passes control and authentication messages between the supplicant and the AS; the
802.1X control channel is unblocked, but the 802.11 data channel is blocked.
Once a supplicant is authenticated and keys are provided, the authenticator can forward data
from the supplicant, subject to predefined access control limitations for the supplicant to the
network.
Under these circumstances, the data channel is unblocked.
As indicated in Figure 802.1X uses the concepts of controlled and uncontrolled ports. Ports are logical
entities defined within the authenticator and refer to physical network connections.
Each logical port is mapped to one of these two types of physical ports. An uncontrolled port
allows the exchange of protocol data units (PDUs) between the supplicant and the AS,
regardless of the authentication state of the supplicant.
A controlled port allows the exchange of PDUs between a supplicant and other systems on the
network only if the current state of the supplicant authorizes such an exchange.
The essential element defined in 802.1X is a protocol known as EAPOL (EAP over LAN).
EAPOL operates at the network layers and makes use of an IEEE 802 LAN, such as Ethernet
or Wi-Fi, at the link level. EAPOL enables a supplicant to communicate with an authenticator
and supports the exchange of EAP packets for authentication.
IP SECURITY
IPSec provides the capability to secure communications across a LAN, across private and public
WANs, and across the Internet. Examples of its use include the following:
Benefits of IPSec:
IPSec Services
IPSec provides security services at the IP layer by enabling a system to select required security
protocols, determine the algorithm(s) to use for the service(s), and put in place any cryptographic keys
required to provide the requested services.
Two protocols are used to provide security:
• An authentication protocol: Designated by the header of the protocol, Authentication Header
(AH);
• Encryption/authentication protocol designated by the format of the packet for that protocol,
Encapsulating Security Payload (ESP).
The services are
• Access control
• Connectionless integrity
• Data origin authentication
• Rejection of replayed packets (a form of partial sequence integrity)
• Confidentiality (encryption)
• Limited traffic flow confidentiality
Security Associations
A key concept that appears in both the authentication and confidentiality mechanisms for IP is the
security association (SA). An association is a one-way relationship between a sender and a receiver
that affords security services to the traffic carried on it.
A security association is uniquely identified by three parameters:
• Security Parameters Index (SPI)
• IP Destination Address
• Security Protocol Identifier
SA Parameters
A security association is normally defined by the following parameters:
a) Sequence Number Counter:
A 32-bit value used to generate the Sequence Number field in AH or ESP headers.
b) Sequence Counter Overflow:
A flag indicating whether overflow of the Sequence Number Counter should generate an auditable
event and prevent further transmission of packets on this SA.
c) Anti-Replay Window:
Used to determine whether an inbound AH or ESP packet is a replay.
d) AH Information:
Authentication algorithm, keys, key lifetimes, and related parameters being used with AH (required
for AH implementations).
e) ESP Information:
Encryption and authentication algorithm, keys, initialization values, key lifetimes, and related
parameters being used with ESP (required for ESP implementations).
f) Lifetime of This Security Association:
A time interval or byte count after which an SA must be replaced with a new SA or terminated, plus
an indication of which of these actions should occur .
g) IPSec Protocol Mode: Tunnel, transport.
h) Path MTU: Any observed path maximum transmission unit and aging variables.
Modes of Transfer
Both AH and ESP support two modes of use: transport and tunnel mode.
Transport Mode:
Transport mode provides protection primarily for upper-layer protocols. That is, transport mode
protection extends to the payload of an IP packet.
Tunnel Mode:
Tunnel mode provides protection to the entire IP packet. To achieve this, after the AH or ESP fields
are added to the IP packet, the entire packet plus security fields is treated as the payload of new
"outer" IP packet with a new outer IP header.
The entire original, or inner, packet travels through a "tunnel" from one point of an IP network to
another; no routers along the way are able to examine the inner IP header. Because the original packet
is encapsulated, the new, larger packet may have totally different source and destination addresses,
adding to the security.
Authentication Header
The Authentication Header provides support for data integrity and authentication of IP packets. The
Authentication Header consists of the following fields:
• Next Header (8 bits): Identifies the type of header immediately following this header.
• Payload Length (8 bits): Length of Authentication Header in 32-bit words, minus 2.
• Reserved (16 bits): For future use.
• Security Parameters Index (32 bits): Identifies a security association.
• Sequence Number (32 bits): A monotonically increasing counter value.
• Authentication Data (variable): A variable-length field (must be an integral number of 32-bit
words) that contains the Integrity Check Value (ICV), or MAC
IPSec Authentication Header
Anti-Replay Service
A replay attack is one in which an attacker obtains a copy of an authenticated packet and later
transmits it to the intended destination.
When a new SA is established, the sender initializes a sequence number counter to 0. Each
time that a packet is sent on this SA, the sender increments the counter and places the value in
the Sequence Number field. Thus, the first value to be used is 1.
If anti-replay is enabled (the default), the sender must not allow the sequence number to cycle
past 232-1 back to zero. Otherwise, there would be multiple valid packets with the same
sequence number. If the limit of 232-1 is reached, the sender should terminate this SA and
negotiate a new SA with a new key.
Integrity Check Value
The Authentication Data field holds a value referred to as the Integrity Check Value. The ICV is a
message authentication code or a truncated version of a code produced by a MAC algorithm.
Transport and Tunnel Modes
For transport mode AH using IPv4, the AH is inserted after the original IP header and before
the IP payload
For tunnel mode AH, the entire original IP packet is authenticated, and the AH is inserted
between the original IP header and a new outer IP header
Encapsulating Security Payload
The Encapsulating Security Payload provides confidentiality services, including confidentiality of
message contents and limited traffic flow confidentiality.
The diagram shows the format of an ESP packet. It contains the following fields:
Security Parameters Index (32 bits): Identifies a security association.
Sequence Number (32 bits): A monotonically increasing counter value; this provides an anti-
replay function, as discussed for AH.
Payload Data (variable): This is a transport-level segment (transport mode) or IP packet
(tunnel mode) that is protected by encryption.
Padding (0255 bytes): The purpose of this field is discussed later.
Pad Length (8 bits): Indicates the number of pad bytes immediately preceding this field.
Next Header (8 bits): Identifies the type of data contained in the payload data field by
identifying the first header in that payload (for example, an extension header in IPv6, or an upper-
layer protocol such as TCP).
Authentication Data (variable): A variable-length field (must be an integral number of 32-bit
words) that contains the Integrity Check Value computed over the ESP packet minus the
Authentication Data field.
Scope of AH Authentication
Padding:
The Padding field serves several purposes:
If an encryption algorithm requires the plaintext to be a multiple of some number of
bytes (e.g., the multiple of a single block for a block cipher), the Padding field is used
to expand the plaintext (consisting of the Payload Data, Padding, Pad Length, and
Next Header fields) to the required length.
The ESP format requires that the Pad Length and Next Header fields be right aligned
within a 32-bit word. Equivalently, the ciphertext must be an integer multiple of 32
bits. The Padding field is used to assure this alignment.
Additional padding may be added to provide partial traffic flow confidentiality by
concealing the actual length of the payload.
Transport and Tunnel Modes
ESP service can be used. In the upper part of the figure, encryption (and optionally
authentication) is provided directly between two hosts.
The diagram shows how tunnel mode operation can be used to set up a virtual private
network.
In this example, an organization has four private networks interconnected across the Internet.
Hosts on the internal networks use the Internet for transport of data but do not interact with
other Internet-based hosts.
By terminating the tunnels at the security gateway to each internal network, the configuration
allows the hosts to avoid implementing the security capability. The former technique is
support by a transport mode SA, while the latter technique uses a tunnel mode SA. Transport
Mode ESP:
For this mode using IPv4, the ESP header is inserted into the IP packet immediately prior to
the transport-layer header (e.g., TCP, UDP, ICMP) and an ESP trailer (Padding, Pad Length,
and Next Header fields) is placed after the IP packet; if authentication is selected, the ESP
Authentication Data field is added after the ESP trailer.
The entire transport-level segment plus the ESP trailer are encrypted. Authentication covers
all of the cipher text plus the ESP header.
For this mode using IPv4, the ESP header is inserted into the IP packet immediately prior to
the transport-layer header (e.g., TCP, UDP, ICMP) and an ESP trailer (Padding, Pad Length,
and Next Header fields) is placed after the IP packet; if authentication is selected, the ESP
Authentication Data field is added after the ESP trailer.
The entire transport-level segment plus the ESP trailer are encrypted. Authentication covers
all of the cipher text plus the ESP header.
Transport mode operation provides confidentiality for any application that uses it, thus
avoiding the need to implement confidentiality in every individual application. This mode of
operation is also reasonably efficient, adding little to the total length of the IP packet. One
drawback to this mode is that it is possible to do traffic analysis on the transmitted packets.
Fig 5.10: Transport mode
WEB SECURITY
Web Security may be defined as technological and managerial procedures
applied to computer systems to ensure the availability, integrity, and
confidentiality of information.
It means that protection of integrity, availability and confidentiality of
computer assets and services from associated threats and vulnerabilities.
The security of the web is divided into two categories
(a) computer security,
(b) network security.
In generic terms, computer security is the process of securing a single, standalone
computer; while network security is the process of securing an entire network of computers.
(a) Computer Security:
Technology and managerial procedures applied to computer systems to ensure the
availability, integrity, and confidentiality of the data managed by the computer.
(b) Network Security:
Protection of networks and their services from unauthorised modification
destruction, or disclosure and provision of assurance that the network
performs its critical functions correctly and that are nor harmful side effects.
The major points of weakness in a computer system are hardware, software,
and data.
Web services and its advantages
• Web services provide interoperability between various software applications
running on disparate platforms/operating systems.
• Web services use open standards and protocols. Protocols and data formats are
text-based where possible, which makes it easy for developers to understand.
• By utilising HTTP, web services can work through many common firewall
security measures without having to make changes to the firewall filtering rules.
• Web services allow software and services from different companies and
locations to be combined easily to provide an integrated service.
• Web services allow the reuse of services and components within an
infrastructure.
• Web services are loosely coupled thereby, facilitating a distributed approach to
application integration.
WS-Security
WS-Security (Web Services Security) is a communications protocol providing a
means for applying security to Web Services Originally developed by IBM,
Microsoft, and VeriSign, the protocol is now officially called WSS.
The protocol contains specifications on how integrity and confidentiality can be
enforced on Web Services messaging.
Three basic security concepts important to information on the Internet are
Confidentiality,
Integrity
Availability.
Confidentiality
Data Integrity:
This property, that data has not been altered in an unauthorised manner while in storage,
during processing or while in transit.
Another aspect of data integrity is the assurance that data can only be accessed and altered by
those authorised to do so. Often such integrity is ensured by use of a number referred to as a
Message Integrity Code or Message Authentication Code.
These are abbreviated as MIC and MAC respectively.
System Integrity:
This quality that a system has when performing the intended function in an unimpaired
manner, free from unauthorised manipulation.
Integrity is commonly an organisations most important security objective, after
availability.
Integrity is particularly important for critical safety and financial data
used for activities such as electronic funds transfers, air traffic control, and financial
accounting.
Availability
Authentication
Authentication is proving that a user is whom s/he claims to be. That proof may
involve something the user knows (such as a password), something the user has (such
as a “smartcard”), or something about the user that proves the person’s identity (such
as a fingerprint).
Authorisation
Authorisation is the act of determining whether a particular user (or computer system)
has the right to carry out a certain activity, such as reading a file or running a program.
Authentication and authorisation go hand in hand. Users must be authenticated before
carrying out the activity they are authorised to perform.
Assurance
Assurance is the basis for confidence that the security measures, both technical and
operational, work as intended to protect the system and the information it processes.
Assurance is essential, without its other objectives cannot be met.
Web Security Threats
Threats Consequences Countermeasures
Integrity Modification of user Loss of information Cryptographi
data Trojan horse Compromise of c
browser machine checksums
Modification of Vulnerability to all
memory Modification other threats
of
message traffic in
transit
Confidentialit Eavesdropping on Loss of Encryption, web
y the Net Theft of info information Loss proxies
from server Theft of of privacy
data from client Info
about network
configuration
Info about which
client talks to server
Denial Killing of user Disruptive Difficult to prevent
of threads Flooding Annoying Prevent
Service machine with Bogus user from getting
requests work done
Filling up disk
or memory
Isolating
Machine by
DNS
attacks
Authenticatio Impersonation of Misrepresentation Cryptographi
n legitimate users of user Belief that c techniques
Data forgery false information is
valid
This fig illustrates the sequence of events in the SSH Transport Layer Protocol.
First, the client establishes a TCP connection to the server. This is done via the TCP protocol
and is not part of the Transport Layer Protocol.
Once the connection is established, the client and server exchange data, referred to as packets,
in the data field of a TCP segment. Each packet is in the following format.
Packet length:
Length of the packet in bytes, not including the packet length
and MAC fields.
Padding length:
Length of the random padding field.
Payload:
Useful contents of the packet. Prior to algorithm negotiation, this field is uncompressed.
If compression is negotiated, then in subsequent packets, this field is compressed.
Random padding:
Once an encryption algorithm has been negotiated, this field is added. It contains random
bytes of padding so that that total length of the packet (excluding the MAC field) is a multiple
of the cipher block size, or 8 bytes for a stream cipher.
Message authentication code (MAC):
If message authentication has been negotiated, this field contains the MAC value.
The MAC value is computed over the entire packet plus a sequence number, excluding the
MAC field.
The sequence number is an implicit 32-bit packet sequence that is initialized to sequence
number is an implicit 32-bit packet sequence that is initialized to zero for the first packet and
incremented for every packet.The sequence number is not included in the packet sent over the
TCP connection.
Once an encryption algorithm has been negotiated, the entire packet (excluding the MAC
field) is encrypted after the MAC value is calculated.
The SSH Transport Layer packet exchange consists of a sequence of steps
The first step, the identification string exchange, begins with the client sending a packet with
an identification string of the form:
SSH-proto version-software version SP comments CR LF
where SP, CR, and LF are space character, carriage return, and line feed, respectively.
Algorithm negotiation.
KEY GENERATION
The keys used for encryption and MAC (and any needed IVs)
are generated from the shared secret key , the hash value from the key exchange
, and the session identifier, which is equal to unless there has been a subsequent
key exchange after the initial key exchange. The values are computed as follows.
Initial IV client to server: HASH(K || H || F || session_id)
• Initial IV server to client: HASH(K || H || E || session_id)
• Encryption key client to server: HASH(K || H || D || session_id)
• Encryption key server to client: HASH(K || H || C || session_id)
• Integrity key client to server: HASH(K || H || B || session_id)
• Integrity key server to client: HASH(K || H || A || session_id)
where HASH() is the hash function determined during algorithm negotiation.
User Authentication Protocol
The User Authentication Protocol provides the means by which the client is authenticated to the
server.
MESSAGE TYPES AND FORMATS
Three types of messages are always used in the User
Authentication Protocol. Authentication requests from the client have the format:
byte SSH_MSG_USERAUTH_REQUEST (50)
string user name
string service name
string method name
... method specific fields
where user name is the authorization identity the client is claiming, service name
is the facility to which the client is requesting access (typically the SSH
Connection Protocol), and method name is the authentication method being used
in this request.
The first byte has decimal value 50, which is interpreted as SSH_MSG_USERAUTH_REQUEST.
If the server either (1) rejects the authentication request or (2) accepts the request but requires one or
more additional authentication methods, the server sends a message with the format:
byte SSH_MSG_USERAUTH_FAILURE (51)
name-list authentications that can continue
Boolean partial success where the name-list is a list of methods that may productively continue the
dialog. If the server accepts authentication, it sends a single byte message: SSH_MSG_
USERAUTH_SUCCESS (52).
MESSAGE EXCHANGE
The message exchange involves the following steps.
1. The client sends a SSH_MSG_USERAUTH_REQUEST with a requested method
of none.
2. The server checks to determine if the user name is valid. If not, the server returns
SSH_MSG_USERAUTH_FAILURE with the partial success value of false. If the user name is valid,
the server proceeds to step 3.
3. The server returns SSH_MSG_USERAUTH_FAILURE with a list of one or more
authentication methods to be used.
4. The client selects one of the acceptable authentication methods and sends a
SSH_MSG_USERAUTH_REQUEST with that method name and the required
method-specific fields. At this point, there may be a sequence of exchanges to
perform the method.
5. If the authentication succeeds and more authentication methods are required, the
server proceeds to step 3, using a partial success value of true. If the authentication
fails, the server proceeds to step 3, using a partial success value of false.
6. When all required authentication methods succeed, the server sends a
SSH_MSG_USERAUTH_SUCCESS message, and the Authentication Protocol is
over.
AUTHENTICATION METHODS
The server may require one or more of the following
authentication methods.
• publickey:
The details of this method depend on the public-key algorithm chosen. In essence, the client sends a
message to the server that contains the client’s public key, with the message signed by the client’s
private key. When the server receives this message, it checks whether the supplied key is acceptable
for authentication and, if so, it checks whether the signature is correct.
• password: The client sends a message containing a plaintext password,
which is protected by encryption by the Transport Layer Protocol.
• hostbased:
Authentication is performed on the client’s host rather than the client itself.
Thus, a host that supports multiple clients would provide authentication for all its clients.
This method works by having the client send a signature created with the private key of the client
host.
Thus, rather than directly verifying the user’s identity, the SSH server verifies the identity of the client
host—and then believes the host when it says the user has already authenticated on the client side.
HTTP Standards
HTTPS (HTTP over SSL) refers to the combination of HTTP and SSL to implement secure
communication between a Web browser and a Web server.
The HTTPS capability is built into all modern Web browsers.
Its use depends on the Web server supporting HTTPS communication. For example, search engines
do not support HTTPS.
The principal difference seen by a user of a Web browser is that URL (uniform resource locator)
addresses begin with https:// rather than http://. A normal HTTP connection uses port 80. If HTTPS is
specified, port 443 is used, which invokes SSL.
16.4 / HTTPS 507
When HTTPS is used, the following elements of the communication are
encrypted:
• URL of the requested document
• Contents of the document
• Contents of browser forms (filled in by browser user)
• Cookies sent from browser to server and from server to browser
• Contents of HTTP header
HTTPS is documented in RFC 2818, HTTP Over TLS. There is no fundamental change in using
HTTP over either SSL or TLS, and both implementations are referred to as HTTPS.
Connection Initiation
For HTTPS, the agent acting as the HTTP client also acts as the TLS client.
The client initiates a connection to the server on the appropriate port and then sends the TLS
ClientHello to begin the TLS handshake.
When the TLS handshake has finished, the client may then initiate the first HTTP request. All
HTTP data is to be sent as TLS application data. Normal HTTP behavior, including retained
connections, should be followed.
We need to be clear that there are three levels of awareness of a connection in HTTPS. At the
HTTP level, an HTTP client requests a connection to an HTTP server by sending a connection
request to the next lowest layer.
Typically, the next lowest layer is TCP, but it also may be TLS/SSL. At the level of TLS, a
session is
established between a TLS client and a TLS server. This session can support one or more
connections at any time.
As we have seen, a TLS request to establish a connection begins with the establishment of a
TCP connection between the TCP entity on the client side and the TCP entity on the server
side.
Connection Closure
An HTTP client or server can indicate the closing of a connection by including the
following line in an HTTP record: Connection: close. This indicates that the
connection will be closed after this record is delivered.
The closure of an HTTPS connection requires that TLS close the connection
with the peer TLS entity on the remote side, which will involve closing the underlying TCP
connection.
At the TLS level, the proper way to close a connection is for each side to use the TLS alert
protocol to send a close_notify alert. TLS implementations must initiate an exchange of
closure alerts before closing a connection.
A TLS implementation may, after sending a closure alert, close the connection without
waiting for the peer to send its closure alert, generating an “incomplete close”.
Note that an implementation that does this may choose to reuse the session. This should only
be done when the application knows (typically through detecting HTTP message boundaries)
that it has received all the message data that it cares about.
HTTP clients also must be able to cope with a situation in which the underlying TCP
connection is terminated without a prior close_notify alert and without a Connection: close
indicator. Such a situation could be due to a programming error on the server or a
communication error that causes the TCP connection to drop.
However, the unannounced TCP closure could be evidence of some sort of attack. So
the HTTPS client should issue some sort of security warning when this occurs.