Defined in RFC 5598 (Internet Mail Architecture, July 2009)
E-mail components:
At its most fundamental level, the internet mail architecture consists of a user world in the form of Message User Agents (MUA)
And the transfer world, in the form of the Message Handling Service (MHS), which is composed of a number of agents (see next slide)
The MHS accepts a message from one user and delivers it to one or more other users, creating a virtual MUA-to-MUA exchange environment
This architecture involves several types of interoperability (protocols)
E-mail Components
Administrative Management Domain (ADMD)
Internet e-mail provider
Examples include a department that operates a local mail relay, an IT department that operates an enterprise mail relay, and an ISP that operates a public shared e-mail service
Each ADMD can have different operating policies and trust-based decision making
Domain name system (DNS)
A directory lookup service that provides a mapping between the name of a host on the Internet and its numerical address
E-mail Protocols (SMTP)
Simple Mail Transfer Protocol (SMTP)
Encapsulates an e-mail message in an envelope and is used to relay the encapsulated messages from source to destination through multiple MTAs
Was specified in 1982 as RFC821 and ESMTP in 1995 as RFC1869
Has undergone several revisions, the most current being RFC5321 (October 2008) with RFC7504 additions (June 2015)
Is a text-based client-server protocol where the client (e-mail sender) contacts the server (next-hop recipient) and issues a set of commands to tell the server about the message to be sent, then sending the message itself
The majority of these commands are ASCII text messages sent by the client and a resulting return code returned by the server
Uses port 25 (or 587 with STARTTLS or 465 with TLS)
Mail Access Protocols
Post Office Protocol (POP3)
Allows an e-mail client (user agent) to download an e-mail from an e-mail server (MTA)
POP3 user agents connect via TCP to the server (usually port 110 or 995 with TLS)
The user agent enters a username and password
After authorization, the UA can issue POP3 commands to retrieve and delete mail
Internet Mail Access Protocol (IMAP)
Enables an e-mail client to access mail on an e-mail server (MTA)
Uses TCP, with server TCP port 143 (or 993 with TLS)
Is more complex than POP3
Provides stronger authentication than POP3 and provides other functions not supported by POP3 (keep mails on server, organize folders, etc.)
E-mail Formats
RFC 5322
Defines a format for text messages that are sent using electronic mail
Has been the standard for Internet-based text mail messages
Messages are viewed as having an envelope and contents
The envelope (headers) contains whatever information is needed to accomplish transmission and delivery
The contents compose the object to be delivered to the recipient
Originally 7 bits character set!
Multipurpose Internet Mail Extensions (MIME)
Extension to the RFC 5322 framework
RFCs 2045 through 2049 define MIME
The MIME specification includes the following elements:
Five new message header fields are defined, which may be included in an RFC 5322 header, providing information about the body of the message
A number of content formats are defined, thus standardizing representations that support multimedia electronic mail
Transfer encodings are defined that enable the conversion of any content format into a form that is protected from alteration by the mail system
Header Fields Defined In MIME
MIME-Version
This field indicates that the message conforms to RFCs 2045 and 2046
Content-Type
Describes the data contained in the body with sufficient detail that the receiving user agent can pick an appropriate agent or mechanism to represent the data to the user or otherwise deal with the data in an appropriate manner
Content-Transfer-Encoding
Indicates the type of transformation that has been used to represent the body of the message in a way that is acceptable for mail transport
Content-ID
Used to identify MIME entities uniquely in multiple contexts
Content-Description
A text description of the object with the body
MIME Content Types
Type
Subtype
Description
Text
Plain
Unformatted text: may be ASCII or ISO 8859.
Enriched
Provides greater format flexibility.
Multipart
Mixed
The different parts are independent but are to be transmitted together. They should be presented to the receiver in the order that they appear in the mail message.
Parallel
Differs from Mixed only in that no order is defined for delivering the parts to the receiver.
Alternative
The different parts are alternative versions of the same information. They are ordered in increasing faithfulness to the original, and the recipient's mail system should display the "best" version to the user.
Digest
Similar to Mixed, but the default type/subtype of each part is message/rfc822.
Message
rfc822
The body is itself an encapsulated message that conforms to RFC 822.
Partial
Used to allow fragmentation of large mail items, in a way that is transparent to the recipient.
External-body
Contains a pointer to an object that exists elsewhere.
Image
jpeg
The image is in JPEG format, JFIF encoding.
gif
The image is in GIF format.
Video
mpeg
MPEG format.
Audio
Basic
Single-channel 8-bit ISDN mu-law encoding at a sample rate of 8 kHz .
Application
PostScript
Adobe Postscript format.
octet-stream
General binary data consisting of 8-bit bytes.
MIME Transfer Encodings
7bit
The data are all represented by short lines of ASCII characters.
8bit
The lines are short, but there may be non-ASCII characters (octets with the high-order bit set).
binary
Not only may non-ASCII characters be present but the lines are not necessarily short enough for SMTP transport.
quoted-printable
Encodes the data in such a way that if the data being encoded are mostly ASCII text, the encoded form of the data remains largely recognizable by humans.
base64
Encodes data by mapping 6-bit blocks of input to 8-bit blocks of output, all of which are printable ASCII characters.
x-token
A named nonstandard encoding.
Email Threads and Mitigations
Threat
Impact on Purported Sender
Impact on Receiver
Mitigation
Email sent by unauthorized MTA in enterprise (e.g. malware botnet)
Loss of reputation. valid email from enterprise may be blocked as possible spam/phishing attack.
UBE and/or email containing malicious links may be delivered into user inboxes
Deployment of domain-based authentication techniques. Use of digital signatures over email.
Email message sent using spoofed or unregistered sending domain
Loss of reputation. valid email from enterprise may be blocked as possible spam/phishing attack.
UBE and/or email containing malicious links may be delivered into user inboxes
Deployment of domain-based authentication techniques. Use of digital signatures over email.
Email message sent using forged sending address or email address (i.e. phishing, spear phishing)
Loss of reputation, valid email from enterprise may be blocked as possible spam/phishing attack.
UBE and/or email containing malicious links may be delivered. Users may inadvertently divulge sensitive information or PII.
Deployment of domain-based authentication techniques. Use of digital signatures over email.
Email modified in transit
Leak of sensitive information or PII.
Leak of sensitive information, altered message may contain malicious information
Use of TLS to encrypt email transfer between server. Use of end-to-end email encryption.
Disclosure of sensitive information (e.g. PII) via monitoring and capturing of email traffic
Leak of sensitive information or PII.
Leak of sensitive information, altered message may contain malicious information
Use of TLS to encrypt email transfer between server. Use of end-to-end email encryption.
Unsolicited Bulk Email (i.e. spam)
None, unless purported sender is spoofed.
UBE and/or email containing malicious links may be delivered into user inboxes
Techniques to address UBE.
DoS/DDoS attack against an enterprises* email servers
Inability to send email.
Inability to receive email.
Multiple mail servers, use of cloud-based email providers.
S/MIME
Secure/Multipurpose Internet Mail Extension
Is a security enhancement to the MIME Internet e-mail format standard based on technology from RSA Data Security
S/MIME is a complex capability that is defined in a number of document
Summary of S/MIME Services:
Function
Typical Algorithm
Typical Action
Digital signature
RSA/SHA-256
A hash code of a message is created using SHA-256. This message digest is encrypted using SHA-256 with the sender's private key and included with the message.
Message encryption
AES-128 with CBC
A message is encrypted using AES-128 with CBC with a one-time session key generated by the sender. The session key is encrypted using RSA with the recipient's public key and included with the message.
Compression
unspecified
A message may be compressed for storage or transmission.
E-mail compatibility
Radix-64 conversion Same as Base64
To provide transparency for e-mail applications, an encrypted message may be converted to an ASCII string using radix-64 conversion.
Authentication
Authentication is provided by means of a digital signature
Most commonly RSA with SHA-256 is used
The sender creates a message
SHA-256 is used to generate a 256-bit message digest of the message
The message digest is encrypted with RSA using the sender’s private key, and the result is appended to the message; also appended is identifying information for the signer, which will enable the receiver to retrieve the signer’s public-key
The receiver uses RSA with the sender’s public key to decrypt and recover the message digest
The receiver generates a new message digest for the message and compares it with the decrypted hash code; if the two match, the message is accepted as authentic
Confidentiality
S/MIME provides confidentiality by encrypting message
Most commonly AES with a 128-bit key is used, with the cipher block chaining (CBC) mode
The key itself is also encrypted, typically with RSA and receiver’s public key
In S/MIME each symmetric key, is used only onc
Sequence:
The sender generates a message and a random 128-bit number to be used as a content-encryption key for this message only
The message is encrypted using the content-encryption key
The content-encryption key is encrypted with RSA using the recipient’s public key and is attached to the message
The receiver uses RSA with its private key to decrypt and recover the content-encryption key
The content-encryption key is used to decrypt the message
S/MIME Message Content Types
S/MIME uses the following message content types, which are defined in RFC 5652, Cryptographic Message Syntax
Data
Refers to the inner MIME-encoded message content, which may then be encapsulated in a SignedData, EnvelopedData, or CompressedData content type
SignedData
Used to apply a digital signature to a message
EnvelopedData
This consists of encrypted content of any type and encrypted-content encryption keys for one or more recipients
CompressedData
Used to apply data compression to a message
Cryptographic Algorithms Used in S/MIME
Function
Requirement
Create a message digest to be used in forming a digital signature.
MUST support SHA-256 SHOULD support SHA-1 Receiver SHOULD support MD5 for backward compatibility
Use message digest to form a digital signature.
MUST support RSA with SHA-256SHOULD support Signature -DSA with SHA-256 Scheme with -RSASSA-PSS with SHA-256 Appendix - -RSA with SHA-1 Probabilistic -DSA with SHA-1 Signature -RSA with MD5 Scheme
Encrypt session key for transmission with a message.
MUST support RSA encryption SHOULD support Optimal Asymmetric -RSAES-OAEP Encryption Padding -Diffie-Hellman ephemeral-static mode
Encrypt message for transmission with a onetime session key.
MUST support AES-128 with CBC SHOULD support -AES-192 CBC and AES-256 CBC -Triple DES CBC
S/MIME Flows
Pretty Good Privacy (PGP)
An alternative e-mail security protocol using “web of trust”
Has essentially the same functionality as S/MIME
Created by Phil Zimmerman and implemented as first released in 1991
Was made available free of charge and became popular for personal use
The initial PGP protocol was proprietary and used some encryption algorithms with intellectual property restriction
There are two significant differences between S/MIME and PGP:
Key certification
Key distribution
NIST SP 800-177 recommends the use of S/MIME rather than PGP cause of the greater confidence in the CA system of verifying public keys
PGP Key Rings
Each PGP user has a pair of keyrings:
public-key ring contains all the public-keys of other PGP users known to this user, indexed by key ID
private-key ring contains the public/private key pair(s) for this user, indexed by key ID & encrypted with key generated from a hashed passphrase
Security of private keys depends on the pass-phrase security!
PGP Key Rings:
PGP Trust Model Example
Domain Name System (DNS)
A directory lookup service; essential functioning of the Internet
Is used by MUAs and MTAs to find the address of the next hop server for mail delivery
Comprised of four elements:
Domain name space
DNS uses a tree-structured name space to identify resources on the Internet
DNS database
Conceptually, each node and leaf in the name space has a set of information in resource record. Collection of all RRs is organized into distributed database
Name servers
These are server programs that hold information about a portion of the domain name tree structure and the associated RRs
Resolvers
These are programs that extract information from name servers in response to client requests. A typical client request is for an IP address corresponding to a given domain name
Resource Record Types
Type
Description
A
A host address. This RR type maps the name of a system to its IPv4 address. Some systems (e.g., routers) have multiple addresses, and there is a separate RR for each.
AAAA
Similar to A type, but for IPv6 addresses.
CNAME
Canonical name. Specifies an alias name for a host and maps this to the canonical (true) name.
HINFO
Host information. Designates the processor and operating system used by the host.
MINFO
Mailbox or mail list information. Maps a mailbox or mail list name to a host name.
MX
Mail exchange. Identifies the system(s) via which mail to the queried domain name should be relayed.
NS
Authoritative name server for this domain.
PTR
Domain name pointer. Points to another part of the domain name space.
SOA
Start of a zone of authority (which part of naming hierarchy is implemented). Includes parameters related to this zone.
SRV
For a given service provides name of server or servers in domain that provide that service.
TXT
Arbitrary text. Provides a way to add text comments to the database.
WKS
Well-known services. May list the application services available at this host.
DNS Security Extensions
DNSSEC:
Provides end-to-end protection through the use of digital signatures that are created by zone administrators and verified by a recipient’s resolver software
Avoids the need to trust intermediate name servers and resolvers that cache or route the DNS records originating from the zone administrator before they reach the source of the query
Consists of a set of new resource record types and modifications to the existing DNS protocol
Defined in:
RFC 4033, DNS Security Introduction and Requirements
RFC 4034, Resource Records for the DNS Security Extensions
RFC 4035, Protocol Modifications for the DNS Security Extension
DNSSEC RR Types
DNSSEC adds four new DNS RR types:
DNSKEY – Containing public key for domain (and spec. of signature algorithm)
RRSIG – Containing digital signature of another RR (typically several such RRs for a domain)
NSEC – “Denial of existence” (of RR) with digital signature (denies that a RR exists by referring to next existing RR, and this way indirectly telling that no RRs exist in between)
DS – Delegation signer (for authencity of a child zone) – contains hash of public key of a child zone (for creating chain of trust)
; Parent zone (.com)
example.com. IN DS 2371 13 2 E4F7B1C...
; Child zone (example.com)
example.com. IN DNSKEY 257 3 13 mdsswU...
example.com. IN A 93.184.216.34
example.com. IN RRSIG A 13 2 ...
example.com. IN NSEC mail.example.com. ..
DNS-Based Authentication of Named Entities (DANE)
DANE is a protocol to allow X.509 certificates, commonly used for Transport Layer Security (TLS), to be bound to DNS names using DNSSEC
It is proposed in RFC 6698 as a way to authenticate TLS client and server entities without a certificate authority (CA)
The purpose of DANE is to replace reliance on the security of the CA system with reliance on the security provided by DNSSEC
DANE defines a new DNS RR type, TLSA, that can be used for a secure method of verifying TLS certificates
Contains port number, protocol, hostname
Not certificate itself, but confirms public key owner binding
Sender Policy Framework (SPF)
SPF is the standardized way for a sending domain to identify and assert the mail senders for a given domain
Addresses the problem of any host being able to use any domain name for each of the various identifiers in the mail header, not just the domain name where the host is located
Defined in RFC 7208
SPF works by checking a sender’s IP address against the policy encoded in any SPF DNS RR found at the sending domain
Common SPF Mechanisms and Modifiers
(a) SPF Mechanisms
Tag
Description
ip4
Specifies an IPv4 address or range of addresses that are authorized senders for a domain.
ip6
Specifies an IPv6 address or range of addresses that are authorized senders for a domain.
mx
Asserts that the listed hosts for the Mail Exchange RRs are also valid senders for the domain.
include
Lists another domain where the receiver should look for an SPF RR for further senders. This can be useful for large organizations with many domains or sub-domains that have a single set of shared senders. The include mechanism is recursive, in that the SPF check in the record found is tested in its entirety before proceeding. It is not simply a concatenation of the checks.
all
Matches every IP address that has not otherwise been matched.
(b) SPF Mechanism Modifiers
Modifier
Description
+
The given mechanism check must pass. This is the default mechanism and does not need to be explicitly listed.
-
The given mechanism is not allowed to send email on behalf of the domain.
The given mechanism is in transition and if an email is seen from the listed host/IP address, that it should be accepted but marked for closer inspection.
?
The SPF RR explicitly states nothing about the mechanism. In this case, the default behavior is to accept the email. (This makes it equivalent to '+' unless some sort of discrete or aggregate message review is conducted).
A specification for cryptographically signing e-mail messages, permitting a signing domain to claim responsibility for a message in the mail stream
Message recipients can verify the signature by querying the signer’s domain directly to retrieve the appropriate public key and can thereby confirm that the message was attested to by a party in possession of the private key for the signing domain
Proposed Internet Standard RFC 6376
Has been widely adopted by a range of e-mail providers and Internet Service Providers (ISPs)
Domain-based Message Authentication, Reporting, and Conformance (DMARC)
DMARC allows e-mail senders to specify policy on how their mail should be handled, the types of reports that receivers can send back, and the frequency those reports should be sent
Is defined in RFC 7489, Domain-based Message Authentication, Reporting, and Conformance, March 2015
Works with SPF and DKIM and ties them together
DMARC standardizes how e-mail receivers perform e-mail authentication using SPF and DKIM mechanisms
DMARC authentication deals with the From domain in the message header, as defined in RFC 5322
DMARC requires that From address match (be aligned with) an Authenticated Identifier from DKIM or SPF
Uses TXT RR in DNS
DMARC Tag and Value Descriptions
Tag (Name)
Description
v=(Version)
Version field that must be present as the first element. By default the value is always DMARC1.
p=(Policy)
Mandatory policy field. May take values none or quarantine or reject. This allows for a gradually tightening policy where the sender domain recommends no specific action on mail that fails DMARC checks ( none ), through treating failed mail as suspicious ( quarantine), to rejecting all failed mail ( ), preferably at the SMTP transaction stage.
aspf= (SPF Policy)
Values are r (default) for relaxed and s for strict SPF domain enforcement. Strict alignment requires an exact match between the From address domain and the (passing) SPF check must exactly match the MailFrom address (HELO address). Relaxed requires that only the From and MailFrom address domains be in alignment. For example, the MailFrom address domain smtp.example.org and the From address announce@example.org are in alignment, but not a strict match.
adkim = (DKIM Policy)
Optional. Values are r (default) for relaxed and s for strict DKIM domain enforcement. Strict alignment requires an exact match between the From domain in the message header and the DKIM domain presented in the d= DKIM tag. Relaxed requires only that the domain part is in alignment (as in aspf).
fo= (Failure reporting options)
Optional. Ignore if a ruf argument is not also present. Value 0 indicates the receiver should generate a DMARC failure report if all underlying mechanisms fail to produce an aligned pass result. Value 1 means generate a DMARC failure report if any underlying mechanism produces something other than an aligned pass result. Other possible values are d (generate a DKIM failure report if a signature failed evaluation), and s (generate an SPF failure report if the message failed SPF evaluation). These values are not exclusive and may be combined.
ruf=
Optional, but requires the fo argument to be present. Lists a series of URIs (currently just mailto:) that list where to send forensic feedback reports. This is for reports on message specific failures.
rua=
Optional list of URIs (like in ruf=, using the mailto: URI) listing where to send aggregate feedback back to the sender. These reports are sent based on the interval requested using the ri= option, with a default of 86400 seconds if not listed.
ri= (Reporting interval)
Optional with the default value of 86400 seconds. The value listed is the reporting interval desired by the sender.
pct= (Percent)
Optional with the default value of . Expresses the percentage of a sender's mail that should be subject to the given DMARC policy. This allows senders to ramp up their policy enforcement gradually and prevent having to commit to a rigorous policy before getting feedback on their existing policy.
sp= (Receiver policy)
Optional with a default value of none. Other values include the same range of values as the argument. This is the policy to be applied to mail from all identified subdomains of the given DMARC RR.