Changes

Jump to: navigation, search

Security/DNSSEC-TLS

12,842 bytes removed, 17:27, 5 July 2011
no edit summary
Links to the feature tracking bug & other relevant bugs; links to related plans (test plan, product marketing plan, etc.); notes about things that depend on this, etc.
<!--
== Risks ==
Identify, prioritize, track and communicate any risks associated with this featureRisks are discussed in the [[Security/projectDNSSEC-TLS-details#Security Considerations|security considerations]] section of the detailed design page.
== Use Cases ==
Everyone loves The use cases, so you should provide them if you can (case is anyone running an HTTPS server and where it makes sense). The [[ChannelSwitching/ChannelSwitchingFeature#Use_Cases|Channel Switcher]] Feature Page has some good examplesanyone wishing to connect to that server using Firefox.
== Designs ==
Any and all mockups, design specs, tech specs, etc. Either inline or linked toDesign specifications are detailed [[Security/DNSSEC-TLS-details|here]].
== Test Plans ==
Any and all test Test plans and strategies. Either inline or linked to. are [[Security/DNSSEC-TLS->details#Test Plans|here]].
== Goals ==
Other stuff.
 
== Background ==
 
For more background information on TLS and DNSSEC, click [[Security/DNSSEC-TLS/Background|here]].
 
=== Embedding Certificate Information in DNS ===
[http://tools.ietf.org/html/draft-ietf-dane-protocol-07 DANE], [http://tools.ietf.org/html/draft-hallambaker-donotissue-04 Certification Authority Authorization (CAA)], and [http://tools.ietf.org/html/rfc2538 CERT] records are all methods of embedding certificate information in DNS records. With DANE, either the public key or entire certificate (or the hash thereof) may be put in a TLSA record that specifies, for example, the certificate or public key to be used for connecting to example.com tcp port 443 (in the record _443._tcp.example.com). CAA uses the hash of the certificate and can specify that any certificate issued for (for example) example.com must be rooted by the hashed certificate. CAA uses TYPE257 records. CAA has other policy options, as well. CERT simply embeds a certificate in a DNS record. For the time being, while CAA is powerful, it has been determined to be too complicated for this use case. Furthermore, CERT can only specify whole certificates, not just public keys, and is thus too restrictive. Thus, DANE alone will initially be supported.
 
=== Domain Validation ===
To use DNSSEC to perform domain validation, a key or certificate must be put in a DANE record corresponding to the server to validate. Then, during the TLS handshake, the chain of DNSSEC records from that record to an agreed-upon root must be sent along with the server certificate. The client can walk this chain of records to a trusted root to validate the material. If this succeeds, the client then uses either the embedded key material or the key material in the server certificate (that hast just been validated by the DNSSEC chain) as the public key for a key exchange. Note that if the DANE record consists of an entire certificate and that certificate will always be sent in the TLS handshake, the DANE record itself may be omitted. In this case, the RRSIG record for the DANE record will have to be used to validate the certificate sent in TLS.
 
Obviously this mechanism could work out of band. That is, instead of embedding the DNSSEC chain in the TLS handshake, the client could perform simultaneous DNSSEC lookups to verify the material in the server certificate. However, this would be significantly slower as it would involve multiple round-trip communications with another server.
 
=== How this is Different from Certificates ===
 
This mechanism does not require the involvement of a certificate authority. A server can issue a self-signed certificate and bind that certificate to a DANE record (either by key, whole certificate, or hash of either). Then, provided there exists a valid DNSSEC chain back to the root of trust, the self-signed certificate will be authenticated by that chain in the TLS handshake.
 
Alternatively, a server can use a certificate issued by a CA. In this case both the certificate chain and the DNSSEC chain must be valid.
 
This mechanism prevents CAs mis-issuing certificates. If a CA issues a certificate it was not supposed to, and that certificate gets used, it will not match the contents of the DANE/CAA record. Of course, the server with the bad certificate could simply omit the DNSSEC chain, so if none is sent, perhaps we should perform the out of band DNSSEC chain verification ourselves.
 
== DNSSEC Chains ==
 
The process of verifying a DNSSEC chain is discussed in general [[Security/DNSSEC-TLS/Background#Verifying a DNSSEC Chain|here]].
 
The format of a serialized DNSSEC chain sent in this protocol consists first of a series of the following:
 
* A DS (and corresponding RRSIG) record for a zone to enter, in wire format.
* The DNSKEY (and corresponding RRSIG) records for that zone, in wire format. The DS must correspond to one of the keys.
 
Each zone entered must be directly inner to the previous zone. The root zone may be omitted, because it is assumed that the client already has the DNSSEC keys for the root. The final entry is a TLSA (and corresponding RRSIG) record, again in wire format.
 
So, for example, the DNSSEC chain sent for clients connecting to foo.bar.com could be:
 
* The DS (+RRSIG) entering .com
* The DNSKEYS (+RRSIGs) for .com
* The DS (+RRSIG) entering bar.com
* The DNSKEYS (+RRSIGs) for bar.com
* The TLSA (+RRSIG) for foo.bar.com (given that the bar.com is authoritative for foo.bar.com)
 
It is possible to optimize away some fields of these records, but at the moment this is not being done. Another optimization would be for the client to indicate a root of trust deeper down the tree so that the server can omit some zones. For example, a client may already have (and have validated) all of the keys for .com. In the above example, if the client has already validated keys for .com, the server need only send the DS record entering bar.com and the keys for bar.com (as well as the final TLSA record).
 
Note that once a chain has been serialized, it will only be valid for as long as every signature in it is valid. That is, it will become invalid when any signature it contains expires.
 
For reference, another proposal for the serialization of a DNSSEC chain is [http://tools.ietf.org/html/draft-agl-dane-serializechain-01 here]. Note that this proposal does not follow exactly the wire format of DNS records. Consequently, preexisting code cannot be used to serialize, parse, or validate the chain. Additionally, more flexibility means more opportunities for insecure verifier behavior. This proposal is not currently being used in this project.
 
== Google Chrome ==
 
According to [http://www.imperialviolet.org/2011/06/16/dnssecchrome.html Adam Langley's Weblog], DNSSEC validation of TLS (specifically HTTPS) sessions is enabled by default in the canary and dev channels of Chrome. It is achieved through the server sending a self-signed certificate that contains as an X509 extension a blob of data corresponding to the DNSSEC chain. The leaf of the chain is a CAA record. The root of the chain is implicitly the root zone key signing key (the key itself is not included).
 
== Security Considerations ==
 
Using this mechanism, the ability to produce material that authenticates a domain is tied to the doman name hierarchy. That is, an arbitrary organization cannot masquerade as another party unless they control a level of the domain system closer to the root and on the same path as their target. This prevents the current situation where certificate authorities can issue certificates for domains they should not be allowed to. However, this still means that the organization in charge of the root zone can masquerade as any domain, and the organizations in charge of top level domains can masquerade as any domain below theirs, and so on.
 
If a certificate is sent that includes a certificate chain, the certificate chain must validate up to a trusted root. This root is either the certificate identified by the TLSA record in the DNSSEC chain or a trusted root CA certificate.
 
Similarly, if the certificate can be checked against OCSP or a CRL, it should be. If the certificate has been revoked, the TLS session should not continue.
 
Currently there is no revocation mechanism for DNS keys or signatures. Most signatures are valid for 1 month, however, so if a key has been compromised, the window of opportunity for evildoers is short. One survey did come up with this, though: [http://secspider.cs.ucla.edu/images/key-lifetimes.png key signature lifetimes]
 
Configuration of DNSSEC is not significantly more difficult than configuring DNS. As long as private keys are not exposed, it would be difficult to configure DNSSEC in a way that is operable yet insecure.
 
TLS intercepting proxies essentially man-in-the-middle connections made to them. With certificate-based domain validation, users simply install an exception corresponding to the certificate of the proxy, allowing it to be a root of trust. The same idea could be used here, but it would be cumbersome. The proxy would have a root DNSKEY trusted by users. Upon any connection, the proxy could create a chain of DNS records rooted by that key. The users would then verify that chain. This obviously does not work if the DNSSEC chain lookup is done out of band. Another option is to simply fall back on certificate-based validation (with an exception installed by users). Hopefully the proxy itself would verify the DNSSEC chain in its connection to the actual server.
 
If there is a mechanism for the client to say what keys have already been validated (thus decreasing the length of the chain a server must send), there may be privacy implications. For instance, if a only small number of sites have their DS records signed by a specific key from .com and the client indicates they have already validated that specific key, another server knows the client has visited one of those sites. There may be a way for a client to instead indicate they have all of the keys for a zone as of a certain time (i.e. "now"), thus eliminating a privacy leak.
 
== DNSSEC Libraries ==
 
[http://www.nlnetlabs.nl/projects/ldns/ ldns], [https://www.dnssec-tools.org/ DNSSEC-Tools], and [http://unbound.net/download.html Unbound] all use BSD licenses. Thus far, I've had the most success using ldns. Unbound uses ldns.
 
== Creating a TLSA Record ==
 
Material embedded in a TLSA record must follow the [http://tools.ietf.org/html/draft-ietf-dane-protocol-07 specification]. This involves making the decision of what to embed. As mentioned above, the embedded material may be a certificate identifying an end entity (i.e. the server clients will connect to), a certification authority's certificate (where that certificate is an ancestor of a certificate on the server), or a public key (which may correspond to either of the two situations). Then, the actual data embedded may be the full representation, a sha256 hash, or a sha512 hash. Different decisions may be appropriate for different situations.
 
Once the certificate type and reference type are determined, the appropriate values can be used to construct an entry that goes into the zone file for the DNS server that is authoritative for the domain name in question. For instance, if the sha256 hash of a public key were to be used, the entry might look like this:
 
WWW.EXAMPLE.COM. 60 IN TYPE65468 \# 34 0301731050b68ae9bb14f894a0fd3c2dbe4210336942cdd69036235593ca582e787d
 
(Where the entry is intended to be a single contiguous line.) This specifies a record of type 65468 (experimental number for TLSA) that is 34 bytes long. The "03" at the beginning indicates a public key, and the "01" indicates sha256. The rest is the hash. (The actual data embedded in the record is represented as a series of in-order two-digit hexadecimal values that each correspond to a byte of data.)
 
== Transmitting the DNSSEC Chain ==
 
There are essentially two reasonable options for transmitting the DNSSEC chain in the TLS handshake. The first option is to include it as an X509 extension in the server certificate, as Google Chrome does (see above). The second option would be to define a TLS extension wherein the server sends the chain in addition to, but outside of, its certificate. In either case, the client would receive the chain, verify it, and if successful, continue the session. Note that the material provided in the chain does not replace the material from the certificate - it merely verifies it.
 
The first option (X509 extension) is easy to deploy, as it only requires making a special certificate and minimal modifications to server software. It works well with self-signed certificates (where the TLSA record provides the chain of trust), but not with preexisting certificates signed by a third party. Furthermore, in order to use the optimization of sending a chain with a deeper root of trust (i.e. sending a shorter chain), the certificate would have to either be created on the fly or a certificate for every possible chain would have to be created (admittedly, this is a small number). This still doesn't solve the problem, however, because there must be a mechanism for the client to tell the server what root is appropriate. This optimization would require some small server modifications.
 
The second option (TLS extension) is more difficult to deploy, because it requires more significant server modification to implement the extension. However, it will work with both self-signed and preexisting certificates. Additionally, the short chain optimization would work as expected: the client specifies a trusted root and the server responds with a chain from that root.
 
Currently the second option (TLS extension) is considered ultimately more flexible and usable.
== Legend (remove if you like) ==
Confirm
298
edits

Navigation menu