Subject: online signing draft

From: Samuel Weiler <[email-masked]>
Date: Mon, 8 Nov 2004 18:28:08 -0500 (EST)

Comments invited.

-- Sam

Internet-Draft                                               S. Weiler
                                                          SPARTA, Inc.
                                                              J. Ihren
                                                            Autonomica
                                                       30 October 2004

       Minimally Covering NSEC Records and DNSSEC On-line Signing
            draft-weiler-dnsext-dnssec-online-signing-00.txt

Status of this Memo

   This document is an Internet-Draft and is subject to all provisions
   of section 3 of RFC 3667.  By submitting this Internet-Draft, each
   author represents that any applicable patent or other IPR claims of
   which he or she is aware have been or will be disclosed, and any of
   which he or she become aware will be disclosed, in accordance with
   RFC 3668.

   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 on 30 April 2005.

Copyright Notice

   Copyright (C) The Internet Society (2004).

Abstract

   This document describes how to construct DNSSEC NSEC resource
   records that cover a smaller range of names than called for by
   [-records].  By generating and signing these records on demand,
   authoritative name servers can effectively stop the disclosure of
   zone contents otherwise made possible by walking the chain of NSEC
   records in a signed zone.

Introduction and Terminology

   With DNSSEC [-records], an NSEC record lists the next instantiated
   name in its zone, proving that no names exist in the "span" between
   the NSEC's owner name and the name in the "next name" field.  In
   this document, an NSEC record is said to "cover" the names between
   its owner name and next name.

   Through repeated queries that return NSEC records, it is possible
   to retrieve all of the names in the zone, a process commonly called
   "walking" the zone.  Some zones have policies forbidding zone
   transfers by arbitrary clients; this side-effect of the NSEC
   architecture subverts those policies.

   This document presents a way to prevent zone walking by
   constructing NSEC records that cover fewer names.  These records
   can make zone walking take approximately as many queries as simply
   asking for all possible names in a zone, making zone walking
   impractical.  Some of these records must be created and signed on
   demand, which requires on-line private keys.  Anyone contemplating
   use of this technique is strongly encouraged to review the
   discussion of the risks of on-line signing in section [Security
   Considerations].

   The technique presented here may be useful to a zone that wants to
   use DNSSEC, is concerned about exposure of its zone contents via
   zone walking, and is willing to bear the costs of on-line signing.

   The 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 RFC 2119.
   [RFC2119].

Minimally Covering NSEC Records

   This mechanism involves both changes to NSEC records for
   instantiated names, which can still be generated and signed in
   advance, as well as the on-demand generation and signing of new
   NSEC records whenever a name must be proven not to exist.

   In the 'next name' field of instantiated names' NSEC records,
   rather than list the next instantiated name in the zone, list any
   name that falls lexically after the NSEC's owner name and before
   the next instantiated name in the zone, according to the ordering
   function in [-records] section 6.2.  These NSEC records are
   returned whenever proving something specifically about the owner
   name (e.g. that no resource records of a given type appear at that
   name).

   Whenever an NSEC record is needed to prove the non-existence of a
   name, a new NSEC record is produced and signed.  The new NSEC
   record has an owner name lexically before the QNAME but lexically
   following any existing name and a "next name" lexically following
   the QNAME but before any existing name.

   The functions to generate the lexically following and proceeding
   names need not be perfect nor consistent, but the generated NSEC
   records must not cover any existing names.  Furthermore, this
   technique works better when the generated NSEC records cover very
   little of the zone's namespace.

   For example, a query for the non-instantiated name example.com
   might produce the following NSEC record:

      exampld.com 3600 IN NSEC example-.com ( RRSIG NSEC )

   Before answering a query with this record, an authoritative server
   must test for the existence of names between these endpoints.  If
   the generated NSEC would cover existing names (e.g. exampldd.com),
   a better increment or decrement function may be used or the covered
   name closest to the QNAME could be used as the NSEC owner name or
   next name, as appropriate.  If an existing name is used as the NSEC
   owner name, that name's real NSEC record MUST be returned.  Using
   the same example, assuming an exampldd.com delegation exists, this
   record might be returned from the parent:

      exampldd.com 3600 IN NSEC example-.com ( NS DS RRSIG NSEC )

   Like every authoritative record in the zone, each generated NSEC
   record MUST have corresponding RRSIGs generated using each
   algorithm (but not necessarily each DNSKEY) in the zone's DNSKEY
   RRset, as described in [-protocol] section 2.2.  To minimize the
   number of signatures that must be generated, a zone may wish to
   limit the number of algorithms in its DNSKEY RRset.

Better Increment & Decrement Functions

   Section 6.2 of [-records] defines a strict ordering of DNS names.
   Working backwards from that definition, it should be possible to
   define increment and decrement functions that generate the
   immediately following and preceeding names, respectively.  This
   document does not define such functions.  Instead, this section
   presents functions that come reasonably close to the perfect ones.
   As described above, an authoritative server MUST ensure than no
   generated NSEC covers any existing name.

   To increment a name, add a leading label with a single null octet.

   To decrement a name, decrement the last character of the leftmost
   label, then fill that label to a length of 63 octets with octets of
   value 255.  To decrement a null octet, remove the octet -- if an
   empty label is left, remove the label.  Defining this function
   numerically: fill the left-most label to its maximum length with
   zeros (numeric, not ASCII zeros) and subtract one.

   In response to a query for the non-existent name foo.example.com,
   these functions produce an NSEC record of:

      fon\255\255\255\255\255\255\255\255\255\255\255\255\255\255
      \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255
      \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255
      \255\255\255\255\255\255\255\255\255\255\255\255\255\255\255
      \255.example.com 3600 IN NSEC \000.foo.example.com ( NSEC RRSIG )

   Both of these functions are imperfect: they don't take into account
   constraints on number of labels in a name nor total length of a
   name.

IANA Considerations

   This document has no IANA Actions.

Security Considerations

   This approach requires on demand generation of RRSIG records.  This
   creates several new vulnerabilities.

   First, on demand signing requires that a zone's authoritative
   servers have access to its private keys.  Storing private keys on
   well-known internet-accessible servers may make them more
   vulnerable to unintended disclosure.

   Second, since generation of public key signatures tends to be
   computationally demanding, the requirement for on demand signing
   makes authoritative servers vulnerable to a denial of service
   attack.

   Lastly, if the increment and decrement functions are predictable,
   on-demand signing may enable a chosen-plaintext attack on a zone's
   private keys.  Zones using this approach should attempt to use
   cryptographic algorithms that are resistant to chosen-plaintext
   attacks.  It's worth noting that while DNSSEC has a "mandatory to
   implement" algorithm, that is a requirement on resolvers and
   validators -- there is no requirement that a zone be signed with
   any given algorithm.  If any "mandatory to implement" algorithm is
   found to be particularly vulnerable to chosen plaintext attack, a
   zone may which to switch to another algorithm or use less
   predictable increment and decrement function.

   The success of using minimally covering NSEC record to prevent zone
   walking depends greatly on the quality of the increment and
   decrement functions chosen.  An increment function that chooses a
   name obviously derived from the next instantiated name may be
   easily reverse engineered, destroying the value of this technique.
   An increment function that always returns a name close to the next
   instantiated name is likewise a poor choice.  A good choice of
   increment and decrement functions are the ones that produce the
   immediately following and preceeding names, respectively, though
   zone administrators may wish to use less perfect functions that
   return more human-friendly names than the functions described in
   section X above.

   Another obvious but misguided concern is the danger from
   synthesized NSEC records being replayed.  It's possible for an
   attacker to replay an old but still validly signed NSEC record
   after a new name has been added in the span covered by that NSEC,
   incorrectly proving that there is no record at that name.  This
   danger exists with DNSSEC as defined in [-bis].  The techniques
   described here actually decrease the danger, since the span covered
   by any NSEC record is smaller than before.  Choosing better
   increment and decrement functions will further reduce this danger.

Normative References

   (out of date versions)
   [I-D.ietf-dnsext-dnssec-intro]
              Arends, R., Austein, R., Larson, M., Massey, D. and S.
              Rose, "DNS Security Introduction and Requirements",
              draft-ietf-dnsext-dnssec-intro-10 (work in progress),
              May 2004.

   [I-D.ietf-dnsext-dnssec-records]
              Arends, R., Austein, R., Larson, M., Massey, D. and S.
              Rose, "Resource Records for DNS Security Extensions",
              draft-ietf-dnsext-dnssec-records-08 (work in progress),
              May 2004.

   [I-D.ietf-dnsext-dnssec-protocol]
              Arends, R., Austein, R., Larson, M., Massey, D. and S.
              Rose, "Protocol Modifications for the DNS Security
              Extensions", draft-ietf-dnsext-dnssec-protocol-06 (work
              in progress), May 2004.

Acknowledgements

   Many individuals contributed to this design.  They include, in
   addition to the authors of this document, Olaf Kolkman, Ed Lewis,
   Peter Koch, Matt Larson, David Blacka, Suzanne Woolf, Jaap
   Akkerhuis, Jakob Schlyter, Bill Manning, and Joao Damas.

Authors' Addresses

   Samuel Weiler
   SPARTA, Inc.
   7075 Samuel Morse Drive
   Columbia, MD 21046
   USA

   EMail: [email-masked]

   Johan Ihren
   Autonomica
   Bellmansgatan 30
   SE-118 47 Stockholm, Sweden
   Mail: [email-masked]

--
to unsubscribe send a message to [email-masked] with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/namedroppers/>

---

From: Ben Laurie <[email-masked]>
Date: Tue, 09 Nov 2004 16:02:41 +0000

> Better Increment & Decrement Functions

Geoff and I have been working on a rigorous definition of these, which I 
hope he'll post later today.

Cheers,

Ben.

---

From: [email-masked] (Geoffrey Sisson)
Date: Thu, 11 Nov 2004 09:54:03 +0000 (GMT)

> hope he'll post later today.

Now available at:

    http://www.panix.com/~geoff/draft-sisson-dnsext-dns-name-p-s-00.txt

Regards

Geoff

---

From: "Niall O'Reilly" <[email-masked]>
Date: Sat, 13 Nov 2004 21:42:31 +0000

>     http://www.panix.com/~geoff/draft-sisson-dnsext-dns-name-p-s-00.txt

IMO, a refinement to the notation

     " non-printable octet values are expressed as three-digit octal
       numbers preceded by a backslash "

allowing a decimal repeat count in parens between the backslash and the
first of the three octal digits would immensely enhance readability. As
a consequence, any unwittingly-introduced errors would be more easily
noticed.

For example, in the first example in section 5.1,

       x' = \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377.\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377.\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377.fon\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\
            \377\377\377\377\377\377\377\377\377\377\377\377\377\377.exa\
            mple.com.

could then be represented as

       x' = \(50)377.\(63)377.\(63)377.fon\(60)377.example.com.

if I've counted all those octal-encoded octets correctly.

Best regards,

Niall O'Reilly

PGP key ID: AE995ED9 (see www.pgp.net)
Fingerprint: 23DC C6DE 8874 2432 2BE0 3905 7987 E48D AE99 5ED9

---

From: Andras Salamon <[email-masked]>
Date: Sun, 14 Nov 2004 13:32:08 +0200

On Mon, Nov 08, 2004 at 06:28:08PM -0500, Samuel Weiler wrote:
>    impractical.

Let n(Z) be the size of zone Z, f(Z) be the number of queries typically
generated by a brute force enumeration of zone Z, and k(Z) be the number
of enumerations sought each day by people trying to enumerate zone Z,
and we have been told previously that k(Z) is likely to be a number in
the hundreds (if not more).  Usually f(Z) >> n(Z).

With online-signing-00, we are then back to O(f(Z)*k(Z)) daily queries
being sent to name servers authoritative for zones Z, just like today.

However, today without DNSSEC each query costs O(1) time to generate and
O(1+log n(Z)) time to answer.  With online signing, we still have each
query costing time O(1) but answers now costing O(q+1+log n), where q is
a constant dependent on the length of the encryption key and the server's
crypto hardware accelerator.  As far as I can tell, this is at least
an order of magnitude more work for the servers, given usual values of
the constant q.  This breaks requirement 15 (minimisation of asymmetry)
in signed-nonexistence-requirements-00.

Given requirement 15, shouldn't we also revisit increasing the time on
the _query_ side of DNSSEC, so each query takes time O(q) to generate
and process?

As far as I can see, there will always be asymmetry if one can make a
trivial distinction between positive and negative answers.  After all,
an enumerator isn't interested in verifying signatures on responses.
Precomputed NSEC records are a way to keep the server side cost down to
O(1), but allow enumeration if there are only O(n(Z)) precomputed records,
or otherwise require infeasibly large space, approaching f(Z).

In DNSSEC-ter, could we not drop this distinction, and instead always
return responses to queries, accompanied by indicator records which
have to be decrypted to determine if the response is actually a dummy?
These records would indicate whether the response is a dummy, and if
not they would serve the same function as NSEC records.

A www.example.com? ->
www.example.com. A 10.0.0.1
                 ISEC <encrypted indicator, null>

A wwx.example.com? ->
wwx.example.com. A 127.0.1.2
                 ISEC <encrypted indicator, cf. NSEC>

However, I don't yet see how in the above scheme responses could be chosen
to always be "harmless" without being identifiable by an enumerator as
being negative responses (eg. IPv4 addresses in the block 127/8 as above).

The other alternative seems to be to find a way to generate and store
at least O([n(Z)]^2) precomputed signed NSEC responses.  For zones with
1m domain names, this doesn't seem feasible either.

-- Andras Salamon                   [email-masked]

---

From: Alex Bligh <[email-masked]>
Date: Sun, 14 Nov 2004 13:32:44 +0000

--On 14 November 2004 13:32 +0200 Andras Salamon <[email-masked]> wrote:

> crypto hardware accelerator.

Actually a ratio of that constant to the processor time to do a lookup.
IE as its O() it depends on the relative speed of lookups to crypto.

> As far as I can tell, this is at least
> the constant q.

As you say, depends on q and log n, but yes.

> This breaks requirement 15 (minimisation of asymmetry)

Yes. The other side of the same coin is it is trivial to perform an
effective denial of service attack by querying random QNAMEs. Whilst
one might chose to drop ones that don't (say) have LNH composition
in high load environments, zones are normally sufficiently sparse
that it would be possible to generate unique (i.e. uncachable
authoritative server side) queries that are distinctly plausible.
For instance, 6 letter strings have over 10^10 combinations, and
[consonant][vowel][consonant][vowel][consonant][vowel]
[consonant][vowel][consonant][vowel][consonant][vowel][consonant]
has over 10^13 combinations.

Cycling through those from sufficient parallelized zombies will,
I would have thought, saturate any crypto processor. Whilst it's
possible to start dropping synthetic NSECs (apparently acceptable
to some as "authenticated denial is less important" - to them), that's
a ridiculous argument as you might as well just go with opt-in if
that were the case and drop the crypto processor requirements and
script kiddie opportunity.

> the _query_ side of DNSSEC, so each query takes time O(q) to generate

That assume that the solution you want on the resolver side does have an
element that takes O(q) time to process! Whilst the latter is possible, I'm
not sure it is desirable, not least because of the asymmetry problem. I'm
not sure whether you are just suggesting this as a straw man, but saying
we'll make all queries more resource intensive, because by only making
minimal changes to the protocol we've been left with making some responses
more resource intensive, and otherwise there will be asymmetry, to me
suggests that we have to look beyond minimal changes to the protocol.

>                  ISEC <encrypted indicator, cf. NSEC>

Perhaps I am missing something here, but now rather than do f(Z) cheap
queries, does the attacker not instead have to do n(Z) expensive queries?
(i.e. he can work his way through the zone by enumeration, but has to
decrypt each answer). Assuming the decryption is about as hard as the
online signing, and f(Z) >> n(Z) (as you yourself posit), doesn't this make
the job rather easier for the attacker?

Alex

---

From: [email-masked] (Geoffrey Sisson)
Date: Sun, 14 Nov 2004 14:41:00 +0000 (GMT)

Niall O'Reilly <[email-masked]> writes:

> first of the three octal digits would immensely enhance readability.

. . .

>        x' = \(50)377.\(63)377.\(63)377.fon\(60)377.example.com.

I'd considered using something similar to regexp notation to represent
the examples, e.g.:

	x' = \377{50}.\377{63}.\377{63}.fon\377{60}.example.com.

. . . but was reluctant to lose the `tangibility' of the unabridged
examples.  Your suggestion makes me think that the draft probably
should have both; I'll change this in -01.

Regards

Geoff

---

From: Andras Salamon <[email-masked]>
Date: Mon, 15 Nov 2004 11:56:48 +0200

On Sun, Nov 14, 2004 at 01:32:44PM +0000, Alex Bligh wrote:
> not sure it is desirable, not least because of the asymmetry problem.

It seems the way to fix asymmetry is either to reduce the server side
time, or to increase the resolver side time: so why is increasing resolver
side time not desirable?

> I'm

I'm struggling to follow your reasoning here.

I was trying to look at _how_ the resolver side could be made to incur
O(q) time, without mandating major changes to resolvers which are
uninterested in the additional DNSSEC information.

Overall, I am tending toward your conclusion that major protocol changes
may be required if asymmetry is to be avoided.  The one solution I put
forward relies on returning RRs for non-existent domain names, which
seems to lead to unsafe values being returned, or otherwise allows
trivial recognition.  The other solution would require a very large
number of precomputed signed negative answers.  There may be other,
smarter ways of going forward.

Any further ideas for solving the asymmetry problem, or for rigorously
showing it can't be solved while keeping backward compatibility?

> queries, does the attacker not instead have to do n(Z) expensive queries?

I should have explicitly mentioned that I was thinking of epsilon
semantics for NSEC records when I wrote the above, ie. f(Z) expensive
queries would be required.

---

From: Alex Bligh <[email-masked]>
Date: Mon, 15 Nov 2004 12:13:24 +0000

Andras,

>> element that takes O(q) time to process! Whilst the latter is possible,
>> I'm not sure it is desirable, not least because of the asymmetry problem.
>

Because reducing asymmetry is not the only objective. Having a protocol
that requires minimal CPU both ends would be ideal. (Reductio ad
absurdum: make name resolution NP-Complete both ends).

>> minimal changes to the protocol we've been left with making some
>> responses more resource intensive, and otherwise there will be
>> asymmetry, to me suggests that we have to look beyond minimal changes to
>> the protocol.
>

May be I misunderstood your changes - I thought you were proposing
in essence that resolvers needed to decrypt replies? That's a pretty
major change to resolvers isn't it?

I guess what I am saying is that IF, in order to support something
like NSEC-epsilon, we need to make major changes to the resolvers
to prevent asymmetry (which make them slower), THEN we should be
questioning whether or not NSEC epsilon is the right solution,
because we can, with the same degree or lesser degree of intrusiveness
both server side and resolver side, produce a solution that does
not have asymmetry properties, and moreover avoids asymmetry by making
the server faster rather than the resolver slower.

> Any further ideas for solving the asymmetry problem,

hashed NSEC' (arguably there is mild asymmetry here in terms of
hash lookups, but probably no greater than say UDP checksum
on inbound packets - a calculation which an attacker could simplify
knowing how his packets change byte by byte).

> or for rigorously

I am thinking about that, but I think proving that in a rigorous
sense may be hard.

> queries would be required.

Doh! My bad.

Alex

---

From: "Niall O'Reilly" <[email-masked]>
Date: Tue, 16 Nov 2004 17:08:55 +0000

>     http://www.panix.com/~geoff/draft-sisson-dnsext-dns-name-p-s-00.txt

in which may be found the following text.

>    3.  If the least significant (right-most) octet in the least
>        significant (left-most) label is the minimum sort value, remove
>        that octet; otherwise decrement the value of the octet, skipping
>        any values which correspond to upper-case US-ASCII letters, and
>        then append the label with as many octets as possible of the
>        maximum sort value.  In either case, continue to the next step.

I think there's one other special character you have to guard against!

>        ... skipping
>        any values which correspond either to upper-case US-ASCII 
> letters
>        or to the dot (\056), and ...

/Niall

---

From: Edward Lewis <[email-masked]>
Date: Tue, 16 Nov 2004 12:35:57 -0500

>>         or to the dot (\056), and ...

I couldn't find the source of the included text...are you saying that 
"." can't be in a label?

(It can.  Needs to be escaped in text format, no problem in wire format.)
-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Edward Lewis                                            +1-571-434-5468
NeuStar

I would have been at the meeting, but I was busy raking the leaves from
the (now) empty non-terminals in my yard.

---

From: "Niall O'Reilly" <[email-masked]>
Date: Tue, 16 Nov 2004 21:40:05 +0000

On 16 Nov 2004, at 17:35, Edward Lewis wrote:

> are you saying that "." can't be in a label?
>

I was.  Thanks for the correction.

/Niall

---

From: Alex Bligh <[email-masked]>
Date: Wed, 17 Nov 2004 19:07:34 +0000

> I was.  Thanks for the correction.

Heh you can even have "*" and NULL :-)

Alex