Module 5
[Link] the difference between DKIM and SPF in email
authentication
DKIM (DomainKeys Identified Mail)
1. DKIM is an email authentication method that verifies whether an email
actually came from the domain it claims to be from.
2. It adds a cryptographic digital signature to the email header.
3. The signature is created using the private key of the sender’s domain.
4. The receiving mail server retrieves the public key from the sender’s DNS
records.
5. If the signature matches, it confirms the email is legitimate.
6. DKIM protects against email tampering and forgery.
7. It ensures that the content of the email has not been altered during
transmission.
8. DKIM works even when emails are forwarded because the signature
remains valid.
9. It provides authentication at the message header level.
[Link] enhances trust and reduces the chances of phishing and spoofing attacks.
SPF (Sender Policy Framework)
1. SPF is an email authentication protocol used to verify whether a mail server
is authorized to send emails for a specific domain.
2. It uses a list of allowed IP addresses stored in the domain’s DNS SPF
record.
3. When an email is received, the receiving server checks if the sending IP is
in the allowed list.
4. If the IP matches, the email is considered legitimate.
5. SPF helps prevent email spoofing, especially fake sender addresses.
6. It validates the envelope sender (MAIL FROM) address during SMTP.
1
7. SPF fails when emails are forwarded because the forwarding server’s IP
might not be authorized.
8. It works at the server/IP-level rather than the message content level.
9. SPF does not check email content or header modifications.
[Link] is mainly used to control which servers can send mail on behalf of a
domain.
[Link] the concept of multiple Security Associations in IPSec.
20.4 COMBINING SECURITY ASSOCIATIONS
In IPsec, a single Security Association (SA) can provide either AH
(Authentication
Header) services or ESP (Encapsulating Security Payload) services, but not both
at
the same time. However, in real-world networks, a single traffic flow may require
multiple security services, such as:
• Both authentication (AH) and confidentiality (ESP)
• Protection between hosts, and simultaneously between security gateways (e.g.,
firewalls or VPN routers)
To achieve these combined security requirements, multiple SAs are chained
together. This sequence is called a Security Association Bundle.
A security association bundle is:
A sequence of SAs that are applied to a given traffic flow in order to provide the
required security services.
SAs in a bundle may:
• End at the same endpoints (e.g., host-to-host), or
• End at different endpoints (e.g., host-to-gateway, gateway-to-gateway)
TWO WAYS TO COMBINE SAs
1. Transport Adjacency
• Multiple security protocols (AH + ESP) are applied at the same IPsec endpoint.
• No tunneling is used.
2
• Only one level of combination is meaningful.
• Example: Host applies ESP first and then AH to the same IP packet.
2. Iterated Tunneling
• Security protocols are applied through multiple nested tunnels.
• Each tunnel can start or end at different IPsec devices along the path.
• Supports multiple levels of nesting.
• Example: A host-to-host ESP packet travels inside a gateway-to-gateway AH
tunnel.
AUTHENTICATION PLUS CONFIDENTIALITY
Encryption and authentication can be combined in order to transmit an IP packet
that has both confidentiality and authentication between hosts
ESP WITH AUTHENTICATION OPTION
In this approach, the user first applies ESP to the data to be protected and then
appends the authentication data field.
There are actually two subcases:
■ Transport mode ESP: Authentication and encryption apply to the IP payload
delivered to the host, but the IP header is not protected.
■ Tunnel mode ESP: Authentication applies to the entire IP packet delivered to
the
outer IP destination address (e.g., a firewall), and authentication is performed at
that
destination. The entire inner IP packet is protected by the privacy mechanism for
delivery to the inner IP destination.
3
[Link] the modes of operation in IPSec (transport and tunnel mode).
TRANSPORT ADJACENCY
• Transport adjacency is a method where you apply two transport-mode Security
Associations (SAs) to the same IP packet without tunnelling
• In this specific case: • Inner SA = ESP (encryption only)
• ESP is applied without authentication. • It encrypts only the IP payload, not the
IP header.
• After ESP processing, the packet structure becomes:
Outer SA — AH in Transport Mode • Outer SA = AH (authentication)
• First the packet is encrypted using ESP
• Then the encrypted packet is authenticated using AH
• AH is then applied to the entire ESP-protected packet, except for mutable IP
header fields.
• AH authentication covers: • The original IP header
• The ESP header • The encrypted payload • After applying AH, the final packet
structure is:
Transport–Tunnel Bundle (AH before ESP)
• In some scenarios, it is desirable to apply authentication before encryption
when using IPsec. This order (AH → ESP) provides several advantages:
• Authentication data is hidden by encryption. Since the authentication
information is inside the encrypted ESP tunnel, attackers cannot see or tamper
with it.
• Authentication can be stored for later verification. If the authentication
corresponds to the original unencrypted data, the receiver can store this
information and later verify it without re-encrypting the message.
4
• Because of these benefits, IPsec allows a configuration where AH is applied
first (in transport mode), and ESP is applied afterward (in tunnel mode).
❑Inner AH Transport SA (Authentication First)
• AH is applied to:
• The IP payload
• The original IP header (and IPv6 extensions), except mutable fields.
❑Outer ESP Tunnel SA (Encryption Second)
• Next, the entire AH-protected packet is placed inside an ESP tunnel.
• ESP in tunnel mode:
• Encrypts the entire inner packet, including:
• Original IP header
• AH header
• Original payload
• Adds a new outer IP header
4. Explain the concept of Domainkeys Identified Mail
19.9 DOMAINKEYS IDENTIFIED MAIL (DKIM)
5
• DomainKeys Identified Mail (DKIM) is an email authentication method that
helps verify whether an email actually came from the domain it claims to be from.
• When an email is sent, DKIM adds a cryptographic digital signature to the
message header.
• This signature is created using the private key of the sending domain.
• When the email reaches the receiver (for example, Gmail, Yahoo, or any ISP),
the receiving server checks the public key published in the sender’s DNS records.
• By matching the signature with the public key, the receiver can confirm:
• The email was truly sent by the claimed domain.
• The email content was not altered during transit.
• Because of its effectiveness in preventing email spoofing and improving
security, DKIM has become an Internet Standard (defined in RFC 6376) and is
widely adopted by email services, companies, and government organizations.
5. Explain Benefits of IPsec, Routing Applications of IPsec, IPsec
Documents, IPsec Architecture.
Benefits of IPsec
• Some of the benefits of IPsec:
❑When IPsec is implemented in a firewall or router, it provides strong security
that can be applied to all traffic crossing the perimeter. Traffic within a company
or workgroup does not incur the overhead of security-related processing.
❑IPsec in a firewall is resistant to bypass if all traffic from the outside must use
IP and the firewall is the only means of entrance from the Internet into the
organization.
❑IPsec is below the transport layer (TCP, UDP) and so is transparent to
applications. There is no need to change software on a user or server system when
IPsec is implemented in the firewall or router. Even if IPsec is implemented in
end systems, upper-layer software, including applications, is not affected.
❑IPsec can be transparent to end users. There is no need to train users on security
mechanisms, issue keying material on a per-user basis, or revoke keying material
when users leave the organization.
6
❑IPsec can provide security for individual users if needed. This is useful for
offsite workers and for setting up a secure virtual subnetwork within an
organization for sensitive applications.
Routing Applications of IPsec
➢Beyond securing user communications and protecting organizational
networks, IPsec also plays an important role in securing Internet routing
architecture.
➢Routing protocols exchange critical information between routers, and if this
information is altered or forged, it can disrupt the entire network.
➢According to [HUIT98], IPsec can help secure several essential routing
functions:
IPsec Documents
• IPsec encompasses three functional areas: authentication, confidentiality,
and key management.
• The totality of the IPsec specification is scattered across dozens of RFCs
and draft IETF documents, making this the most complex and difficult to
grasp of all IETF specifications.
• The documents can be categorized into the following groups.
❑Architecture: Covers the general concepts, security requirements,
definitions, and mechanisms defining IPsec technology. The current
specification is RFC 4301, Security Architecture for the Internet Protocol.
❑Authentication Header (AH): AH is an extension header to provide
message authentication. The current specification is RFC 4302, IP
Authentication Header. Because message authentication is provided by ESP,
the use of AH is deprecated. It is included in IPsecv3 for backward
compatibility but should not be used in new applications
❑Encapsulating Security Payload (ESP): ESP consists of an encapsulating
header and trailer used to provide encryption or combined encryption/
authentication. The current specification is RFC 4303, IP Encapsulating
Security Payload (ESP).
❑Internet Key Exchange (IKE): This is a collection of documents describing
the key management schemes for use with IPsec. The main specification is
7
RFC 7296, Internet Key Exchange (IKEv2) Protocol, but there are a number
of related RFCs.
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); and a
combined encryption/authentication protocol designated by the format of the
packet for that protocol, Encapsulating Security Payload (ESP). RFC 4301
lists the following services:
■ Access control
■ Connectionless integrity •
■ Data origin authentication
■ Rejection of replayed packets (a form of partial sequence integrity)
■ Confidentiality (encryption) • ■ Limited traffic flow confidentiality
6. What is the role of Security Association Database
Security Association Database
• In each IPsec implementation, there is a nominal Security Association
Database that defines the parameters associated with each SA.
• A security association is normally defined by the following parameters in an
SAD entry.
❑Security Parameter Index: A 32-bit value selected by the receiving end of
an SA to uniquely identify the SA. In an SAD entry for an outbound SA, the
SPI is used to construct the packet’s AH or ESP header. In an SAD entry for
an inbound SA, the SPI is used to map traffic to the appropriate SA.
❑Sequence Number Counter: A 32-bit value used to generate the Sequence
Number field in AH or ESP headers.
❑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 (required for all implementations).
❑Anti-Replay Window: Used to determine whether an inbound AH or ESP
packet is a replay.
8
❑AH Information: Authentication algorithm, keys, key lifetimes, and related
parameters being used with AH (required for AH implementations).
❑ESP Information: Encryption and authentication algorithm, keys,
initialization values, key lifetimes, and related parameters being used with
ESP (required for ESP implementations).
❑Lifetime of this Security Association: A time interval or byte count after
which an SA must be replaced with a new SA (and new SPI) or terminated,
plus an indication of which of these actions should occur (required for all
implementations).
❑IPsec Protocol Mode: Tunnel, transport, or wildcard. ❑Path MTU: Any
observed path maximum transmission unit (maximum size of a packet that
can be transmitted without fragmentation) and aging variables (required for
all implementations).
7. Explain the Outbound Packet Processing, Inbound Packets
processing.
Outbound Packet Processing
• When an application (like TCP/UDP) sends data, the IP layer forms an IP
packet. After the IP header and body are created, IPsec performs the following
steps:
• 1. IPsec searches the Security Policy Database (SPD) for a match to this
packet.
9
• 2. If no match is found, then the packet is discarded and an error message
is generated. • 3. If a match is found, further processing is determined by the
first matchin
g entry in the SPD. If the policy for this packet is DISCARD, then the packet
is discarded. If the policy is BYPASS, then there is no further IPsec
processing; the packet is forwarded to the network for transmission.
• 4. If the policy is PROTECT, then a search is made of the SAD for a
matching entry. If no entry is found, then IKE is invoked to create an SA with
the appropriate keys and an entry is made in the SA.
• 5. The matching entry in the SAD determines the processing for this packet.
Either encryption, authentication, or both can be performed, and either
transport or tunnel mode can be used. The packet is then forwarded to the
network for transmission.
INBOUND PACKETS
• An incoming IP packet triggers the IPsec processing. The following steps
occur:
• 1. IPsec determines whether this is an unsecured IP packet or one that has
ESP or AH headers/trailers, by examining the IP Protocol field (IPv4) or Next
Header field (IPv6). •
2. If the packet is unsecured, IPsec searches the SPD for a match to this
packet. If the first matching entry has a policy of BYPASS, the IP header is
processed and stripped off and the packet body is delivered to the next higher
10
layer, such as TCP. If the first matching entry has a policy of PROTECT or
DISCARD, or if there is no matching entry, the packet is discarded.
• 3. For a secured packet, IPsec searches the SAD. If no match is found, the
packet is discarded. Otherwise, IPsec applies the appropriate ESP or AH
processing. Then, the IP header is processed and stripped off and the packet
body is delivered to the next higher layer, such as TCP.
8. Explain the 4 cases of Basic Combinations of Security
Associations.
11
12
13