Re: [dane] An AD bit discussion (correction)

Petr Spacek <pspacek@redhat.com> Thu, 27 February 2014 20:04 UTC

Return-Path: <pspacek@redhat.com>
X-Original-To: dane@ietfa.amsl.com
Delivered-To: dane@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 2758D1A0656 for <dane@ietfa.amsl.com>; Thu, 27 Feb 2014 12:04:25 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.449
X-Spam-Level:
X-Spam-Status: No, score=-7.449 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.547, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id arIwFq8x_7YV for <dane@ietfa.amsl.com>; Thu, 27 Feb 2014 12:04:21 -0800 (PST)
Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by ietfa.amsl.com (Postfix) with ESMTP id 50BEC1A01F4 for <dane@ietf.org>; Thu, 27 Feb 2014 12:04:21 -0800 (PST)
Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s1RK4Fua008657 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for <dane@ietf.org>; Thu, 27 Feb 2014 15:04:17 -0500
Received: from pspacek.brq.redhat.com (vpn1-7-193.ams2.redhat.com [10.36.7.193]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s1RK4DeM011419 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO) for <dane@ietf.org>; Thu, 27 Feb 2014 15:04:15 -0500
Message-ID: <530F9A3D.3070008@redhat.com>
Date: Thu, 27 Feb 2014 21:04:13 +0100
From: Petr Spacek <pspacek@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0
MIME-Version: 1.0
To: dane@ietf.org
References: <alpine.LFD.2.10.1402261930400.3528@bofh.nohats.ca> <20140227022347.GC73737@mx1.yitter.info> <20140227031628.B4A1610765F9@rock.dv.isc.org> <20140227034723.GA73861@mx1.yitter.info> <20140227041753.3509810773A8@rock.dv.isc.org> <20140227044213.GO21390@mournblade.imrryr.org> <alpine.LFD.2.10.1402270015320.6180@bofh.nohats.ca> <20140227054617.GP21390@mournblade.imrryr.org> <530F3A64.2000001@redhat.com> <20140227164014.GT21390@mournblade.imrryr.org> <20140227164201.GU21390@mournblade.imrryr.org>
In-Reply-To: <20140227164201.GU21390@mournblade.imrryr.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
Archived-At: http://mailarchive.ietf.org/arch/msg/dane/T4Qw-a1SILepDAU0rDQzPqA4avY
Subject: Re: [dane] An AD bit discussion (correction)
X-BeenThere: dane@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DNS-based Authentication of Named Entities <dane.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dane>, <mailto:dane-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/dane/>
List-Post: <mailto:dane@ietf.org>
List-Help: <mailto:dane-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dane>, <mailto:dane-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 27 Feb 2014 20:04:25 -0000

On 27.2.2014 17:42, Viktor Dukhovni wrote:
> On 27.2.2014 17:40, Viktor Dukhovni wrote:
> On Thu, Feb 27, 2014 at 02:15:16PM +0100, Petr Spacek wrote:
>>
>>> Please let's concentrate on following situation:
>>> - Crypto libraries like GnuTLS/OpenSSL/NSS have DANE support
>>> compiled and enabled by default out-of-the-box.
>>
>> The enabled by default part would be most likely.  It is not up to
 > Oops, s/most likely/most UNLIKELY/.
>> the libraries to enable DANE support.  They don't know which
[...]

Feel free to skip handwaving about crypto libraries and jump straight to the 
matter - DNS stub-resolvers.

/Disclaimer: Please read following text about crypto libraries as a long-term 
vision. I'm adding it here just to add some context information. I'm aware 
that it will take long and that is not *that* simple./

>> multiplicity of interfaces, and the fact that applications may want
>> an asynchronous DNS interface, but none is as yet as entrenched as
>> libresolv, I would expect these toolkits to punt on TLSA record
>> resolution and leave this up to the application.  Especially because
>> policy about DNSSEC validation (AD bit vs. in-app trust anchors,
>> which nameservers, ...) don't belong in the underlying SSL library.
I have talked with NSS developers at Red Hat's Developer Conference this year 
(devconf.cz) and their (personal and not-that-thorough) opinion was that it 
seems feasible to do DANE for pure TLS directly in crypto library.

If everything you need is to open a TLS connection to a server with given name 
then *in theory* the crypto library can do all the work for you.

Of course, there are applications with special requirements but easy cases 
could be (we hope) handled in crypto library and special case over appropriate 
APIs.

The discussion ended with statement that we need to solve API for resolvers 
first and then we can open discussion about DANE in NSS again.
    <<< --- We are here :-)

>>> - A random application (e.g. Firefox/Thunderbird/offlineimap) use
>>> DANE-enabled crypto library and have no clue about DNSSEC. (That is
>>> what we want, right? Just use it without modifying all
>>> crypto-enabled applications in the world!)
>>
>> It is not so simple.  The application sets trust policy, including
>> whether DANE applies, which root CAs to trust, ...  Completely
>> transparent DANE assumes no application-specific DANE-related policy,
>> this seems unlikely.

Yes, that is a problem (in a little bit different area). Generally, we want to 
move crypto/security policies from applications to system level. Current 
situation is an administrative nightmare.

The 'Vision' (highly naive, *please* do not comment on API itself but on the 
idea) is to convert (as much as possible) applications to APIs like:

open_tls_connection('hostname', port, &conn);
send_enc_data(conn &buff, len);
recv_enc_data(conn, &buff, len);
close_tls_connection(&conn);

... and separate applications from DNS/connection handling/crypto stuff. Think 
about DNSSEC + happy eyeballs + TLS. That is a lot for an application to do 
for mere connection establishment!

That will allow us to control security policy on system-wide level where it 
belongs. We already do work in this field and direction.

This is long-term goal and adding application-controlled policies for DANE 
goes in opposite direction. That is the reason why we are trying to move 
'policy logic' to system level/library level and do not pollute applications 
with policy processing. (We have to at least *try* that.)

>>> - The whole set is running on machine with plain stub-resolver
>>> without validator.
>>
>>> Result => It is completely insecure because attacker can use DANE
>>> for effective man-in-the-middle attack: The crypto library will
>>> trust to fake TLSA records because attacker send fake TLSA record
>>> with AD=1.
>>
>> Your model is too naive.  Crypto libraries should not and won't
>> set application protocol policy.  MTAs and so on, have lots of
>> knobs to enable DANE (in Postfix it is NOT on by default), and the
>> administrator is responsible for making sure the platform is suitably
>> configured before relying on DANE.
That is exactly the point. We don't want to configure everything again and 
again per-application, we want system-wide configuration.

Of course, it can't work today and there always be some special cases. MTAs 
can be one of them. You are expert in this area and I trust you.

The intent is to avoid adding more and more application specific knobs because 
it will be hard to get rid of them in future. (There are exceptions - as always.)

>>> One opinion is 'use a new shiny API for DNS and do not hack existing
>>> resolver APIs' and the other option is to 'do validation yourself'.
>>> I'm afraid that this do not belong to category 'temporary solution'.
>>
>> Postfix does neither.  The administrator sets up a trusted recursor
>> and then enables DANE.  DANE support in interactive applications
>> operated on multi-user machines by non-administrators may need to
>> know whether the stub resolver is trustworthy.  This requires
>> a new predicate in resolv.conf (or whatever).
I 100 % agree.

>>> I definitely agree that old resolver from BIND8 is "not the best"
>>> but we have to count with existing applications. It is easier to
>>> push small patches like
>>> - res_init()
>>> + res_init_trusted()
>>> It is *much much* harder to push patches rewriting code related to
>>> DNS to some completely new library. We want to add DANE support to
>>> existing applications not only to new ones.
>>
>> Yes, that's why I am recommending adoption of BSD libresolv, which
>> is a superset of the traditional libresolv, and offers more of what
>> is required to support DANE.  In particular, just having res_setservers()
>> and res_nsearch()/res_nquery would be major progress.
Again, we are not interested in a single library but in a general approach. 
Please consider that vanilla Fedora distro contains > 40 000 packages. I can 
name 5 different DNS libraries I use daily *only from top of my head*.

We want to open DNSSEC/DANE potential for all of them, not only some small subset.


Of course, this idea (nameserver whitelisting/AD bit masking) has to be widely 
adopted in rest of the ecosystem otherwise we can give it up right now. We 
don't want and can't go against the whole world.

>> Beyond that, an application interface to ask whether the system
>> list of recursors is deemed secure would be helpful.  Work with
>> the various upstream library maintainers to make that happen.
I'm glad that we agree on that. Do you have some specific proposal in your mind?
You have proposed new option in /etc/resolv.conf, something like 
resolvers_trusted = no/yes, right?

What behavior is 'the best' in your opinion? Would it be okay to always set AD 
bit to 0 if option "resolvers_trusted" is set to "no"?

Are you okay with default "no"? (If the new option is not present.)


>>> The proposed approach with a new initialization call (*for example*
>>> res_init_trusted()) have two (desired) side-effects:
>>
>> This is I think a mistake.  Without resolver contexts as with
>> res_ninit(), this applies to all resolver clients in the same
>> address space, not just the caller.  Applications are usually not
>> in a good position to define trusted recursors.  Instead of saying
>> which resolvers are trusted, they want to ask whether the default
>> resolvers *are* trustworthy.
I agree. What do you think about AD bit masking configured system-wide? Please 
keep in mind that this needs to be universal behavior implement-able even in 
old glibc resolver and any other DNS library.

>>> - It prevents an application relying on AD bit from running on old
>>> system which does not guarantee trustworthiness of the AD bit.
>>
>> There are no such legacy applications.  If you get ahead of DANE
>> adoption with suitable libraries, the applications can start directly
>> with the new plumbing.
I personally agree but please read concerns expressed by glibc maintainer below.

>>> Otherwise we would have to invent some way how to check at run-time
>>> that special handling for AD bit is supported. (Think about cases
>>> where application was compiled on newer system and somebody tries to
>>> run it on older system etc.)
>>
>> Run-time checks are required, and support for these will be missing
>> from older systems, so the code won't run there for lack of required
>> dependencies.
I'm personally okay with that.

>>> For example current software like Postfix or OpenSSH client will
>>> 'just work' without any change. AD bit will be handled in special
>>> way only if the resolver library is initialized with the new call.
>>
>> As the developer of the Postfix DANE interface, I'd rather Postfix
>> AD bit handling were subject to default system policy, and would
>> ask the administrator to set system policy accordingly.  Once APIs
>> for querying the stub-resolver behaviour (AD suppressed or trusted)
>> become widely available, Postfix will start using them to sanity
>> check its TLS policy settings (can't use DANE when stub resolver
>> suppresses AD support).
I 100 % agree with your point of view.

The problem is that our glibc maintainer explicitly refused to change default 
behavior (i.e. mask AD bit until admin white-lists given resolver in 
/etc/resolv.conf) because it could break some (potentially) existing 
applications. That is a reason why we invented "init_trusted()" concept.

Could you give us some detailed thoughts about compatibility?

I guess that we will have the same discussion about compatibility again and 
again with many upstream developers from many DNS libraries so any detailed 
analysis will be handy.

>> Today, DANE is essentially unusable.  Postfix DANE support took a
>> year of development and resulting in a new IETF draft plus proposed
>> changes that I hope will lead to DANEbis.  We're not there *today*.
Okay, let's find a way how we can move things forward on client side! :-)

Thank you very much for your time.

-- 
Petr^2 Spacek