RFC 7076 INFORMATIONAL SSH · SECURITY · KEY MANAGEMENT

P6R's Secure Shell Public Key Subsystem

Organize keys and certificates in namespaces over SSH.

On rfc-editor.org ↗
PUBLISHED
November 2013
AUTHORS
M. Joseph, J. Susoy
STREAM
INDEPENDENT
NAMESPACE SIZE
up to 300 characters
PROTOCOL VERSION
3
STATUS CODES ADDED
5 (codes 192-196)
CERTIFICATE FORMATS
X.509, pgp-sign-rsa, pgp-sign-dss
DOI
10.17487/RFC7076

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
Independent Submission                                         M. Joseph
Request for Comments: 7076                                      J. Susoy
Category: Informational                                         P6R, Inc
ISSN: 2070-1721                                            November 2013


                P6R's Secure Shell Public Key Subsystem

Abstract

   The Secure Shell (SSH) Public Key Subsystem protocol defines a key
   distribution protocol that is limited to provisioning an SSH server
   with a user's public keys.  This document describes a new protocol
   that builds on the protocol defined in RFC 4819 to allow the
   provisioning of keys and certificates to a server using the SSH
   transport.

   The new protocol allows the calling client to organize keys and
   certificates in different namespaces on a server.  These namespaces
   can be used by the server to allow a client to configure any
   application running on the server (e.g., SSH, Key Management
   Interoperability Protocol (KMIP), Simple Network Management Protocol
   (SNMP)).

   The new protocol provides a server-independent mechanism for clients
   to add public keys, remove public keys, add certificates, remove
   certificates, and list the current set of keys and certificates known
   by the server by namespace (e.g., list all public keys in the SSH
   namespace).

   Rights to manage keys and certificates in a particular namespace are
   specific and limited to the authorized user and are defined as part
   of the server's implementation.  The described protocol is backward
   compatible to version 2 defined by RFC 4819.

Status of This Memo

   This document is not an Internet Standards Track specification; it is
   published for informational purposes.

   This is a contribution to the RFC Series, independently of any other
   RFC stream.  The RFC Editor has chosen to publish this document at
   its discretion and makes no statement about its value for
   implementation or deployment.  Documents approved for publication by
   the RFC Editor are not a candidate for any level of Internet
   Standard; see Section 2 of RFC 5741.

   Information about the current status of this document, any errata,
   and how to provide feedback on it may be obtained at
   http://www.rfc-editor.org/info/rfc7076.

Copyright Notice

   Copyright (c) 2013 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.

Table of Contents

   1. Introduction ....................................................3
   2. Terminology .....................................................3
   3. Overview of Extensions to the Public Key Subsystem ..............3
      3.1. Extended Status Codes ......................................4
      3.2. The Version Packet .........................................4
      3.3. The Namespace Attribute ....................................4
   4. New Operations ..................................................5
      4.1. Adding a Certificate .......................................5
      4.2. Removing a Certificate .....................................6
      4.3. Listing Certificates .......................................6
      4.4. Listing Namespaces .........................................7
   5. Extending Public Key Operations .................................8
      5.1. Adding a Public Key ........................................8
      5.2. Removing a Public Key ......................................8
      5.3. Listing Public Keys ........................................9
   6. Security Considerations .........................................9
   7. IANA Considerations ............................................10
   8. References .....................................................10
      8.1. Normative References ......................................10
      8.2. Informative References ....................................10

1.  Introduction

   This document describes a new protocol that builds on the protocol
   defined in RFC 4819 that can be used to configure public keys and
   certificates in an implementation-independent fashion.  The concept
   of a namespace is added to the protocol's operations; it allows the
   client to organize keys and certificates by application or
   organizational structure.

   P6R's Secure Shell Public Key Subsystem has been designed to run on
   top of the Secure Shell transport layer [3] and user authentication
   protocols [4].  It provides a simple mechanism for the client to
   manage the public keys and certificates on the server related to that
   client.  These keys and certificates are normally used for
   authentication of the client to a service, but they can be used for
   encrypting results back to the client as well.  Uploaded keys and
   certificates are meant to be able to configure all protocols running
   on a server (e.g., SSH, SSL, KMIP [8]) that use keys and
   certificates, as well as the applications that run on a server.

   This document should be read only after reading the Secure Shell
   Public Key Subsystem [1] document.  The new protocol described in
   this document builds on and is meant to be backwards compatible with
   the protocol described in [1].

2.  Terminology

   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 [2].

3.  Overview of Extensions to the Public Key Subsystem

   The Public Key Subsystem provides a server-independent mechanism for
   clients to add public keys, remove public keys, list the current
   public keys known by the server, add certificates, remove
   certificates, and list the current set of certificates known by the
   server.  This secure key distribution mechanism is implemented by a
   new SSH subsystem with the name of "publickey@p6r.com".

3.1.  Extended Status Codes

   The status code gives the status in a more machine-readable format
   (suitable for localization) and can have the following values:

        SSH_PUBLICKEY_CERTIFICATE_NOT_FOUND        192
        SSH_PUBLICKEY_CERTIFICATE_NOT_SUPPORTED    193
        SSH_PUBLICKEY_CERTIFICATE_ALREADY_PRESENT  194
        SSH_PUBLICKEY_ACTION_NOT_AUTHORIZED        195
        SSH_PUBLICKEY_CANNOT_CREATE_NAMESPACE      196

   The meaning of the failure codes is as implied by their names.  See
   Security Considerations for the use of the failure code:
   SSH_PUBLICKEY_ACTION_NOT_AUTHORIZED.

3.2.  The Version Packet

   Both sides MUST start a connection by sending a version packet that
   indicates the version of the protocol they are using.

        string "version"
        uint32 protocol-version-number

   This document defines version 3 of the new protocol.  We are using
   version 3 so that it can be backward compatible with the protocol
   defined by RFC 4819 [1].

3.3.  The Namespace Attribute

   The "namespace" attribute is added as an extension to what was
   described in RFC 4819.  The purpose of this attribute is to be able
   to organize the uploaded keys and certificates into groups where each
   group represents an application or organization structure.  This
   attribute is a string that should not be longer than 300 characters
   and MUST be specified in UTF-8 format [5].

   This new protocol uses the "ssh" namespace for the manipulation of
   public keys in an SSH server and should be considered as the default
   namespace when none is provided.

   As a convention, namespaces used for protocols are lowercase strings
   of the protocol's standard abbreviation.  For example, "ssl" should
   be the namespace used for the Secure Sockets Layer protocol.
   Namespaces for applications should contain the product and vendor's
   name.  To help determine what namespaces already exist on a server, a
   new operation "list-namespaces" is defined in Section 4.

4.  New Operations

   P6R's Public Key Subsystem extends the functionality defined in RFC
   4819 with the following operations: add-certificate,
   remove-certificate, list-certificates, and list-namespaces.

4.1.  Adding a Certificate

   If the client wishes to add a certificate, the client sends:

        string    "add-certificate"
        string    certificate format name
        string    certificate blob
        boolean   overwrite
        uint32    attribute-count
         string    attrib-name
         string    attrib-value
         bool      critical
       repeated attribute-count times

   This request MUST include at least the "namespace" attribute so that
   the server knows where to save the certificate.  Only one namespace
   attribute can be used per an add-certificate request.  It is possible
   for the same user to save the same certificate into multiple
   namespaces, but this must be done with several separate
   add-certificate requests.

   If the namespace appearing in an add-certificate request does not
   already exist on a server, then it is created by this operation.
   However, if the user is not authorized to create a namespace, the
   server MUST return SSH_PUBLICKEY_CANNOT_CREATE_NAMESPACE.

   If the overwrite field is false and the specified certificate already
   exists in the given namespace, the server MUST return
   SSH_PUBLICKEY_CERTIFICATE_ALREADY_PRESENT.  If the server returns
   this, the client SHOULD provide an option to the user to overwrite
   the certificate.  If the overwrite field is true and the specified
   key already exists in the given namespace but cannot be overwritten,
   the server MUST return SSH_PUBLICKEY_ACCESS_DENIED.

   However, a user may not be authorized to add a certificate to the
   specified namespace.  If the user does not have permission to add a
   certificate, then the server MUST return
   SSH_PUBLICKEY_ACTION_NOT_AUTHORIZED.

   Examples of possible "certificate format names" are: "X509",
   "pgp-sign-rsa", and "pgp-sign-dss".  The format of the public key and
   certificate blobs are detailed in Section 6.6, "Public Key
   Algorithms", of the SSH Transport Protocol document [3], where X.509
   certificates are to be encoded using a DER format [6] [7] in a
   certificate blob.

4.2.  Removing a Certificate

   If the client wishes to remove a certificate, the client sends:

        string    "remove-certificate"
        string    certificate format name
        string    certificate blob
        uint32    attribute-count
         string    attrib-name
         string    attrib-value
        repeated attribute-count times

   This request MUST include at least the "namespace" attribute so that
   the server knows from where to delete the certificate.  Only one
   namespace attribute can be used per remove-certificate request.  The
   server MUST attempt to remove the certificate from the appropriate
   location.

   However, a user may not be authorized to remove a certificate from
   the specified namespace.  If the user does not have permission to
   remove the certificate, then the server MUST return
   SSH_PUBLICKEY_ACTION_NOT_AUTHORIZED.

   Examples of possible "certificate format names" are: "X509",
   "pgp-sign-rsa", and "pgp-sign-dss".

4.3.  Listing Certificates

   If the client wishes to list the known certificates, the client
   sends:

        string    "list-certificates"

   The server will respond with zero or more of the following responses:

        string    "certificate"
        string    certificate format name
        string    certificate blob
        uint32    attribute-count
         string    attrib-name
         string    attrib-value
        repeated attribute-count times

   There is no requirement that the responses be in any particular
   order.  Whilst some server implementations may send the responses in
   some order, client implementations should not rely on responses being
   in any order.

   This response MUST include at least the "namespace" attribute so that
   a client can tell in which namespace the certificate resides.  Only
   one namespace attribute can be used per list-certificate request.

   Following the last "certificate" response, a status packet MUST be
   sent.

4.4.  Listing Namespaces

   If the client wishes to know existing namespaces on the server, it
   sends:

        string    "list-namespaces"

   The server will respond with zero or more of the following responses:

        string    "namespace"
        string    namespace name

   It is possible that not all namespaces will be visible to every
   authenticated user.  In this case, the responding server will return
   a subset of existing namespaces.  See Security Considerations below.

   Following the last "namespace" response, a status packet MUST be
   sent.

5.  Extending Public Key Operations

   In addition to adding new operations, this document describes
   extensions to the operations defined in RFC 4819.

5.1.  Adding a Public Key

   If the client wishes to add a public key, the client sends:

        string    "add"
        string    public key algorithm name
        string    public key blob
        boolean   overwrite
        uint32    attribute-count
         string    attrib-name
         string    attrib-value
         bool      critical
        repeated attribute-count times

   This request MAY include one "namespace" attribute so that a client
   can save the public key into a specific namespace.  It is possible
   for the same user to save the same key into multiple namespaces, but
   this requires multiple add requests.

   If the namespace appearing in an add public key request does not
   already exist on a server, then it is created by this operation.
   However, if the user is not authorized to create a namespace the
   server MUST return SSH_PUBLICKEY_CANNOT_CREATE_NAMESPACE,

5.2.  Removing a Public Key

   If the client wishes to remove a public key, the client sends:

        string    "remove"
        string    public key algorithm name
        string    public key blob
        uint32    attribute-count
         string    attrib-name
         string    attrib-value
         bool      critical
        repeated attribute-count times

   This extension allows attributes to be added to a remove request.
   This request MAY include one "namespace" attribute so that a client
   can remove the public key from a specific namespace.

5.3.  Listing Public Keys

   If the client wishes to list the known public keys, the client sends:

        string    "list"
        uint32    attribute-count
         string    attrib-name
         string    attrib-value
         bool      critical
        repeated attribute-count times

   This extension allows attributes to be added to a list request.  This
   request MAY include one "namespace" attribute so that a client can
   list the public keys from a specific namespace.

   The server will respond with zero or more of the following responses:

        string    "publickey"
        string    public key algorithm name
        string    public key blob
        uint32    attribute-count
         string    attrib-name
         string    attrib-value
        repeated attribute-count times

   This response MAY include the "namespace" attribute so that a client
   can tell in which namespace the key resides.

6.  Security Considerations

   This protocol assumes that it is run over a secure channel and that
   the endpoints of the channel have been authenticated.  Thus, this
   protocol assumes that it is externally protected from network-level
   attacks.

   This protocol provides a mechanism that allows key and certificate
   material to be uploaded and manipulated into a server application.
   It is the responsibility of the server implementation to enforce
   access controls that may be required to limit any particular user's
   access to the data in a namespace.  For example, one user may be
   allowed to list only the contents of a namespace but not add or
   remove keys or certificates to/from it.  The server MUST return
   SSH_PUBLICKEY_ACTION_NOT_AUTHORIZED when a user's action goes against
   its defined access controls.

   This protocol requires the client to assume that the server will
   correctly implement and observe attributes applied to keys.
   Implementation errors in the server could cause clients to authorize
   keys and certificates for access they were not intended to have, or
   to apply fewer restrictions than were intended.

7.  IANA Considerations

   Although Section 3.1 defines four new status codes, these are in the
   'Private Use' range of IANA's Publickey Subsystem Status Codes
   registry as defined by Section 6.6.1 ("Conventions") in [1].  No IANA
   actions are required for this document.

8.  References

8.1.  Normative References

   [1] Galbraith, J., Van Dyke, J., and J. Bright, "Secure Shell Public
       Key Subsystem", RFC 4819, March 2007.

   [2] Bradner, S., "Key words for use in RFCs to Indicate Requirement
       Levels", BCP 14, RFC 2119, March 1997.

   [3] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH) Transport
       Layer Protocol", RFC 4253, January 2006.

   [4] Ylonen, T. and C. Lonvick, Ed., "The Secure Shell (SSH)
       Authentication Protocol", RFC 4252, January 2006.

   [5] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD
       63, RFC 3629, November 2003.

   [6] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R.,
       and W. Polk, "Internet X.509 Public Key Infrastructure
       Certificate and Certificate Revocation List (CRL) Profile", RFC
       5280, May 2008.

   [7] ITU-T Recommendation X.690 (2002) | ISO/IEC 8825-1:2002,
       Information technology -- ASN.1 encoding rules: Specification of
       Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and
       Distinguished Encoding Rules (DER).

8.2.  Informative References

   [8] OASIS, "Key Management Interoperability Protocol (KMIP) 1.1",
       January 2013, <http://docs.oasis-open.org/kmip/spec/v1.1/os/
       kmip-spec-v1.1-os.html>.

Authors' Addresses

   Mark Joseph, PhD
   P6R, Inc
   1840 41st Ave
   Suite 102-139
   Capitola, CA 95010
   US

   Phone: +1 888 452 2580 (x702)
   EMail: mark@p6r.com


   Jim Susoy
   P6R, Inc
   1840 41st Ave
   Suite 102-139
   Capitola, CA 95010
   US

   Phone: +1 888 452 2580 (x701)
   EMail: jim@p6r.com

AI ELI5

On this page
PROBLEMThe original SSH Public Key Subsystem (RFC 4819) provisions keys to a server but lacks a way to organize them by application or service.
MECHANISMThis extension adds namespaces to group keys and certificates by their purpose (e.g., 'ssh', 'ssl', 'kmip') and provides new operations to add, remove, and list certificates in specific namespaces.
BETTER KEY ORGANIZATIONServers can now manage keys and certificates for multiple applications through a single protocol, with per-namespace access control. The design is backward compatible with RFC 4819 version 2.

§1Introduction to the Extension

The Secure Shell (SSH) Public Key Subsystem, defined in RFC 4819, provides a way to upload and manage a user's public keys on an SSH server. This document describes an extension to that protocol, adding a namespace concept that lets clients organize keys and certificates by the application or service that will use them.

P6R's extension runs as an SSH subsystem named publickey@p6r.com and operates on top of the SSH transport layer. Keys and certificates can be used for client authentication or to encrypt responses back to the client. The namespace system allows a single server to use the same key distribution protocol for different applications like SSH, KMIP, SNMP, or SSL, each with its own namespace.

The protocol is designed to be backward compatible with RFC 4819 version 2 while introducing version 3 with the new capabilities.

SSH lets you send keys to a server. This adds labels (namespaces) so a server can keep different types of keys separate.

§2Core Extensions

Three main extensions are added to the original protocol. First, a new set of status codes are defined: SSH_PUBLICKEY_CERTIFICATE_NOT_FOUND (192), SSH_PUBLICKEY_CERTIFICATE_NOT_SUPPORTED (193), SSH_PUBLICKEY_CERTIFICATE_ALREADY_PRESENT (194), SSH_PUBLICKEY_ACTION_NOT_AUTHORIZED (195), and SSH_PUBLICKEY_CANNOT_CREATE_NAMESPACE (196). These allow the server to report specific failure reasons in machine-readable form.

Second, a version packet starts every connection, letting both sides declare which protocol version they support. This document defines version 3.

Third, a namespace attribute is added to all operations. A namespace is a UTF-8 string of up to 300 characters that groups keys and certificates. The default namespace is ssh when none is provided. By convention, protocol namespaces use lowercase abbreviations (e.g., ssl, kmip, snmp), while application namespaces include the product and vendor name.

The extension adds version numbers so client and server agree on what they support, error codes so the server can explain what went wrong, and namespace names so everything knows which box to use.

§3Certificate Operations

The protocol adds four new operations for working with certificates. Add-certificate uploads a certificate in formats such as X.509, pgp-sign-rsa, or pgp-sign-dss, with a namespace attribute telling the server which namespace to store it in. If the namespace does not exist, the server creates it (unless the user lacks permission). The operation can overwrite an existing certificate or reject if one already exists.

Remove-certificate deletes a certificate from a namespace by its format and blob. List-certificates queries the server and returns all certificates in a namespace, zero or more at a time, ending with a status packet. List-namespaces shows all namespaces visible to the authenticated user; the server may hide namespaces the user is not authorized to access.

All certificate operations require the namespace attribute. Only one namespace can be specified per request. A user can upload the same certificate to multiple namespaces by sending separate requests.

You can add a certificate to a box, remove one, see all certificates in a box, or ask which boxes exist. Each action needs to say which box to use.

§4Extended Public Key Operations

The protocol also extends the original RFC 4819 public key operations. Add now optionally accepts a namespace attribute, allowing a public key to be saved to a specific namespace instead of just the default. If the namespace does not exist, the server creates it. An attribute system allows metadata to be attached to keys.

Remove now accepts attributes and can specify a namespace from which to delete a public key. List also accepts attributes and an optional namespace parameter to query public keys from a specific namespace. Server responses may include the namespace attribute so the client knows which namespace each key is in.

Unlike certificate operations, the namespace attribute is optional for public key operations, allowing backward compatibility with servers that do not understand namespaces.

The original way to add and remove keys gets updated to work with boxes too, but without requiring them so that old servers still work.

§5Security Considerations and Deployment

The protocol assumes it runs over a secure, authenticated SSH channel, protecting it from network-level attacks. The server implementation must enforce access controls to restrict what each user can do in each namespace. For example, one user might be able to list a namespace's keys but not add or remove them. If a user's action violates the server's access policy, the server returns SSH_PUBLICKEY_ACTION_NOT_AUTHORIZED.

Implementation correctness is critical. If a server incorrectly handles attributes attached to keys and certificates, it could authorize access that was not intended or apply fewer restrictions than desired. The protocol relies on correct server behavior and places the responsibility for access control on the server implementation, not the protocol itself.

Because the protocol is informational and vendor-specific, IANA registration is not required for the new status codes, which fall in the Private Use range of the SSH Public Key Subsystem registry.

The server has to be trusted to keep its boxes locked properly, and if it makes a mistake, keys could end up in the wrong hands.

§6References