<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc toc="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc compact="yes"?>
<rfc category="std" docName="draft-bhjl-x509-srv-02" ipr="trust200902">
 <front>
   <title abbrev="Cert Store SRV Record">Using a DNS SRV Record to Locate an X.509 Certificate Store</title>

   <author fullname="Brian Haberman" initials="B." surname="Haberman">
      <organization abbrev="JHU APL">Johns Hopkins University Applied Physics Lab</organization>
      <address>
        <email>brian@innovationslab.net</email>
      </address>
   </author>

   <author initials="J.R." surname="Levine"
	   fullname="John Levine">
      <organization>Taughannock Networks</organization>

      <address>
	 <postal>
	    <street>PO Box 727</street>
	    <city>Trumansburg</city>
	    <region>NY</region>
	    <code>14886</code>
	 </postal>
	    
	 <phone>+1 831 480 2300</phone>
	 <email>standards@taugh.com</email>
      </address>
   </author>

   <date month="July" year="2016" />

   <abstract>
     <t>This document describes a method to allow parties to locate X.509 certificate stores with Domain Name System
     Service records in order to retrieve certificates and certificate revocation lists. The primary purpose of such
     retrievals is to facilitate the association of X.509 and PGP public keys with e-mail addresses to allow for encrypted e-mail
     exchanges.</t>
   </abstract>

 </front>

 <middle>
   <section anchor="intro" title="Introduction">

     <t>X.509 and PGP public keys can be used to encrypt or sign
e-mail messages. In order to verify a sender's signature or encrypt an
e-mail, the e-mail client needs to locate the appropriate public key.
The X.509-based Public Key Infrastructure (PKI)
<xref target="RFC5280"/> provides the necessary services to allow for
the retrieval of certificates and certificate revocation lists, but
lacks the discovery mechanism needed to associate e-mail domains with
specific PKI servers.</t>

     <t>This document specifies an approach that uses a Domain Name
System (DNS) Service Record (SRV) that allows mail service providers
to advertise the X.509 or PGP certificate store <xref target="RFC4387"
/> that contains certificates and certificate revocation lists for
their e-mail users. Additionally, this document specifies the
appropriate query strings to use when accessing the certificate
store.</t>

     <t>The capitalized key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
<xref target="RFC2119" />.</t>
   </section>

   <section title="Service Record Format">

     <t>The general format of a DNS SRV record is documented in <xref target="RFC2782" /> as:</t>

     <figure>
     <artwork>
<![CDATA[
     _Service._Proto.Name TTL Class SRV Priority Weight Port Target
]]>
     </artwork>
     </figure>

     <t>To support the advertisement of an X.509 certificate store, service providers publish an SRV record
	for the certificates service with the
appropriate parameters, as described in <xref target="RFC4387" />, section 3.2.
An example of such an SRV record is:</t>
     <figure>
     <artwork>
<![CDATA[
     _certificates._tcp 86400 IN SRV 0 0 443 certs.example.com
]]>
     </artwork>
     </figure>

     <t>The parameters of the DNS SRV record are set based on the operational needs of the service provider. The DNS SRV record
SHOULD be signed via <xref target="RFC4033" >DNSSEC</xref><xref target="RFC4034"/>.
     The server MUST be an https server and will typically use port 443.
     The certificate of the https server SHOULD be validated by a DNSSEC signed TLSA record, and MAY also be validated by
     a certificate authority.</t>
   </section>

   <section title="Certificate Store Queries">
      <t>To retrieve an X.509 S/MIME certificate, the attribute type is "uri", and the URI is constructed using the path described
	 in <xref target="RFC4387"/>, Section 3.3, specifically "/certificates/search.cgi".
	 Using the SRV record above to look up a certificate for bob@example.com, the URI would be:</t>
     <figure>
     <artwork>
<![CDATA[
https://certs.example.com/certificates/search.cgi?uri=bob%40example.com
]]>
     </artwork>
     </figure>
     <t>X.509 certificate stores MUST support the uri attribute and MAY support other attributes.</t>

      <t>To retrieve a PGP certificate, the attribute type is "email", and the URI is constructed using the path described
	 in <xref target="RFC4387"/>, Section 3.3, specifically "/pgpkeys/search.cgi".
	 Using the SRV record above to look up a certificate for bob@example.com, the URI would be:</t>
     <figure>
     <artwork>
<![CDATA[
https://certs.example.com/pgpkeys/search.cgi?email=bob%40example.com
]]>
     </artwork>
     </figure>
     <t>PGP certificate stores MUST support the email attribute and MAY support other attributes.</t>
   </section>

   <section title="Name Matching">
      <t><xref target="RFC5321">SMTP</xref> specifies that the local part of a mailbox is interpreted only by
      the mailbox domain itself. This document does not update or modify that document.
      </t>
      <t>If a certificate store has no certificate with an e-mail address that matches the uri or email attribute
      in a retrieval request, but it does have a certificate with an e-mail address that the mailbox domain
      treats similarly to the requested address, the server MAY return that certificate.
      The definition of what is sufficiently similar is a matter of local policy, but the intention is that
      a human correspondent would consider the same person or entity to receive mail at the two addresses.
      </t>
   </section>

   <section title="Certificate Validation">
     <t>The certificate is returned as a blob of binary data. If multiple certificates are returned, the response is
	encoded as multipart/mixed.</t>
     <t>X509 S/MIME certificates are validated by checking for a signature by a Certificate Authority (CA)
	that is acceptable to the validating party.
	This specification defines an additional validation technique.
	The domain MAY publish validation certificates using TLSA records at the name _smimeca._tcp.
	The TLSA records MUST have PKIX-TA or DANE-TA usage<xref target="RFC7218" />.
     </t>
     <t>Since the relationship between a domain and its mailbox users is in general unknown to correspondents,
	a client applies a local policy to decide whether to use a S/MIME certificate validated only by a signing
	certificate published by the domain.
     </t>
     <t>PGP certificates are validated by the PGP web of trust.
	A domain can endorse the certificates it publishes by signing them with a signature of postmaster@&lt;domain&gt;.
	Since the relationship between a domain and its mailbox users is in general unknown to correspondents.
	a client applies a local policy to decide whether to use a PGP certificate retrieved from a certificate server.
	This policy would typically be the same one used to decide whether to use a certificate retrieved from a traditional
	PGP key server.
     </t>
   </section>

   <section title="Certificate use and cacheing">
      <t>Clients SHOULD cache responses to queries as advised by http cache headers.
	 This includes both returned certificates, and 404 failures saying that an address (or other search key)
	 has no certificate.
      </t>
      <t>
	 S/MIME keys retrieved from the certificate store SHOULD NOT be used for validation of signatures
	 on incoming mail without further validation of the certificate.
	 S/MIME signed mail includes a copy of the signing certificate which, if it can be validated,
	 typically would be used instead.
      </t>
   </section>
      
   <section title="Security Considerations">
      <t>
	 Certificate queries could be used to try to validate lists of e-mail addresses.
	 This is essentially the same problem that mail servers face with RCPT TO probes,
	 and the same countermeasures would apply, such as rate limiting, blacklisting abusive
	 clients, and returning fake results for non-existent addresses.
      </t>
      <t>DNSSEC signatures on the SRV record and the https server certificate ensure that any keys retrieved
	 by the technique described in this document are the ones published by the domain's management.
	 But since correspondents often do not know the relationship between a domain and its mailbox users,
	 it would be imprudent to assume that such certificates are in fact ones issued to or used by mailbox
	 recipients or to assume that mail encrypted using the certificates will be readable only by the intended
	 recipient.
      </t><t>
	 A domain could publish man-in-the-middle certificates that allowed it to decode and read mail, and perhaps
	 re-encrypt it using different certificates used by the recipients.
	 In some cases this would be entirely legitimate, e.g., a financial institution that is required to log
	 all of its employees's correspondence.  In other cases, it could be improper surveillance of the contents
	 of users' mail.
	 Identifying or describing the relationship between a domain and its mail users is beyond the scope of this
	 document.
      </t>
   </section>

   <section title="IANA Considerations">
     <t>[Note to IANA, to be removed prior to publication.]</t>
     <t>IANA is requested to add two entries to the Service Name and Transport Protocol Port Number Registry.
     </t>

	<section title="Certificates service">
	   <t>Service Name: certificates</t>
	   <t>Transport Protocol(s): tcp</t>
	   <t>Assignee: IESG</t>
	   <t>Contact: &lt;chair@ietf.org&gt;</t>
	   <t>Description: Server for S/MIME and PGP certificates</t>
	   <t>Reference: [this document]</t>
	   <t>Port Number: none</t>
	   <t>Service Code: none</t>
	   <t>Known Unauthorized Uses: none</t>
	</section>
 
	<section title="Smimeca service">
	   <t>Service Name: simeca</t>
	   <t>Transport Protocol(s): tcp</t>
	   <t>Assignee: IESG</t>
	   <t>Contact: &lt;chair@ietf.org&gt;</t>
	   <t>Description: Authority certificate for S/MIME certificates</t>
	   <t>Reference: [this document]</t>
	   <t>Port Number: none</t>
	   <t>Service Code: none</t>
	   <t>Known Unauthorized Uses: none</t>
	</section>
 
   </section>

   <section title="Acknowledgements">
      <t>We thank Wei Chuang, Nicolas Lidzborski, and Andreas Schulze for comments and suggestions.
	 </t>
   </section>
 </middle>

 <back>
   <references title="Normative References">
      <?rfc include="reference.RFC.2119" ?>
      <?rfc include="reference.RFC.2782" ?>
      <?rfc include="reference.RFC.4033" ?>
      <?rfc include="reference.RFC.4034" ?>
      <?rfc include="reference.RFC.4387" ?>
      <?rfc include="reference.RFC.5280" ?>
      <?rfc include="reference.RFC.5321" ?>
      <?rfc include="reference.RFC.7218" ?>
   </references>

 </back>
</rfc>
