One document matched: draft-ietf-netconf-rfc4742bis-07.xml
<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY netconf PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-netconf-4741bis.xml'>
<!ENTITY rfc5234 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5234.xml'>
<!ENTITY sshconn PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4254.xml'>
<!ENTITY sshtrans PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4253.xml'>
<!ENTITY sshauth PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4252.xml'>
<!ENTITY sshnum PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4250.xml'>
<!ENTITY rfc2119 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY rfc2629 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2629.xml'>
]>
<?rfc toc="yes"?>
<?rfc tocompact="yes"?>
<?rfc tocdepth="6"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<rfc ipr="trust200902" obsoletes="4742" category="std" docName="draft-ietf-netconf-rfc4742bis-07.txt">
<front>
<title abbrev="NETCONF over SSH">Using the NETCONF Configuration Protocol over Secure Shell (SSH)</title>
<author initials="M." surname="Wasserman" fullname="Margaret Wasserman">
<organization>Painless Security, LLC</organization>
<address>
<postal>
<street>356 Abbott Street</street>
<city>North Andover</city> <region>MA</region>
<code>01845</code>
<country>USA</country>
</postal>
<phone>+1 781 405-7464</phone>
<email>mrw@painless-security.com</email>
<uri>http://www.painless-security.com</uri>
</address>
</author>
<author fullname="Ted Goddard" initials="T." surname="Goddard">
<organization>ICEsoft Technologies, Inc.</organization>
<address>
<postal>
<street>Suite 300, 1717 10th St. NW</street>
<city>Calgary</city> <region>AB</region>
<code>T2M 4S2</code>
<country>Canada</country>
</postal>
<phone>+1 403 663-3322</phone>
<email>ted.goddard@icesoft.com</email>
<uri>http://www.icesoft.com</uri>
</address>
</author>
<date month="February" year="2011" />
<area>Operations and Management</area>
<workgroup>Network Working Group</workgroup>
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<keyword>XML</keyword>
<keyword>Extensible Markup Language</keyword>
<keyword>configuration</keyword>
<keyword>xmlconf</keyword>
<keyword>netconf</keyword>
<abstract>
<t>
This document describes a method for invoking and running the NETCONF
protocol within a Secure Shell (SSH) session as an SSH subsystem.
</t>
</abstract>
</front>
<middle>
<section title="Introduction">
<t>
The NETCONF protocol <xref target="I-D.ietf-netconf-4741bis"/> is an
XML-based protocol used to manage the configuration of networking
equipment. NETCONF is defined to be session-layer and transport
independent, allowing mappings to be defined for multiple
session-layer or transport protocols. This document defines how
NETCONF can be used within a Secure Shell (SSH) session, using the SSH
connection protocol <xref target="RFC4254"/> over the SSH transport
protocol <xref target="RFC4253"/>. This mapping will allow NETCONF to be
executed from a secure shell session by a user or application.
</t>
<t>
Although this document gives specific examples of how NETCONF messages
are sent over an SSH connection, use of this transport is not
restricted to the messages shown in the examples below. This
transport can be used for any NETCONF message.
</t>
</section>
<section title="Requirements Terminology">
<t>
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 <xref
target="RFC2119"/>.
</t>
</section>
<section title="Starting NETCONF over SSH">
<t>
To run NETCONF over SSH, the SSH client will first establish an SSH
transport connection using the SSH transport protocol, and the
SSH client and SSH server will exchange keys for message integrity and
encryption. The SSH client will then invoke the "ssh-userauth" service
to authenticate the user, as described in the SSH authentication
protocol <xref target="RFC4252"/>. Once the user
has been successfully authenticated, the SSH client will invoke the
"ssh-connection" service, also known as the SSH connection
protocol.
</t>
<t>
How the NETCONF Server extracts the SSH user name from the SSH layer
is implementation-dependent.
</t>
<t>
After the ssh-connection service is established, the SSH client will open
a channel of type "session", which will result in an SSH session.
</t>
<t>
Once the SSH session has been established, the NETCONF client will
invoke NETCONF as an SSH subsystem called "netconf". Subsystem
support is a feature of SSH version 2 (SSHv2) and is not included in
SSHv1. Running NETCONF as an SSH subsystem avoids the need for the
script to recognize shell prompts or skip over extraneous information,
such as a system message that is sent at shell start-up.
</t>
<t>
In order to allow NETCONF traffic to be easily identified and filtered
by firewalls and other network devices, NETCONF servers MUST default
to providing access to the "netconf" SSH subsystem only when the SSH
session is established using the IANA-assigned TCP port 830.
Servers SHOULD be configurable to allow access to the netconf SSH
subsystem over other ports.
</t>
<t>
A user (or application) could use the following command line to invoke
NETCONF as an SSH subsystem on the IANA-assigned port:
</t>
<figure>
<artwork>
<![CDATA[
[user@client]$ ssh -s server.example.org -p 830 netconf]]>
</artwork>
</figure>
<t>
Note that the -s option causes the command ("netconf") to be invoked
as an SSH subsystem.
</t>
<section title="Capabilities Exchange">
<t>
The NETCONF server MUST indicate its capabilities by sending an XML
document containing a <hello> element as soon as the NETCONF session
is established. The NETCONF client can parse this message to
determine which NETCONF capabilities are supported by the NETCONF
server.
</t>
<t>
The NETCONF client must also send an XML document containing a
<hello> element to indicate the NETCONF client's capabilities to the
NETCONF server. The document containing the <hello> element
MUST be the first XML document that the NETCONF client sends after the NETCONF
session is established.
</t>
<t>
The following example shows a capability exchange. Data sent by the
NETCONF client are marked with "C:" and data sent by the NETCONF
server are marked with "S:".
</t>
<figure>
<artwork>
<![CDATA[
S: <?xml version="1.0" encoding="UTF-8"?>
S: <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
S: <capabilities>
S: <capability>
S: urn:ietf:params:xml:ns:netconf:base:1.1
S: </capability>
S: <capability>
S: urn:ietf:params:ns:netconf:capability:startup:1.0
S: </capability>
S: </capabilities>
S: <session-id>4<session-id>
S: </hello>
S: ]]>]]>]]>
<![CDATA[
C: <?xml version="1.0" encoding="UTF-8"?>
C: <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
C: <capabilities>
C: <capability>
C: urn:ietf:params:xml:ns:netconf:base:1.1
C: </capability>
C: </capabilities>
C: </hello>
C: ]]>]]>]]>
</artwork>
</figure>
<t>
Although the example shows the NETCONF server sending a <hello>
message followed by the NETCONF client's <hello> message, both
sides will send the message as soon as the NETCONF subsystem is
initialized, perhaps simultaneously.
</t>
</section>
</section>
<section title="Using NETCONF over SSH">
<t>
A NETCONF over SSH session consists of a NETCONF client and NETCONF server
exchanging complete XML documents. Once the session has been
established and capabilities have been exchanged, the
NETCONF client will send complete XML documents containing
<rpc> elements to the server, and the NETCONF server will respond with complete XML
documents containing <rpc-reply> elements.
</t>
<section title="Framing protocol">
<t>
The previous version of this document defined the character sequence
"]]>]]>" as a message separator, under the assumption
that it could not be found in well-formed XML documents. However,
this assumption is not correct. It can legally appear in XML
attributes, comments, and processing instructions. In order to solve
this problem, and at the same time be compatible with existing
implementations, this document defines the following framing protocol.
</t>
<t>
The <hello> message MUST be followed by the character sequence
]]>]]>. Upon reception of the <hello> message, the
receiving peer's SSH Transport layer conceptually passes the <hello>
message to the Messages layer. If the :base:1.1 capability is
advertised by both peers, the chunked transfer mechanism (see Section
4.2) is used for the remainder of the NETCONF session. Otherwise,
the old end-of-message based mechanism (see Section 4.3) is used.
</t>
</section>
<section title="Chunked Framing Mechanism">
<t>
This mechanism encodes all NETCONF messages with a chunked
framing. Specifically, the message follows the ABNF
<xref target="RFC5234"/> rule Chunked-Message:
</t>
<figure>
<artwork>
<![CDATA[
Chunked-Message = 1*chunk
end-of-chunks
chunk = LF HASH chunk-size LF
chunk-data
chunk-size = 1*DIGIT1 0*DIGIT
chunk-data = 1*OCTET
end-of-chunks = LF HASH HASH LF
DIGIT1 = %x31-39
DIGIT = %x30-39
HASH = %x23
LF = %x0A
OCTET = %x00-FF
]]>
</artwork>
</figure>
<t>
The chunk-size field is a string of decimal digits indicating the
number of octets in chunk-data. Leading zeros are prohibited, and
the maximum allowed chunk-size value is 4294967295.
</t>
<t>
As an example, the message:
</t>
<figure>
<artwork>
<![CDATA[
<rpc message-id="102"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<close-session/>
</rpc>
]]>
</artwork>
</figure>
<t>
could be encoded as (using '\n' as a visible representation of the
LineFeed character):
</t>
<figure>
<artwork>
<![CDATA[
C: \n#4\n
C: <rpc
C: \n#18\n
C: message-id="102"\n
C: \n#79\n
C: xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">\n
C: <close-session/>\n
C: </rpc>
C: \n##\n
]]>
</artwork>
</figure>
<t>
Conceptually, the SSH Transport layer encodes messages sent by the
Messages layer, and decodes messages received on the SSH channel
before passing them to the Messages layer.
</t>
<t>
In the second and third chunks quoted above, each line is terminated
by a LineFeed. For all the XML lines (except the last one), this
example treats the LineFeed as part of the chunk-data and so
contributing to the chunk-size. Note that there is no LineFeed
character after the <rpc> end tag in this message. The LineFeed
required by the start of the end-of-chunks block immediately follows
the last '>' character in the message.
</t>
<t>
If an error occurs during the decoding process, the peer MUST
terminate the NETCONF session by closing the corresponding SSH
channel.
</t>
</section>
<section title="End-of-message Framing Mechanism">
<t>
This mechanism exists for backwards compatibility with implementations
of previous versions of this document. It is only used when the
remote peer does not advertise a base protocol version supporting
chunked encoding, i.e. a NETCONF implementation only supporting
:base:1.0.
</t>
<t>
When this mechanism is used, the special character sequence ]]>]]>,
MUST be sent by both the NETCONF client and the NETCONF server after
each message (XML document) in the NETCONF exchange. Conceptually, the
SSH Transport layer passes any data found in between the ]]>]]>
characters to the Messages layer.
</t>
<t>
A NETCONF over SSH session, using the backwards-compatible
end-of-message framing, to retrieve a set of configuration information
might look like this:
</t>
<figure>
<artwork>
<![CDATA[
C: <?xml version="1.0" encoding="UTF-8"?>
C: <rpc message-id="105"
C: xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
C: <get-config>
C: <source><running/></source>
C: <config xmlns="http://example.com/schema/1.2/config">
C: <users/>
C: </config>
C: </get-config>
C: </rpc>
C: ]]>]]>]]>
<![CDATA[
S: <?xml version="1.0" encoding="UTF-8"?>
S: <rpc-reply message-id="105"
S: xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
S: <config xmlns="http://example.com/schema/1.2/config">
S: <users>
S: <user><name>root</name><type>superuser</type></user>
S: <user><name>fred</name><type>admin</type></user>
S: <user><name>barney</name><type>admin</type></user>
S: </users>
S: </config>
S: </rpc-reply>
S: ]]>]]>]]>
</artwork>
</figure>
</section>
</section>
<section title="Exiting the NETCONF Subsystem">
<t>
Exiting NETCONF is accomplished using the <close-session> operation.
A NETCONF server will process NETCONF messages from the NETCONF client
in the order in which they are received. When the NETCONF server
processes a <close-session> operation, the NETCONF server SHALL
respond and close the SSH session channel. The NETCONF server MUST
NOT process any NETCONF messages received after the <close-session>
operation.
</t>
<t>
To continue the example used in section 4.2, an existing NETCONF
subsystem session could be closed as follows:
</t>
<figure>
<artwork>
<![CDATA[
C: \n#140\n
C: <?xml version="1.0" encoding="UTF-8"?>\n
C: <rpc message-id="106"\n
C: xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">\n
C: <close-session/>\n
C: </rpc>
C: \n##\n
S: \n#139\n
S: <?xml version="1.0" encoding="UTF-8"?>\n
S: <rpc-reply id="106"\n
S: xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">\n
S: <ok/>\n
S: </rpc-reply>
S: \n##\n
]]>
</artwork>
</figure>
</section>
<section title="Security Considerations">
<t>
NETCONF is used to access configuration and state information and to
modify configuration information, so the ability to access this
protocol should be limited to users and systems that are authorized to
view the NETCONF server's configuration and state or to modify the
NETCONF server's configuration.
</t>
<t>
The identity of the SSH server MUST be verified and authenticated by the
SSH client according to local policy before password-based authentication
data or any configuration or state data is sent to or received from
the SSH server. The identity of the SSH client MUST also be verified and
authenticated by the SSH server according to local policy to ensure that
the incoming SSH client request is legitimate before any configuration or
state data is sent to or received from the SSH client. Neither side
should establish a NETCONF over SSH connection with an unknown,
unexpected or incorrect identity on the opposite side.
</t>
<t>
Configuration or state data may include sensitive information, such as
usernames or security keys. So, NETCONF should only be used over
communications channels that provide strong encryption for data
privacy. This document defines a NETCONF over SSH mapping which
provides for support of strong encryption and authentication.
</t>
<t>
This document requires that SSH servers default to allowing access to
the "netconf" SSH subsystem only when using a specific TCP port
assigned by IANA for this purpose. This will allow NETCONF over SSH
traffic to be easily identified and filtered by firewalls and other
network nodes. However, it will also allow NETCONF over SSH traffic
to be more easily identified by attackers.
</t>
<t>
This document also recommends that SSH servers be configurable to allow
access to the "netconf" SSH subsystem over other ports. Use of that
configuration option without corresponding changes to firewall or
network device configuration may unintentionally result in the ability
for nodes outside of the firewall or other administrative boundary
to gain access to "netconf" SSH subsystem.
</t>
<t>
RFC 4742 assumes that the EOM sequence, ]]>]]>, cannot appear in any
well-formed XML document, which turned out to be mistaken. The EOM
sequence can cause operational problems and open space for attacks if
sent deliberately in RPC messages. It is however believed that the
associated threat is not very high. This document still uses the EOM
sequence for the initial <hello> message to avoid
incompatibility with existing implementations. When both peers
implement base:1.1 capability, a proper framing protocol (Chunked
Framing Mechanism, see Section 4.2) is used for the rest of the
NETCONF session, to avoid injection attacks.
</t>
</section>
<section title="IANA Considerations">
<t>
Based on the previous version of this document, RFC 4742, IANA
assigned port 830 as the default port for NETCONF over SSH sessions.
</t>
<t>
IANA has also assigned "netconf" as an SSH Subsystem Name, as defined
in <xref target="RFC4250"/>, as follows:
</t>
<figure>
<artwork>
<![CDATA[
Subsystem Name Reference
-------------- ---------
netconf RFC 4742
]]>
</artwork>
</figure>
<t>
IANA is requested to update these allocations to reference this document
when it is published as an RFC.
</t>
</section>
<section title="Acknowledgements">
<t>
This document was written using the xml2rfc tool described in RFC 2629
<xref target="RFC2629"/>.
</t>
<t>
Extensive input was received from the other members of the NETCONF
design team, including: Andy Bierman, Weijing Chen, Rob Enns, Wes
Hardaker, David Harrington, Eliot Lear, Simon Leinen, Phil Shafer,
Juergen Schoenwaelder and Steve Waldbusser. The following people have
also reviewed this document and provided valuable input: Olafur
Gudmundsson, Sam Hartman, Scott Hollenbeck, Bill Sommerfeld, Balazs
Lengyel, Bert Wijnen, Mehmet Ersue, Martin Bjorklund, Lada Lothka, Ken
Watson, and Tom Petch.
</t>
</section>
<section title="Change Log">
<t>
[RFC Editor: Please remove this section before publication as an RFC.]
</t>
<section title="Changes from RFC4742bis-05 to RFC4742-bis-06">
<t>
<list style="symbols">
<t>Updated chunked encoding to include location of
new lines.</t>
<t>Updated examples to show new chunked encoding properly.</t>
<t>Minor editorial fixes. </t>
</list>
</t>
</section>
<section title="Changes from RFC4742bis-04 to RFC4742-bis-05">
<t>
<list style="symbols">
<t>Added option for chunked encoding.</t>
<t>Added 1.1 capability to enable chunked encoding. </t>
</list>
</t>
</section>
<section title="Changes from RFC4742bis-03 to RFC4742-bis-04">
<t>
<list style="symbols">
<t>Shortened text about EOM sequence.</t>
<t>Added text to Security Considerations about EOM issues.</t>
</list>
</t>
</section>
<section title="Changes from RFC4742bis-02 to RFC4742-bis-03">
<t>
<list style="symbols">
<t>Added intended status and "obsoletes" to headers.</t>
<t>Very minor editorial changes.</t>
</list>
</t>
</section>
<section title="Changes from RFC4742bis-01 to RFC4742-bis-02">
<t>
<list style="symbols">
<t>Removed unneeded wording about client/server, made
unnecessary by previous changes.</t>
<t>Stated that how a server extracts the SSH user name is
implementation-dependent.</t>
<t>Further fixes to operation/message/data wording.</t>
</list>
</t>
</section>
<section title="Changes from RFC4742bis-00 to RFC4742-bis-01">
<t>
<list style="symbols">
<t>Changed use of client/server, manager/agent to SSH client/server
and NETCONF client/server. </t>
<t>Consistently used term operation, instead of command or
message.</t>
<t>Clarified some sections based on review feedback.</t>
<t>Fixed several typos.</t>
</list>
</t>
</section>
<section title="Changes from RFC4742 to RFC4742bis-00">
<t>
<list style="symbols">
<t>Integrated previously-approved errata from
http://rfc-editor.org/errata_search.php?rfc=4742</t>
<t>Removed text requiring implementations to skip to an
XML start directive at the beginning of a session.</t>
<t>Made it clear the ]]>]]> is illegal in XML documents
only outside of comments.</t>
</list>
</t>
</section>
</section>
</middle>
<back>
<references title="Normative References">
&netconf;
&sshconn;
&sshtrans;
&sshauth;
&rfc2119;
&sshnum;
&rfc5234;
</references>
<references title="Informative References">
&rfc2629;
</references>
<section title="Changes from RFC 4742">
<t>This section lists major changes between this document and RFC 4742.
<list style="symbols">
<t>Introduced the new Chunked Framing Mechanism to solve known security issues with the EOM framing.</t>
<t>Extended text in Security Considerations, added text on EOM issues.</t>
<t>Added examples to show new chunked encoding properly, highlighted the location of new lines.</t>
<t>Stated that the extraction of the SSH user name by a NETCONF server is implementation-dependent.</t>
<t>Changed use of the terms client/server, manager/agent to SSH client/server and NETCONF client/server.</t>
<t>Consistently used the term operation, instead of command or message.</t>
<t>Integrated previously-approved errata from http://rfc-editor.org/errata_search.php?rfc=4742</t>
</list>
</t>
</section>
</back>
</rfc>
| PAFTECH AB 2003-2026 | 2026-04-23 19:56:30 |