<?xml version="1.0" encoding="UTF-8"?>
<!-- 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml' -->
<!-- vim commands to change references URLs -->
<!-- :.,$ s/iquad.central\/\~nw141292/www.sandelman.ca\/public\/rfc/ -->
<!-- :.,$ s/www.sandelman.ca\/public\/rfc/iquad.central\/\~nw141292/ -->
<!-- :.,$ s/http:\/\/www.sandelman.ca\/public\/rfc/\/home\/nw141292\/public_html/  -->
<!-- :.,$ s/\/home\/nw141292\/public_html/http:\/\/www.sandelman.ca\/public\/rfc/  -->
<!-- :.,$ s/PUBLIC ''/SYSTEM/ -->
<!-- :.,$ s/SYSTEM/PUBLIC ''/ --> encoding="US-ASCII"?>

<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
    <!ENTITY rfc2119 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
    <!ENTITY rfc2025 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2025.xml'>
    <!ENTITY rfc0854 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.0854.xml'>
    <!ENTITY rfc1035 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.1035.xml'>
    <!ENTITY rfc3008 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3008.xml'>
    <!ENTITY rfc2203 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2203.xml'>
    <!ENTITY rfc2623 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2623.xml'>
    <!ENTITY rfc3530 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3530.xml'>
    <!ENTITY rfc2478 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2478.xml'>
    <!ENTITY rfc2743 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2743.xml'>
    <!ENTITY rfc2744 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2744.xml'>
    <!ENTITY rfc1964 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.1964.xml'>
    <!ENTITY rfc2401 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2401.xml'>
    <!ENTITY rfc2408 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2408.xml'>
    <!ENTITY rfc2409 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2409.xml'>
    <!ENTITY rfc4251 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4251.xml'>
    <!ENTITY rfc4301 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4301.xml'>
    <!ENTITY rfc4306 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4306.xml'>
    <!ENTITY rfc5056 PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5056.xml'>
    <!ENTITY btns-applic PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-btns-prob-and-applic.xml'>
    <!ENTITY connection-latching PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-btns-connection-latching'>

<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>

<?rfc toc="yes" ?>
<?rfc tocindent="no" ?>
<?rfc autobreaks="no" autobreaks="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" strict="no" ?>
<?rfc rfcedstyle="yes" ?>
<?rfc strict="yes" subcompact="no" ?>

<rfc category="std" ipr="full3978" docName="draft-ietf-btns-core-07.txt"> number="XXXX" category="std">
	<title abbrev="BTNS IPsec">Better-Than-Nothing-Security: An Unauthenticated Mode of IPsec</title>
	<author initials='N.' surname="Williams" fullname='Nicolas
	    <organization abbrev="Sun">Sun Microsystems</organization>
		    <street>5300 Riata Trace Ct</street>
		    <city>Austin</city> <region>TX</region>
		    <code>78727</code> <country>US</country>
	<author initials="M." surname="Richardson" fullname="Michael C.
	    <organization abbrev="SSW">Sandelman Software
		    <street>470 Dawson Avenue</street>
        <date month="August" month="October" year="2008"/>
	<workgroup>NETWORK WORKING GROUP</workgroup>

<!--[rfced] Please insert any keywords (beyond those that appear in
    the title) for use on http://www.rfc-editor.org/rfcsearch.html. -->

	<abstract><t>This document specifies how to use the Internet Key
		Exchange (IKE) protocols, such as IKEv1 and IKEv2, to
		setup "unauthenticated" security associations (SAs) for
		use with the IPsec Encapsulating Security Payload (ESP)
		and the IPsec Authentication Header (AH).  No changes to
                IKEv2 bits-on-the-wire
		are required, but Peer Authorization Database
		(PAD) and Security Policy Database (SPD) extensions are
		specified.  Unauthenticated IPsec is herein referred to
		by its popular acronym, "BTNS" (Better Than Nothing

        <section title="Introduction">

	    <t>Here we describe how to establish unauthenticated IPsec
		SAs using IKEv2 <xref target="RFC4306"/> and
		unauthenticated public keys.  No new on-the-wire
		protocol elements are added to IKEv2.</t>

	    <t>The <xref target="RFC4301"/> processing model is

	    <t>This document does not define an opportunistic BTNS mode
		of IPsec whereby nodes may fallback to unprotected IP
		when their peers do not support IKEv2, nor does it
		describe "leap-of-faith" modes, modes or "connection

	    <t>See <xref target="I-D.ietf-btns-prob-and-applic"/> target="ProbApp"/> for
		the applicability and uses of BTNS and definitions of
		these terms.</t>

	    <t>This document describes BTNS in terms of IKEv2 and <xref
		    target="RFC4301"/>'s concepts.  There is no reason
		why the same methods cannot be used with IKEv1 <xref
		    target="RFC2408"/>, <xref target="RFC2409" /> />, and
		<xref target="RFC2401" />, />; however, those specifications
		do not include the PAD concepts, and therefore it may
		not be possible to implement BTNS on all compliant
		RFC2401 implementations.</t>

	    <section title="Conventions used Used in this document"> This Document">
		<t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
		    and "OPTIONAL" in this document are to be interpreted as
		    described in <xref target="RFC2119"/>.</t>

	<section anchor="core" title="BTNS">
	    <t>The IPsec processing model is hereby modified as follows:
		<list style='symbols'>
		    <t>A new ID type is added, 'PUBLICKEY'; added: 'PUBLICKEY'.  IDs of this
			type have public keys as values.  This ID type
			is not used on the wire.</t>

		    <t>PAD entries that match on PUBLICKEY IDs are
			referred to as "BTNS PAD entries." entries".  All other
			PAD entries are referred to as "non-BTNS PAD

		    <t>BTNS PAD entries may match on specific peer
			PUBLICKEY IDs (or public key fingerprints), fingerprints) or
			on all peer public keys.  The latter is referred
			to as the "wildcard BTNS PAD entry."</t> entry".</t>

		    <t>BTNS PAD entries MUST logically (see below)
			follow all other PAD entries (the PAD being an
			ordered list).</t>

		    <t>At most one wildcard BTNS PAD entry may appear in
			the PAD, and, if present, MUST be the last entry
			in the PAD (see below).</t>

		    <t>Any peer that uses an IKEv2 AUTH method involving
			a digital signature (made with a private key to
			a public key cryptosystem) may match a BTNS PAD
			entry, provided that it matches no non-BTNS PAD
			entries.  Suitable AUTH methods as of August
			2007 are: RSA Digital Signature (method #1) and
			DSS Digital Signature (method #3); see <xref
			    target="RFC4306"/>, section 3.8.</t>

		    <t>A BTNS capable BTNS-capable implementation of IPsec will first
			search the PAD for non-BTNS entries matching a
			peer's ID.  If no matching non-BTNS PAD entries
			are found found, then the peer's ID MUST then be
			coerced to be of 'PUBLICKEY' type with the
			peer's public key as its value and the value.  The PAD is
			then searched again for matching BTNS PAD
			entries.  This ensures that BTNS PAD entries
			logically follow non-BTNS PAD entries.  A single
			PAD search that preserves these semantics is

		    <t>A peer that matches a BTNS PAD entry is referred
			to as a "BTNS peer." peer".  Such a peer is
			"authenticated" by verifying that the signature
			in its IKEv2 AUTH payload with the public key
			from the peer's CERT payload.</t>

		    <t>Of course, if no matching PAD entry is found,
			then the IKE SA is rejected as usual.</t>

		    <t>A new flag for SPD entries: 'BTNS_OK'.  Traffic
			to/from peers that match the BTNS PAD entry will
			match only SPD entries that have the BTNS_OK
			flag set.  The SPD may be searched by address or
			by ID (of type PUBLICKEY, PUBLICKEY for BTNS peers), as
			per the IPsec processing model <xref
			    target="RFC4301"/>; searching
			    target="RFC4301"/>.  Searching by ID in this
			case requires creation of SPD entries that are
			bound to public key values (this could be used
			to build "leap-of-faith" behavior, <xref
			<xref target="lof" /> behaviour, />, for


	    <t>Nodes MUST reject IKE_SA proposals from peers that match
		non-BTNS PAD entries but fail to authenticate

	    <t>Nodes wishing to be treated as BTNS nodes by their peers
		MUST include bare public key CERT payloads.  Currently
		only bare RSA public key CERT payloads are defined,
		which means that BTNS works only with RSA public keys at
		this time (see "Raw RSA Key" in section 3.6 of <xref
		    target='RFC4306'/>).  Nodes MAY also include any
		number of certificates that bind the same public key.
		These certificates need not to have been pre-shared with
		their peers (e.g., because ephermal, self-signed).  RSA
		keys for use in BTNS may be generated at any time, but
		"connection latching" <xref
		requires that they remain constant between IKEv2
		exchanges that are used to establish SAs for latched

	    <t>To preserve standard IPsec access control semantics:

		<list style='symbols'>

		    <t>BTNS PAD entries MUST logically follow all
			non-BTNS PAD entries</t>

		    <t>the wildcard BTNS PAD entry MUST be the last
			entry in the PAD, logically</t>

		    <t>the wildcard BTNS PAD entry MUST have ID
			constraints that do not logically overlap those
			of other PAD entries.</t>



	    <t>As described above, the logical PAD ordering requirements
		can easily be implemented by searching the PAD twice at
		peer authentication time: once using the peer-asserted
		ID, and if that fails, once using the peer's public key
		as a PUBLICKEY ID.  A single pass implementation that
		meets this requirement is permitted.</t>

	    <t>The BTNS entry ID constraint non-overlap requirement can
		easily be implemented by searching the PAD twice: once
		when BTNS peers authenticate, and again when BTNS peers
		negotiate child SAs.  In the first pass the PAD is
		searched for a matching PAD entry as described above,
		and in the second it is searched to make sure that BTNS
		peers' asserted child SA traffic selectors do not
		conflict with non-BTNS PAD entries.  Single pass
		implementations that preserve these semantics are


        <section title="Usage Scenarios">
	    <t>In order to explain the above rules a number of scenarios
		will be examined.  The goal here is to persuade the reader
		that the above rules are both sufficient and

	    <t>This section is informative only.</t>

	    <figure anchor="networkdiagram" title="Reference Network Diagram">
		    To explain the scenarios a reference diagram
		    describing an example network will be used. It is
		    as follows:
                          [Q]  [R]
     AS1                   .    .              AS2
                           ......               \
                           ..PI..                ----[btns-B]
	    <t>In this diagram, there are six end-nodes: A, B, C and D.
		Two of the systems are security gateways: SG-A, SG-B,
		protecting networks on which [A] and [B] reside. There
		is a node [Q] which is IPsec and BTNS capable, and node
		[R] is a simple node, with no IPsec or BTNS capability.
		Nodes [C] and [D] are BTNS capable.</t>

	    <t>Nodes [C] and [Q] have fixed addresses.  Node [D] has a
                non-fixed address.</t>

            <t> We will examine how these various nodes communicate with
                node SG-A, and/or how SG-A rejects communications with some
                such nodes.  In the first example, we examine SG-A's point of
                view. In the second example we look at Q's point of view.
                In the third example we look at C's point of view.
	    <t>PI is the Public Internet ("The Wild").</t>

	    <section anchor="example_sgA" title="Example #1: A security gateway">
		<t>The machine that we will care in this example is [SG-A], a
		    firewall device of some kind which we wish to
		    configure to respond to BTNS connections from
		    [C]. </t>

		<t>SG-A has the following PAD and SPD entries:
		    <figure anchor="sgA_pad" title="SG-A PAD table">
                             Child SA
      Rule Remote ID        IDs allowed  SPD Search by
      ---- ---------        -----------  -------------
       1   &lt;B's ID&gt;         &lt;B's network&gt; by-IP
       2   &lt;Q's ID&gt;         &lt;Q's host&gt;     by-IP
       3   PUBLICKEY:any         ANY       by-IP
			<postamble>The last entry is the BTNS

		<t>Note that [SG-A]'s PAD entry has one and only one
		    wildcard PAD entry: the BTNS catch-all PAD entry as
                    the last entry,
		    as described in <xref target="core"/>.</t>
		<t>&lt;Child SA IDs allowed&gt; and &lt;SPD Search
		    by&gt; are from <xref target="RFC4301"/> section
		    <figure anchor="sgA_spd" title="[SG-A] SPD table">
      Rule Local Remote Next Layer BTNS  Action
            addr  addr   Protocol   ok
      ---- ----- ------ ---------- ----  -----------------------
       1   [A]    [R]      ANY      N/A  BYPASS
       2   [A]    [Q]      ANY      no   PROTECT(ESP,tunnel,AES,
       3   [A]     B-net   ANY      no   PROTECT(ESP,tunnel,AES,
       4   [A]     ANY     ANY      yes  PROTECT(ESP,transport,
		<t>The processing by [SG-A] of SA establishment attempts by various peers is as
		    <list style='symbols'>
			<t>[Q] does not match PAD entry #1, but does match
			    PAD entry #2; PAD processing stops, then the
			    SPD is searched by [Q]'s ID to find entry #2;
			    CHILD SAs are then allowed that have [SG-A]'s
			    and [Q]'s addresses as the end-point
			<t>[SG-B] matches PAD entry #1; PAD processing
			    stops, then the SPD is searched by [SG-B]'s ID
			    to find SPD entry #3; CHILD SAs are then
			    allowed that have [SG-A]'s address and any
			    addresses from B's network as the end-point
			<t>[R] does not initiate any IKE SAs; its traffic
			    to [A] is bypassed by SPD entry #1.</t>
			<t>[C] does not match PAD entries #1 or #2, but
			    does match entry #3, the BTNS wildcard PAD
			    entry; the SPD is searched by [C]'s address
			    and SPD entry #4 is matched.  CHILD SAs are
			    then allowed that have [SG-A]'s address and [C]'s
			    address as the end-point addresses provided
			    that [C]'s address is neither [Q]'s nor any of
			    [B]'s (see <xref target="core"/>).  See the
			    last bullet item below.</t>
			<t>A rogue BTNS node attempting to assert [Q]'s or
			    [B]'s addresses will either match the PAD
			    entries for [Q] or [B] and fail to authenticate
			    as [Q] or [B], in which case they are rejected,
			    or they will match PAD entry #3 but will not
			    be allowed to create CHILD SAs with [Q]'s or
			    [B]'s addresses as traffic selectors.</t>
			<t>A rogue BTNS node attempting to establish an
			    SA whereby the rogue node asserts [C]'s
			    address will succeed at establishing such an
			    SA.  Protection for [C] requires additional
			    bindings of [C]'s specific BTNS ID (that is,
			    its public key) to its traffic flows through
			    connection-latching and channel binding, or
			    leap-of-faith, none of which are described

	    <section title="Example #2: A mixed end-system ">
                <t>[Q] is an NFSv4 server.</t>
		<t>[Q] is a native IPsec implementation, and it's
                    NFSv4 implementation is IPsec-aware.</t>
		<t>[Q] wants to protect all traffic with [A]. [Q] also wants
                    to protect NFSv4 traffice with all peers. It's PAD and
		    SPD are configured as follows:
		    <figure anchor="Q_pad" title="[Q] PAD table">
                             Child SA
      Rule Remote ID        IDs allowed  SPD Search by
      ---- ---------        -----------  -------------
       1   &lt;[A]'s ID&gt;       &lt;[A]'s address&gt;  by-IP
       2   PUBLICKEY:any    ANY            by-IP
			<postamble>The last entry is the BTNS
		    <figure anchor="Q_spd" title="[Q] SPD table">
      Rule Local Remote Next Layer BTNS  Action
            addr  addr   Protocol   ok
      ---- ----- ------ ---------- ----  -----------------------
       1    [Q]    [A]     ANY      no   PROTECT(ESP,tunnel,AES,
       2    [Q]    ANY     ANY      yes  PROTECT(ESP,transport,
            with                                      integr+conf)
          port 2049
		<t>The same analysis shown above in <xref
			target="example_sgA"/> applies here with respect
		    to [SG-A], [C] and rogue peers.
                    The second SPD entry permits any BTNS capable node to
                    negotiate a port-specific SA to port 2049, the port on
                    which NFSv4 runs.
		    [SG-B] is treated as a BTNS peer as it is not known to
		    [Q], and therefore any host behind [SG-B] can access the
		    NFSv4 service on [Q]. As [Q] has no formal
		    relationship with [SG-B], rogues can impersonate
		    [B] (i.e., assert [B]'s addresses).</t>

	    <section title="Example #3: A BTNS-only system">
		<t>[C] supports only BTNS and wants to use BTNS to protect
		    NFSv4 traffic.  It's PAD and SPD are configured as
		    <figure anchor="C_pad" title="Q PAD table">
                             Child SA
      Rule Remote ID        IDs allowed  SPD Search by
      ---- ---------        -----------  -------------
       1   PUBLICKEY:any    ANY          by-IP
			<postamble>The last (and only) entry is the BTNS
		    <figure anchor="C_spd" title="SG-A SPD table">
      Rule Local Remote Next Layer BTNS  Action
            addr  addr   Protocol   ok
      ---- ----- ------ ---------- ----  -----------------------
       1    [C]    ANY      ANY      yes  PROTECT(ESP,transport,
                  with                               integr+conf)

       2    [C]    ANY      ANY      N/A  BYPASS
                <t>The analysis from <xref target="example_sgA" /> applies as follows:
		    <list style='symbols'>
			<t>Communication with [Q] on port 2049 matches
                            SPD entry number 1. This causes [C] to initiate
                            an IKEv2 exchange with [Q]. The PAD entry on [C]
                            causes it to not care what identity [Q]
                            asserts.  Further authentication (and channel
                            binding) could occur within the NFSv4 protocol.
			<t>Communication with [A], [B] or any other internet
                            machine (including [Q]), occurs in the clear,
                            so long as it is not
                            on port 2049.</t>
			<t>All analysis about rogue BTNS nodes applies, but
                           they can only assert SAs for port 2049.</t>

	    <section title="Miscellaneous comments">
		<t>If [SG-A] were not BTNS-capable then it would not have
		    PAD and SPD entries #3 and #4, respectively in example #1.  Then [C]
		    would be rejected as usual under the standard IPsec
		    model <xref
		<t>Similarly, if [Q] were not BTNS-capable then it would
		    not have PAD and SPD entries #2 in example #2.  Then [C] would be
		    rejected as usual under the standard IPsec model
		    <xref target="RFC4301"/>.</t>

        <section title="Security Considerations">
	    <t>Unauthenticated security association negotiation is
		subject to MITM attacks and should be used with
		care.  Where security infrastructures are lacking this
		may indeed be better than nothing.</t>
	    <t>Use with applications that bind authentication at
		higher network layers to secure channels at lower layers
		may provide one secure way to use unauthenticated IPsec,
		but this is not specified herein.</t>
	    <t>The BTNS PAD entry must be last and its child SA ID constraints
               must be non-overlapping with any other PAD entry, as
               described in section 2, in order to ensure that no BTNS
               peer can impersonate another IPsec non-BTNS peer. </t>

	    <section title="Connection-Latching and Channel Binding">
		<t>BTNS is subject to MITM attacks.  One way to protect
		    against MITM attacks subsequent to initial
		    communications is to use "connection latching" <xref
                    In connection latching, ULPs cooperate with IPsec
                    to bind discrete packet flows to
		    sequences of similar SAs. Connection latching requires
                    native IPsec implementations.</t>

		<t>MITMs can be detected by using application-layer
		    authentication frameworks and/or mechanisms, such as
		    the GSS-API <xref target="RFC2743"/>, with channel
		    binding <xref target="RFC5056"/>.  IPsec "channels"
		    are nothing other than latched connnections.</t>

	    <section anchor="lof" title="Leap-of-Faith (LoF) for BTNS">
		<t>"Leap of faith" is the term generally used when a
                    user accepts the assertion that a given key identifies a
		    peer on the first communication, despite a lack of strong
		    evidence for that assertion, and then remembers this association for future communications.
                    Specifically this is
		    a common mode of operation for Secure Shell <xref
			target="RFC4251"/> client. When a server
		    is encountered for the first time the Secure Shell
                    client may ask
		    the user whether to accept the server's public key.
                    If so, records the server's name (as given by the user)
                    and public key in a database.</t>

		<t>Leap of faith can work in a similar way for BTNS
		    nodes, but it is currently still being designed and
		    specified by the IETF BTNS WG.</t>
	<section title="IANA Considerations">
	    <t>This document has no IANA considerations, neither seeking
		to create new registrations nor new registries.  (The
		new ID type is not used on the wire, therefore it need
		not be assigned a number from the IANA IKEv2
		Identification Payload ID Types registry.)</t>

        <section title="Acknowledgements">
            <t>Thanks for the following reviewers: Stephen Kent</t>

	<references title="Normative References">
	    &rfc2119; &rfc4301;
	<references title="Informative References">

<reference anchor="ConnLatch">
<title>IPsec Channels: Connection Latching</title>
	<author initials="N" surname="Williams" fullname="Nicolas Williams">
<date month="April" day="14" year="2008"/>
<seriesInfo name="Work in" value="Progress"/>
<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-btns-connection-latching-07.txt"/>

	<reference anchor="ProbApp">
Problem and Applicability Statement for Better Than Nothing Security  (BTNS)
	<author initials="J" surname="Touch" fullname="Joseph Touch">
	<author initials="D" surname="Black" fullname="David Black">
	<author initials="Y" surname="Wang" fullname="Yu-Shun Wang">
<date month="July" day="8" year="2008"/>
<seriesInfo name="Work in" value="Progress"/>
<format type="TXT" target="http://www.ietf.org/internet-drafts/draft-ietf-btns-prob-and-applic-07.txt"/>