None P. Saint-Andre Internet-Draft Cisco Intended status: Standards Track K. Zeilenga Expires:December 5, 2009March 4, 2010 Isode Limited J. HodgesNeuStarPayPal R. Morgan Internet2June 3,August 31, 2009Best Practices for Checking ofServerIdentitiesIdentity Verification inthe Context of Transport Layer Security (TLS) draft-saintandre-tls-server-id-check-00Application Protocols draft-saintandre-tls-server-id-check-01 Status of this Memo This Internet-Draft is submitted to IETF in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire onDecember 5, 2009.March 4, 2010. Copyright Notice Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents in effect on the date of publication of this document (http://trustee.ietf.org/license-info). Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Abstract Technologies such as Transport Layer Security (TLS) and IPsec enable a secure connection between two entities (a "client" and a "server") using X.509 certificates. This document specifies recommended procedures for checking thehow an entity establishing a TLS connection, or other PKI-based interaction, with a server should verifyidentity of the serveridentity.in such an interaction. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.Terminology .Conventions . . . . . . . . . . . . . . . . . . . . . . . . .34 3.Server Identity CheckVerification Process . . . . . . . . . . . . . . . . . . . . .35 3.1.Comparison of DNS NamesOverview . . . . . . . . . . . . . . . . . .4. . . . . . . 5 3.2. ComparisonofRules . . . . . . . . . . . . . . . . . . . . . 6 3.2.1. Domain Names . . . . . . . . . . . . . . . . . . . . . 6 3.2.2. IP Addresses . . . . . . . . . . . . . . . .5. . . . . 7 3.2.3. Email Addresses . . . . . . . . . . . . . . . . . . . 7 3.2.4. SIP Addresses . . . . . . . . . . . . . . . . . . . . 8 3.2.5. JabberIDs . . . . . . . . . . . . . . . . . . . . . . 8 3.3.Comparison of Other subjectName TypesOutcome . . . . . . . . . . .5. . . . . . . . . . . . . . 8 4. Security Considerations . . . . . . . . . . . . . . . . . . .. 59 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 6. References . . . . . . . . . . . . . . . . . . . . . . . . . .5 5.1.9 6.1. Normative References . . . . . . . . . . . . . . . . . . .5 5.2.9 6.2. Informative References . . . . . . . . . . . . . . . . . .69 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . .612 1. IntroductionEstablishingTechnologies such as Transport Layer Security [TLS] and [IPSEC] enable aTLS-basedsecure connection[TLS] withbetween two entities using the Internet X.509 Public Key Infrastructure (PKI) as described in [X509]. In such interactions, the entity that initiates the connection is called aserver,"client" and the entity that receives the connection is called a "server". Note: The terms "client" and "server" as used here refer to security roles, not application roles; a server in the context of TLS orany other sortIPSec might be a "client" (i.e., a user agent) in the context ofclient-server PKI-based interaction, entails,an application protocol as deployed on thepartInternet. If a client wishes to connect to a server securely, it needs to check the identity of theclient, verifyingserver so that it can determine if the"server's identity" based upon information presentedserver is what it claims to be, verify that there is no attacker in the middle, etc. Typically this is done by correlating theserverinformation presented initsthe server's certificatecorrelatedwiththeinformation available about the serverensconcedcontained in the Domain Name System (DNS).Presently, various Internet-Drafts utilizing TLS or prescribing PKI- based interactions, either prescribeDifferent application protocols that make use of the client-server pattern for security purposes have traditionally specified their own procedures for checking serveridentity check, or referenceidentities. Examples include but are not limited to: o The Hypertext Transfer Protocol [HTTP], for which see also [HTTP-TLS] o The Internet Message Access Protocol [IMAP] and the Post Office Protocol [POP3], for which see also [USINGTLS] o The Lightweight Directory Access Protocol [LDAP], for which see also [LDAP-AUTH]orand its predecesor[LDAP-TLS]. [there may be other I-Ds referencing other specs that describe the equivalent of server identity checks] Converging our present understanding[LDAP-TLS] o The NETCONF Configuration Protocol [NETCONF], for which see also [NETCONF-SSH] and [NETCONF-TLS] o The Network News Transfer Protocol [NNTP], for which see also [NNTP-TLS] o The Session Initiation Protocol [SIP], for which see also [SIP-CERTS] o The Simple Mail Transfer Protocol [SMTP], for which see also [SMTP-AUTH] and [SMTP-TLS] o The Syslog Protocol [SYSLOG], for which see also [SYSLOG-TLS] o The Extensible Messaging and Presence Protocol [XMPP], for which see also [XMPPBIS] Unfortunately, this divergence of approaches has caused some confusion among developers and protocol designers. Therefore thiscritical aspectdocument specifies recommended identity checking procedures for application protocols produced within the Internet Standards Process, for the purpose ofPKI- based interactionscodifying secure authentication practices. Note: This document isdesirablecurrently limited inthat it will hopefully encourage more coherencescope to the presentation of identities inspecifications and actual implementations thereof, as wellX.509 certificates aseaseissued in theburdencontext ofcrafting new specifications because this aspect has been factored outthe Public Key Infrastructure (PKI) andseparately standardized. Thisas applied to Transport Layer Security [TLS]; a future version of this documentextractsmight address X.509 certificates as issued outside the"server identity check" section from [LDAP-AUTH], withcontext of thegoalPKI, non-X.509 public keys such as OpenPGP keys, presentation ofbecoming a stand-alone BCP document appropriately referenceable by I-Dsidentities in ways other than in the certificate itself (e.g., certificate fingerprints for Secure Shell as described in [SSH] or for Datagram Transport Layer Security DTLS and Secure Real-time Transport Protocol as described in [DTLS-SRTP]), andthus RFCs.applications other than TLS. 2.TerminologyConventions Thekey wordsfollowing capitalized keywords are to be interpreted as described in [TERMS]: "MUST", "SHALL", "REQUIRED"; "MUST NOT","REQUIRED", "SHALL","SHALLNOT",NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT","RECOMMENDED","NOT RECOMMENDED"; "MAY",and "OPTIONAL" in this document"OPTIONAL". Most security-related terms are to beinterpreted as describedunderstood in[TERMS]. 3. Server Identity Checkthe sense defined in [SECTERMS]; such terms include, but are not limited to, "assurance", "attack", "authentication", "authorization", "certificate", "certification authority", "confidentiality", "credential", "downgrade", "encryption", "fingerprint", "hash value", "identity", "integrity", "signature", "security perimeter", "self- signed certificate", "sign", "spoof", "tamper", "trust", "trust anchor", "trust chain", "validate", "verify". Inorderaddition, we define the following terms to assist in understanding the process of verifying identity: identity set: The set of identities that are presented by the server toprevent man-in-the-middle attacks,the clientMUST verify(in the form of the server's X.509 certificate) when the client is attempts to establish a secure connection to the server. identity(astype: The "natural kind" of identity to which a presentedinidentity or reference identity belongs. For example, theserver's Certificate message).reference identity might be a domain name, an IPv4 or IPv6 address, an email address, a SIP address, a JabberID, or some other type (this specification does not yet provide a complete taxonomy of identity types). Inthis section,the case of domain names, the reference identity MUST NOT contain the wildcard character '*' (ASCII 42) in the left-most (least significant) domain name component or component fragment. presented identity: A single member of the identity set. reference identity: The client'sunderstandingconception of the server's identity(typicallybefore it attempts to establish a secure connection to the server; this is the identityusedthat the client expects the server to present and to which the client makes reference when attempting to verify the server's identity. 3. Verification Process When a client connects to a server, it MUST verify the server's identity (in order to prevent passive and active attacks against the connection). By "verify identity" we mean that the client needs to establish that at least one of thetransport connection) is calledidentities in the identity set matches the reference identity. 3.1. Overview At a high level, the client verifies the server identity in accordance with the following rules: 1. Before connecting to the server, the"reference identity". Theclient determines the identity type(e.g., DNS name or IP address)of the referenceidentity and performsidentity. 2. During the process of attempting to establish acomparison betweensecure connection, the server MUST present its identity set to the client in the form of an X.509 certificate [X509]. 3. Upon being presented with the server's identity set, the client MUST check the reference identityand eachagainst the presented identities for the purpose of finding a match. To do so, the client iterates through all of the subjectAltName extensions it recognizes in the server's certificate (potentially in an application-specific preference order) and compares the value of each extension against thecorresponding typereference identity until it has either produced a matchis produced. Once a match is produced,or exhausted theserver's identity has been verified, andidentities in theserveridentitycheck is complete. Different subjectAltNameset (comparison rules for matching particular identity types arematchedprovided under Section 3.2, including fallbacks to several subjectName fields). 4. Before attempting to find a match indifferent ways. Sections 3.1.3.1 - 3.1.3.3 explain howrelation tocompare values of various subjectAltName types. Thea particular presented identity, the clientmayMAY map the reference identity to a differenttype prior to performingidentity type. Such acomparison. Mappings maymapping MAY be performed forallany available subjectAltNametypestype to which the reference identity can be mapped; however, the reference identityshould onlySHOULD be mapped only to types for which the mapping is either inherently secure (e.g., extracting the DNS name from a URI to compare with a subjectAltName of type dNSName) or for which the mapping is performed in a secure manner (e.g., using DNSSEC, or using user- configured or admin-configuredhost- to-address/address-to-hosthost-to-address/address-to-host lookup tables).The server's identity may also be verified by comparing the reference identity to the Common Name (CN) [LDAP-SCHEMA] value in the leaf Relative Distinguished Name (RDN) of the subjectName field of the server's certificate. This comparison is performed using the rules for comparison of DNS names in Section 3.1.3.1, below, with the exception that no wildcard matching is allowed. Although the use of the Common Name value is existing practice, it is deprecated, and Certification Authorities are encouraged to provide subjectAltName values instead. Note that the TLS implementation may represent DNs in certificates according to X.500 or other conventions. For example, some X.500 implementations order the RDNs in a DN using a left-to-right (most significant to least significant) convention instead of LDAP's right-to-left convention.5. If theserveridentitycheck fails, user-oriented clients SHOULD either notify the user (clients may give the user the opportunity to continueset has more than one member, a match with any of theLDAP session in this case) or close the transport connection and indicate that the server's identity is suspect. Automated clients SHOULD close the transport connection and then return or log an error indicating that the server's identitypresented identities issuspect or both.acceptable. Note: Beyond the server identity check described in this section, clientsshould be prepared to domight complete further checking to ensure that the server is authorized to provide the service it is requested to provide. The clientmaymight need to make use of local policy information in making this determination.3.1.3.2. Comparisonof DNSRules 3.2.1. Domain Names If the reference identity is a domain name as defined by [RFC1034] and [RFC1035] for "traditional" domain names or by [IDNA] for internationalized domain names, then the client can match the reference identity against subjectAltName extensions of type dNSName and SRVName [SRVNAME] according to the following rules. If the reference identity is a "traditional" domain name, then matching of reference identity against the presented identity is performed by comparing the set of domain components using a case- insensitive ASCII comparison. If the reference identity is an internationalized domain name,conforming implementationsthen an implementation MUST convertitthe reference identity to the ASCII Compatible Encoding (ACE) format as specified in Section 4 of [IDNA] before comparison with subjectAltName values of typedNSName. Specifically, conforming implementations MUST performdNSName; specifically, the conversion operation specified in Section 4 ofRFC 3490[IDNA] MUST be performed as follows: o in step 1, the domain name SHALL be considered a "storedstring";string" o in step 3, set the flag called"UseSTD3ASCIIRules";"UseSTD3ASCIIRules" o in step 4, process each label with the "ToASCII"operation; andoperation o in step 5, change all label separators to U+002E (fullstop).stop) After performing the "to-ASCII" conversion, the DNS labels and names MUST be compared for equality according to the rules specified in Section 3 ofRFC3490. The[IDNA]. A dNSName MAY contain the wildcard character '*' (ASCII42)42). The wildcard characteris allowed in subjectAltName values of type dNSName, and thenapplies onlyasto the left-most (least significant)DNS label in that value. This wildcarddomain name component or component fragment and matches anyleft-most DNS label in the server name. That is, the subjectsingle component or component fragment. For instance, a dNSName of *.example.com matchesthe server names a.example.com and b.example.com,foo.example.com butdoesnotmatchbar.foo.example.com or example.com itself; similarly, a dNSName of baz*.example.net matches baz1.example.net and baz2.example.net but not qux.example.net ora.b.example.com. 3.2. Comparisonexample.net itself. In addition to checking the subjectAltName extensions of type dNSName and SRVNAME, the client MAY as a fallback check the value of the Common Name (CN) (see [LDAP-SCHEMA]) as presented in the subjectName component of the server's X.509 certificate. In existing certificates, the CN is often used for encapsulating a domain name; for example, consider the following subjectName: cn=www.example.com, ou=Web Services, c=GB Here the Common Name is "www.example.com" and the client could choose to compare the reference identity against that CN. When comparing the referenced identity against the Common Name, the client MUST follow the comparison rules described above for subjectAltName extensions of type dNSName and SRVName, with the exception that no wildcard matching is allowed. In order to match domain names, a client MUST NOT check Relative Distinguished Names (RDNs) other than the Common Name; in particular, this means that a series of Domain Component (DC) attributes MUST NOT be checked (because the order of Domain Components is not guaranteed, certain attacks are possible if DC attributes are checked). 3.2.2. IP AddressesWhenIf the reference identity is an IPaddress,address as defined by [IP] or [IPv6], then the client can match the reference identity against subjectAltName extensions of type iPaddress according to the following rules. The reference identity MUST be converted to the "network byte order" octet stringrepresentation [IP] [IPv6]. Forrepresentation; for IP Version4, as specified in RFC 791,4 the octet string will contain exactly fouroctets. Foroctets, and for IP Version6, as specified in RFC 2460,6 the octet string will contain exactly sixteen octets.This octet string isThe client thencompared against subjectAltName values of type iPAddress. Acompares this octet string, where a match occurs if the reference identityoctet stringandvaluepresented identity octet strings are identical.3.3. Comparison3.2.3. Email Addresses If the reference identity is an email address as defined by [EMAIL], then the client SHOULD compare the reference identity against the value ofOther subjectName Types Client implementationsthe "rfc822Name" subjectAltName extension described in [X509]. The client MAYsupport matchingalso compare the reference identity against the value of the "E" attribute of the subjectName as described in [CRMF]. 3.2.4. SIP Addresses If the reference identity is a SIP address as defined by [SIP], then the client SHOULD compare map the reference identity to a domain name or email address and proceed as described for those identity types, or proceed as described in [SIP-CERTS]. 3.2.5. JabberIDs If the reference identity is a JabberID as defined by [XMPP], then the client SHOULD compare the reference identity against the value of the "id-on-xmppAddr" subjectAltNamevaluesextension ofother typestype otherName described in [XMPP], or proceed as described inother documents.[XMPPBIS]. 3.3. Outcome The outcome of the checking procedure is one of the following: Case #1: The client finds at least one presented identity that matches the reference identity; the entity MUST use this as the validated identity of the server. Case #2: The client finds no subjectAltName that matches the reference identity but a human user has permanently accepted the certificate during a previous connection attempt; the client MUST verify that the cached certificate was presented and MUST notify the user if the certificate has changed since the last time that a secure connection was successfully negotiated. Case #3: The client finds no subjectAltName that matches the reference identity and a human user has not permanently accepted the certificate during a previous connection attempt; the client MUST NOT use the presented identity (if any) as the validated identity of the server and instead MUST proceed as described in the next section. Instead, if the client is a user-oriented application, then it MUST either (1) automatically terminate the connection with a bad certificate error or (2) show the certificate (including the entire certificate chain) to the user and give the user the choice of terminating the connecting or accepting the certificate temporarily (i.e., for this connection attempt only) or permanently (i.e., for all future connection attempts) and then continuing with the connection; if a user permanently accepts a certificate in this way, the client MUST cache the certificate (or some non-forgeable representation such as a hash value) and in future connection attempts behave as in Case #2. (It is the resposibility of the human user to verify the hash value or fingerprint of the certificate with the peer over a trusted communication layer.) If the client is an automated application, then it SHOULD terminate the connection with a bad certificate error and log the error to an appropriate audit log; an automated application MAY provide a configuration setting that disables this check, but MUST provide a setting that enables the check. 4. Security Considerations To follow. 5. IANA Considerations This document has no actions for the IANA. 6. References5.1.6.1. Normative References [IDNA] Faltstrom, P., Hoffman, P., and A. Costello, "Internationalizing Domain Names in Applications (IDNA)", RFC 3490, March 2003. [IP] Postel, J., "Internet Protocol", STD 5, RFC 791, September 1981. [IPv6] Deering, S. and R. Hinden, "Internet Protocol, Version 6 (IPv6) Specification", RFC 2460, December 1998. [TERMS] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [X509] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, May 2008. 6.2. Informative References [CRMF] Schaad, J., "Internet X.509 Public Key Infrastructure Certificate Request Message Format (CRMF)", RFC 4211, September 2005. [DTLS-SRTP] McGrew, D. and E. Rescorla, "Datagram Transport Layer Security (DTLS) Extension to Establish Keys for Secure Real-time Transport Protocol (SRTP)", draft-ietf-avt-dtls-srtp-07 (work in progress), February 2009. [EMAIL] Resnick, P., Ed., "Internet Message Format", RFC 5322, October 2008. [HTTP] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. [HTTP-TLS] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. [IMAP] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, March 2003. [IPSEC] Kent, S. and K. Seo, "Security Architecture for the Internet Protocol", RFC 4301, December 2005. [LDAP] Sermersheim, J., "Lightweight Directory Access Protocol (LDAP): The Protocol", RFC 4511, June 2006. [LDAP-AUTH] Harrison, R., "Lightweight Directory Access Protocol (LDAP): Authentication Methods and Security Mechanisms", RFC 4513, June 2006. [LDAP-SCHEMA] Sciberras, A., "Lightweight Directory Access Protocol (LDAP): Schema for User Applications", RFC 4519, June 2006.[TERMS] Bradner, S., "Key words[LDAP-TLS] Hodges, J., Morgan, R., and M. Wahl, "Lightweight Directory Access Protocol (v3): Extension foruseTransport Layer Security", RFC 2830, May 2000. [NETCONF] Enns, R., "NETCONF Configuration Protocol", RFC 4741, December 2006. [NETCONF-SSH] Wasserman, M. and T. Goddard, "Using the NETCONF Configuration Protocol over Secure SHell (SSH)", RFC 4742, December 2006. [NETCONF-TLS] Badra, M., "NETCONF over Transport Layer Security (TLS)", RFC 5539, May 2009. [NNTP] Feather, C., "Network News Transfer Protocol (NNTP)", RFC 3977, October 2006. [NNTP-TLS] Murchison, K., Vinocur, J., and C. Newman, "Using Transport Layer Security (TLS) with Network News Transfer Protocol (NNTP)", RFC 4642, October 2006. [POP3] Myers, J. and M. Rose, "Post Office Protocol - Version 3", STD 53, RFC 1939, May 1996. [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", STD 13, RFC 1034, November 1987. [RFC1035] Mockapetris, P., "Domain names - implementation and specification", STD 13, RFC 1035, November 1987. [SECTERMS] Shirey, R., "Internet Security Glossary, Version 2", RFC 4949, August 2007. [SIP] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston, A., Peterson, J., Sparks, R., Handley, M., and E. Schooler, "SIP: Session Initiation Protocol", RFC 3261, June 2002. [SIP-CERTS] Gurbani, V., Lawrence, S., and B. Laboratories, "Domain Certificates inRFCs to Indicate Requirement Levels", BCP 14,the Session Initiation Protocol (SIP)", draft-ietf-sip-domain-certs-04 (work in progress), May 2009. [SMTP] Klensin, J., "Simple Mail Transfer Protocol", RFC2119,5321, October 2008. [SMTP-AUTH] Siemborski, R. and A. Melnikov, "SMTP Service Extension for Authentication", RFC 4954, July 2007. [SMTP-TLS] Hoffman, P., "SMTP Service Extension for Secure SMTP over Transport Layer Security", RFC 3207, February 2002. [SRVNAME] Santesson, S., "Internet X.509 Public Key Infrastructure Subject Alternative Name for Expression of Service Name", RFC 4985, August 2007. [SSH] Ylonen, T. and C. Lonvick, "The Secure Shell (SSH) Protocol Architecture", RFC 4251, January 2006. [SYSLOG] Gerhards, R., "The Syslog Protocol", RFC 5424, March1997.2009. [SYSLOG-TLS] Miao, F., Ma, Y., and J. Salowey, "Transport Layer Security (TLS) Transport Mapping for Syslog", RFC 5425, March 2009. [TLS] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, August 2008.5.2. Informative References [LDAP-TLS] Hodges, J., Morgan, R.,[USINGTLS] Newman, C., "Using TLS with IMAP, POP3 andM. Wahl, "Lightweight Directory AccessACAP", RFC 2595, June 1999. [XMPP] Saint-Andre, P., Ed., "Extensible Messaging and Presence Protocol(v3): Extension for Transport Layer Security",(XMPP): Core", RFC2830, May 2000.3920, October 2004. [XMPPBIS] Saint-Andre, P., "Extensible Messaging and Presence Protocol (XMPP): Core", draft-ietf-xmpp-3920bis-01 (work in progress), August 2009. Authors' Addresses Peter Saint-Andre Cisco Email: psaintan@cisco.com Kurt D. Zeilenga Isode Limited Email: Kurt.Zeilenga@Isode.COM Jeff HodgesNeuStarPayPal Email: Jeff.Hodges@KingsMountain.com RL 'Bob' Morgan UWashington/Internet2 Email: rlmorgan@washington.edu