xref: /titanic_41/usr/src/cmd/ssh/README.altprivsep (revision cd7d5faf5bbb52336a6f85578a90b31a648ac3fa)
1*cd7d5fafSJan Pechanec   Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
27c478bd9Sstevel@tonic-gate   Use is subject to license terms.
37c478bd9Sstevel@tonic-gate
47c478bd9Sstevel@tonic-gate	Sun's Alternative "Privilege Separation" for OpenSSH
57c478bd9Sstevel@tonic-gate
67c478bd9Sstevel@tonic-gate
77c478bd9Sstevel@tonic-gateTable of Contents
87c478bd9Sstevel@tonic-gate
97c478bd9Sstevel@tonic-gate1.    Introduction
107c478bd9Sstevel@tonic-gate2.    What is "Privilege?"
117c478bd9Sstevel@tonic-gate3.    Analysis of the SSH Protocols
127c478bd9Sstevel@tonic-gate3.1.  Privileged Resources, Operations, in the SSH Protocols
137c478bd9Sstevel@tonic-gate4.    OpenSSH's Privilege Separation
147c478bd9Sstevel@tonic-gate5.    SUNWssh's Alternative Privilege Separation
157c478bd9Sstevel@tonic-gate6.    Comparison of the OpenSSH and SUNWssh PrivSep Models
167c478bd9Sstevel@tonic-gate7.    Future Directions
177c478bd9Sstevel@tonic-gate8.    Guide to the AltPrivSep Source Code
187c478bd9Sstevel@tonic-gateA.    References
197c478bd9Sstevel@tonic-gate
207c478bd9Sstevel@tonic-gate
217c478bd9Sstevel@tonic-gate
227c478bd9Sstevel@tonic-gate
237c478bd9Sstevel@tonic-gate
247c478bd9Sstevel@tonic-gate1.  Introduction
257c478bd9Sstevel@tonic-gate
267c478bd9Sstevel@tonic-gate    Implementations of SSH servers require some degree of privilege in
277c478bd9Sstevel@tonic-gate    order to function properly.  Often such implementations retain such
287c478bd9Sstevel@tonic-gate    privilege throughout normal operation even while users are logged
297c478bd9Sstevel@tonic-gate    in.  This means that vulnerabilities in the implementation of the
307c478bd9Sstevel@tonic-gate    protocols can be exploited in such ways as to escalate the privilege
317c478bd9Sstevel@tonic-gate    that would normally be accorded to mer-mortal users.
327c478bd9Sstevel@tonic-gate
337c478bd9Sstevel@tonic-gate    The OpenSSH team introduced support for "privilege separation" in
347c478bd9Sstevel@tonic-gate    the OpenSSH ssh server some years ago to minimize the extent of
357c478bd9Sstevel@tonic-gate    extant, undiscovered vulnerabilities in the OpenSSH server source
367c478bd9Sstevel@tonic-gate    code.  The basic concept is to have a multi-process server
377c478bd9Sstevel@tonic-gate    implementation where one process, the "monitor" is privileged and
387c478bd9Sstevel@tonic-gate    implements a smaller protocol than the ssh protocols, and thus is,
397c478bd9Sstevel@tonic-gate    hopefully, less likely to sport exploitable security bugs.
407c478bd9Sstevel@tonic-gate
417c478bd9Sstevel@tonic-gate    The ssh team at Sun agrees with the basic OpenSSH privilege
427c478bd9Sstevel@tonic-gate    separation concept, but disagrees with its design.
437c478bd9Sstevel@tonic-gate
447c478bd9Sstevel@tonic-gate    Here we present our alternative to the OpenSSH design.  We begin
457c478bd9Sstevel@tonic-gate    with the question of just what is "privilege" and follow on with an
467c478bd9Sstevel@tonic-gate    analysis of the SSH protocols vis-a-vis privilege.  Then we briefly
477c478bd9Sstevel@tonic-gate    describe the OpenSSH model, followed by an exposition of our
487c478bd9Sstevel@tonic-gate    alternative model.
497c478bd9Sstevel@tonic-gate
507c478bd9Sstevel@tonic-gate
517c478bd9Sstevel@tonic-gate2.  What is "Privilege?"
527c478bd9Sstevel@tonic-gate
537c478bd9Sstevel@tonic-gate    Privilege, in a traditional Unix sense, is that which the "root"
547c478bd9Sstevel@tonic-gate    user can do that other users cannot directly do.  In Solaris 10
557c478bd9Sstevel@tonic-gate    there is a new approach to this sort of privilege with the aim of
567c478bd9Sstevel@tonic-gate    running much of the operating system with the Least Privilege
577c478bd9Sstevel@tonic-gate    required; root's privilege is broken down into many privileges and
587c478bd9Sstevel@tonic-gate    these are managed through privilege sets.  We won't go into the
597c478bd9Sstevel@tonic-gate    details of Solaris 10's Least Privilege facility here.
607c478bd9Sstevel@tonic-gate
617c478bd9Sstevel@tonic-gate    But privilege is also access to data and resources that can be used
627c478bd9Sstevel@tonic-gate    to escalate the privilege of those who have access to them.  For
637c478bd9Sstevel@tonic-gate    example: secret, or private cryptographic keys used in
647c478bd9Sstevel@tonic-gate    authentication.  Network security typically requires the use of
657c478bd9Sstevel@tonic-gate    cryptographic keys for authentication.
667c478bd9Sstevel@tonic-gate
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate3.  Analysis of the SSH Protocols
697c478bd9Sstevel@tonic-gate
707c478bd9Sstevel@tonic-gate    There are two or, rather three SSH protocols:
717c478bd9Sstevel@tonic-gate
727c478bd9Sstevel@tonic-gate     - version 1
737c478bd9Sstevel@tonic-gate     - version 1.5
747c478bd9Sstevel@tonic-gate     - version 2
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate    Version 1 and 1.5 are much the same, from our point of view; version
777c478bd9Sstevel@tonic-gate    2 is significantly different from the other two.
787c478bd9Sstevel@tonic-gate
797c478bd9Sstevel@tonic-gate    Familiarity by the reader with the specifications for these
807c478bd9Sstevel@tonic-gate    protocols is not assumed, but would be beneficial to the reader.
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gate    Quite roughly, these protocols consist of the following:
837c478bd9Sstevel@tonic-gate
847c478bd9Sstevel@tonic-gate	a) initial version exchange (for protocol version negotiation)
857c478bd9Sstevel@tonic-gate	b) a binary encoding of message data
867c478bd9Sstevel@tonic-gate	c) message syntaxes for the protocols' messages
877c478bd9Sstevel@tonic-gate	d) specifications on use of cryptography for transport
887c478bd9Sstevel@tonic-gate	   privacy (encryption) and integrity protection
897c478bd9Sstevel@tonic-gate	e) a key exchange protocol (which also authenticates servers to
907c478bd9Sstevel@tonic-gate	   clients)
917c478bd9Sstevel@tonic-gate	f) a protocol for user authentication
927c478bd9Sstevel@tonic-gate	g) a session protocol
937c478bd9Sstevel@tonic-gate	h) a re-keying protocol (v2-only)
947c478bd9Sstevel@tonic-gate
957c478bd9Sstevel@tonic-gate    Some of these parts of the ssh protocols are quite complex, some
967c478bd9Sstevel@tonic-gate    quite straightforward.  Altogether implementation of the ssh
977c478bd9Sstevel@tonic-gate    protocols requires a source code base of significant size.
987c478bd9Sstevel@tonic-gate
997c478bd9Sstevel@tonic-gate    The OpenSSH implementation relies on OpenSSL for cryptographic
1007c478bd9Sstevel@tonic-gate    service, on libz for compression service and miscellaneous other
1017c478bd9Sstevel@tonic-gate    libraries.  Besides these OpenSSH consists of several tens of
1027c478bd9Sstevel@tonic-gate    thousands of lines of source code in C.
1037c478bd9Sstevel@tonic-gate
1047c478bd9Sstevel@tonic-gate    SUNWssh is based on OpenSSH, so it is comparable in size and
1057c478bd9Sstevel@tonic-gate    complexity to OpenSSH.
1067c478bd9Sstevel@tonic-gate
1077c478bd9Sstevel@tonic-gate    There is, then, plenty of space for security bugs in the OpenSSH,
1087c478bd9Sstevel@tonic-gate    and, therefore, also in the SUNWssh source code bases.
1097c478bd9Sstevel@tonic-gate
1107c478bd9Sstevel@tonic-gate    The OpenSSH team designed and implemented a "privilege separation"
1117c478bd9Sstevel@tonic-gate    feature in their ssh server to reduce the risk that a security bug
1127c478bd9Sstevel@tonic-gate    in OpenSSH could be successfully exploited and an attacker's
1137c478bd9Sstevel@tonic-gate    privilege escalated.
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gate
1167c478bd9Sstevel@tonic-gate3.1.  Privileged Resources, Operations, in the SSH Protocols
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gate    What privileges does an SSH server need then?
1197c478bd9Sstevel@tonic-gate
1207c478bd9Sstevel@tonic-gate    Observation with Solaris 10's ppriv(1) and truss(1) commands as well
1217c478bd9Sstevel@tonic-gate    as analysis of the ssh protocols leads to conclude as follows.
1227c478bd9Sstevel@tonic-gate
1237c478bd9Sstevel@tonic-gate    No privilege or privileged resources are needed to implement the
1247c478bd9Sstevel@tonic-gate    parts (a)-(d) mentioned in section 3.
1257c478bd9Sstevel@tonic-gate
1267c478bd9Sstevel@tonic-gate
127413e3c29Sjp161948    For key exchange and server authentication (e) an ssh server requires:
1287c478bd9Sstevel@tonic-gate
1297c478bd9Sstevel@tonic-gate     - Access to the host's ssh private keys.
1307c478bd9Sstevel@tonic-gate
1317c478bd9Sstevel@tonic-gate     - Access to the host's GSS-API acceptor credentials.  [SSHv2-only]
1327c478bd9Sstevel@tonic-gate
1337c478bd9Sstevel@tonic-gate
134413e3c29Sjp161948    An ssh server requires practically all privileges for user
135413e3c29Sjp161948    authentication (f) (at least PAM does), particularly
136413e3c29Sjp161948    PRIV_PROC_SETID, for logging the user in.
137413e3c29Sjp161948
138413e3c29Sjp161948
1397c478bd9Sstevel@tonic-gate    Post-authentication an ssh server requires the following privileges:
1407c478bd9Sstevel@tonic-gate
1417c478bd9Sstevel@tonic-gate     - Those required for auditing a user's subsequent logout.
1427c478bd9Sstevel@tonic-gate
1437c478bd9Sstevel@tonic-gate       That is, PRIV_PROC_AUDIT.
1447c478bd9Sstevel@tonic-gate
1457c478bd9Sstevel@tonic-gate
1467c478bd9Sstevel@tonic-gate     - Those required for record keeping (i.e., utmpx/wtmpx logging).
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gate       That is, either open file descriptor for those files or
1497c478bd9Sstevel@tonic-gate       PRIV_FILE_DAC_WRITE or otherwise access to those files, perhaps
1507c478bd9Sstevel@tonic-gate       through a special user id or group id which would be granted
1517c478bd9Sstevel@tonic-gate       write access through the ACLs on those files.
1527c478bd9Sstevel@tonic-gate
1537c478bd9Sstevel@tonic-gate       Since SSHv2 allows clients to open many channels with
1547c478bd9Sstevel@tonic-gate       pseudo-terminals a server may need to open and close utmpx/wtmpx
1557c478bd9Sstevel@tonic-gate       records multiple times in the lifetime of an SSHv2 connection.
1567c478bd9Sstevel@tonic-gate
1577c478bd9Sstevel@tonic-gate
1587c478bd9Sstevel@tonic-gate     - Those required for accessing the host's ssh private keys for
1597c478bd9Sstevel@tonic-gate       SSHv2 re-keying.  [SSHv2-only]
1607c478bd9Sstevel@tonic-gate
1617c478bd9Sstevel@tonic-gate       These keys can be (and are) loaded at server startup time,
1627c478bd9Sstevel@tonic-gate       requiring PRIV_FILE_DAC_READ, or access through file ACLs, at
1637c478bd9Sstevel@tonic-gate       that time, but not thence.
1647c478bd9Sstevel@tonic-gate
1657c478bd9Sstevel@tonic-gate
1667c478bd9Sstevel@tonic-gate     - Those required for accessing the host's GSS-API acceptor
1677c478bd9Sstevel@tonic-gate       credentials for SSHv2 re-keying.
1687c478bd9Sstevel@tonic-gate
1697c478bd9Sstevel@tonic-gate       These credentials may require a large set of privileges.  The
1707c478bd9Sstevel@tonic-gate       Solaris 10 Kerberos V GSS-API mechanism, for example, requires
1717c478bd9Sstevel@tonic-gate       PRIV_FILE_DAC_READ (for access to the system keytab) and
1727c478bd9Sstevel@tonic-gate       PRIV_FILE_DAC_WRITE (for access to the Kerberos V replay cache).
1737c478bd9Sstevel@tonic-gate
1747c478bd9Sstevel@tonic-gate
1757c478bd9Sstevel@tonic-gate    It is worth pointing out that because of a wrinkle in the
1767c478bd9Sstevel@tonic-gate    specification of the SSHv2 protocol and various implementations,
1777c478bd9Sstevel@tonic-gate    access to a host's ssh private keys can allow one not only to
1787c478bd9Sstevel@tonic-gate    impersonate the host as a server (which is, in practice, difficult),
1797c478bd9Sstevel@tonic-gate    but also to impersonate the host as a client (which is quite easy to
1807c478bd9Sstevel@tonic-gate    do) using "hostbased" user authentication.
1817c478bd9Sstevel@tonic-gate
1827c478bd9Sstevel@tonic-gate    It is entirely possible to have one-process server implementation
1837c478bd9Sstevel@tonic-gate    that drops most privileges and access to privileged resources after
1847c478bd9Sstevel@tonic-gate    user authentication succeeds.  Such an implementation would make
1857c478bd9Sstevel@tonic-gate    some privileges, such as PRIV_PROC_SETID, available to any attacker
1867c478bd9Sstevel@tonic-gate    that successfully exploited a security bug in the ssh server.
1877c478bd9Sstevel@tonic-gate
1887c478bd9Sstevel@tonic-gate    But such an implementation would also have to retain access to
1897c478bd9Sstevel@tonic-gate    resources needed for authenticating the server, which, as described
1907c478bd9Sstevel@tonic-gate    above, can be used to impersonate the server, in some cases with
1917c478bd9Sstevel@tonic-gate    ease.
1927c478bd9Sstevel@tonic-gate
1937c478bd9Sstevel@tonic-gate
1947c478bd9Sstevel@tonic-gate4.  OpenSSH's Privilege Separation
1957c478bd9Sstevel@tonic-gate
1967c478bd9Sstevel@tonic-gate    The OpenSSH privilege separation model is quite complex.
1977c478bd9Sstevel@tonic-gate
1987c478bd9Sstevel@tonic-gate    It consists of a monitor, which retains all privileges and access to
1997c478bd9Sstevel@tonic-gate    privileged resources, and two processes which run with much less
2007c478bd9Sstevel@tonic-gate    privilege: one process running as a special user, "sshd," for
2017c478bd9Sstevel@tonic-gate    hosting all phases of the SSH protocols up to and including
2027c478bd9Sstevel@tonic-gate    authentication, and one process running as the actual user that logs
2037c478bd9Sstevel@tonic-gate    in and which hosts all phases of the SSH protocols post-user-
2047c478bd9Sstevel@tonic-gate    authentication.
2057c478bd9Sstevel@tonic-gate
2067c478bd9Sstevel@tonic-gate    The monitor and its companion processes speak a private protocol
2077c478bd9Sstevel@tonic-gate    over IPC.  This protocol is intended to be smaller and simpler than
2087c478bd9Sstevel@tonic-gate    the SSH wire protocols.
2097c478bd9Sstevel@tonic-gate
2107c478bd9Sstevel@tonic-gate    In practice the OpenSSH monitor protocols relating to user
2117c478bd9Sstevel@tonic-gate    authentication are neither smaller nor simpler than the SSH user
2127c478bd9Sstevel@tonic-gate    authentication protocols; and though they are different they also
2137c478bd9Sstevel@tonic-gate    transport much the same data, including RSA/DSA signatures,
2147c478bd9Sstevel@tonic-gate    usernames, PAM conversations, and GSS-API context and MIC tokens.
2157c478bd9Sstevel@tonic-gate
2167c478bd9Sstevel@tonic-gate    The key exchange protocols have been broken down into their
2177c478bd9Sstevel@tonic-gate    essentials and the monitor serves only services such as signing
2187c478bd9Sstevel@tonic-gate    server replies with private host keys.
2197c478bd9Sstevel@tonic-gate
2207c478bd9Sstevel@tonic-gate    Note also that the OpenSSH monitor protocol uses the same encodings
2217c478bd9Sstevel@tonic-gate    as the SSH protocols and uses the same implementation of those
2227c478bd9Sstevel@tonic-gate    encodings.
2237c478bd9Sstevel@tonic-gate
2247c478bd9Sstevel@tonic-gate
2257c478bd9Sstevel@tonic-gate5.  SUNWssh's Alternative Privilege Separation
2267c478bd9Sstevel@tonic-gate
2277c478bd9Sstevel@tonic-gate    The Sun Microsystems ssh team believes that the OpenSSH team has
2287c478bd9Sstevel@tonic-gate    reached the point of diminishing returns in attempting to separate
2297c478bd9Sstevel@tonic-gate    processing of the user authentication protocols and that the OpenSSH
2307c478bd9Sstevel@tonic-gate    approach to privilege separation of the key exchange protocols has
2317c478bd9Sstevel@tonic-gate    led to a situation in which the monitor acts as an oracle, willing
2327c478bd9Sstevel@tonic-gate    to sign anything provided by the unprivileged processes that talk to
2337c478bd9Sstevel@tonic-gate    it.
2347c478bd9Sstevel@tonic-gate
2357c478bd9Sstevel@tonic-gate    The Sun ssh team proposes a somewhat different privilege separation
2367c478bd9Sstevel@tonic-gate    implementation that shares with the OpenSSH model the goal of
2377c478bd9Sstevel@tonic-gate    minimizing and simplifying the protocol spoken by the monitor, but
2387c478bd9Sstevel@tonic-gate    little source code.
2397c478bd9Sstevel@tonic-gate
2407c478bd9Sstevel@tonic-gate    We eschew any temptation to apply the privilege separation concept
2417c478bd9Sstevel@tonic-gate    to the version negotiation, initial key exchange and user
2427c478bd9Sstevel@tonic-gate    authentication phases of the ssh protocols (but see section 7).
2437c478bd9Sstevel@tonic-gate
2447c478bd9Sstevel@tonic-gate    Instead we focus on separating processing of auditing, record
2457c478bd9Sstevel@tonic-gate    keeping and re-keying from processing of the session protocols.  We
2467c478bd9Sstevel@tonic-gate    also wish to avoid creating any oracles in the monitor.
2477c478bd9Sstevel@tonic-gate
2487c478bd9Sstevel@tonic-gate    This approach allows us to have a very simple monitor protocol.  Our
2497c478bd9Sstevel@tonic-gate    monitor protocol consists of the following operations:
2507c478bd9Sstevel@tonic-gate
2517c478bd9Sstevel@tonic-gate     - record a new pseudo-terminal session
2527c478bd9Sstevel@tonic-gate     - record the end of a pseudo-terminal session
2537c478bd9Sstevel@tonic-gate     - process a re-key protocol messages
2547c478bd9Sstevel@tonic-gate     - get keys negotiated during re-keying to the session process to it
2557c478bd9Sstevel@tonic-gate       can use them
2567c478bd9Sstevel@tonic-gate
2577c478bd9Sstevel@tonic-gate    Logout auditing is done when the session process dies and so does
2587c478bd9Sstevel@tonic-gate    not require a monitor protocol message.
2597c478bd9Sstevel@tonic-gate
2607c478bd9Sstevel@tonic-gate    By processing all re-key protocol messages in the monitor we prevent
2617c478bd9Sstevel@tonic-gate    the creation of oracles in the monitor.  This is so because the
2627c478bd9Sstevel@tonic-gate    monitor signs only material which it has generated and over which an
2637c478bd9Sstevel@tonic-gate    attacker would have little influence (through the attackers offered
2647c478bd9Sstevel@tonic-gate    DH public key, for example).
2657c478bd9Sstevel@tonic-gate
2667c478bd9Sstevel@tonic-gate    Odds and ends:
2677c478bd9Sstevel@tonic-gate
2687c478bd9Sstevel@tonic-gate     - If the monitor receives SIGHUP, SIGTERM or SIGINT it will call
2697c478bd9Sstevel@tonic-gate       fatal_cleanup(), and thence will forcibly shutdown(3SOCKET) the
2707c478bd9Sstevel@tonic-gate       ssh connection socket, causing its child to exit, and audit a
2717c478bd9Sstevel@tonic-gate       logout.
2727c478bd9Sstevel@tonic-gate
2737c478bd9Sstevel@tonic-gate     - The monitor does not attempt to update utmpx/wtmpx independently
2747c478bd9Sstevel@tonic-gate       of its child -- it depends on the child asking it to.
2757c478bd9Sstevel@tonic-gate
2767c478bd9Sstevel@tonic-gate     - The child now is unable to chown() ptys back to root.  That's Ok,
2777c478bd9Sstevel@tonic-gate       other services on Solaris do the same and everything still works
2787c478bd9Sstevel@tonic-gate       because of grantpt(3C).
2797c478bd9Sstevel@tonic-gate
280*cd7d5fafSJan Pechanec     - The sshd server process (the one that will become a monitor)
281*cd7d5fafSJan Pechanec       forks a child process before the key exchange starts. The reason
282*cd7d5fafSJan Pechanec       for it is that if we forked after that we would end up using
283*cd7d5fafSJan Pechanec       PKCS#11 sessions initialized in the monitor unless
284*cd7d5fafSJan Pechanec       UseOpenSSLEngine was explicitly set to 'no'. Using any existing
285*cd7d5fafSJan Pechanec       PKCS#11 sessions or object handles over fork is what the PKCS#11
286*cd7d5fafSJan Pechanec       standard explicitly prohibits. To solve that, we would have to
287*cd7d5fafSJan Pechanec       rekey before fork and then newly initialize the engine in the
288*cd7d5fafSJan Pechanec       child, together with the new crypto contexts initialized with the
289*cd7d5fafSJan Pechanec       keys produced by the key re-exchange. And, that wouldn't help in
290*cd7d5fafSJan Pechanec       situations where the client does not support rekeying which also
291*cd7d5fafSJan Pechanec       includes the whole protocol version 1. The pre-fork solution is
292*cd7d5fafSJan Pechanec       simpler and also much faster. So, the key exchange and
293*cd7d5fafSJan Pechanec       authentication is fully done in the child server process while
294*cd7d5fafSJan Pechanec       the monitor waits aside to read the authentication context that
295*cd7d5fafSJan Pechanec       is needed for further operation. The child drops privileges after
296*cd7d5fafSJan Pechanec       the authentication finishes.
297*cd7d5fafSJan Pechanec
298*cd7d5fafSJan Pechanec       With the ssh client, the situation is slightly more complicated.
299*cd7d5fafSJan Pechanec       Given the fact that the user can request to go to the background
300*cd7d5fafSJan Pechanec       during the connection using the ~& sequence we must be prepared
301*cd7d5fafSJan Pechanec       to rekey before forking, to reinitialize the engine in the child
302*cd7d5fafSJan Pechanec       after that, and then set the new crypto contexts with the new
303*cd7d5fafSJan Pechanec       keys. If the server we are communicating with does not support
304*cd7d5fafSJan Pechanec       rekeying we will not use the engine at all. We expect this
305*cd7d5fafSJan Pechanec       situation to be extremely rare and will not offer any workaround
306*cd7d5fafSJan Pechanec       for that. This also includes the protocol version 1. However,
307*cd7d5fafSJan Pechanec       this version is already considered obsolete and should not be used
308*cd7d5fafSJan Pechanec       if possible.
3097c478bd9Sstevel@tonic-gate
3107c478bd9Sstevel@tonic-gate6.  Comparison of the OpenSSH and SUNWssh PrivSep Models
3117c478bd9Sstevel@tonic-gate
3127c478bd9Sstevel@tonic-gate    The OpenSSH server involves three processes which we will term
3137c478bd9Sstevel@tonic-gate    "pre-session," "session" and "monitor."
3147c478bd9Sstevel@tonic-gate
3157c478bd9Sstevel@tonic-gate    The OpenSSH pre-session process implements:
3167c478bd9Sstevel@tonic-gate
3177c478bd9Sstevel@tonic-gate     - the ssh version string exchange
3187c478bd9Sstevel@tonic-gate     - the ssh message encoding/decoding
3197c478bd9Sstevel@tonic-gate     - most of the initial key exchange protocols
3207c478bd9Sstevel@tonic-gate     - transport protection
3217c478bd9Sstevel@tonic-gate     - part of the user authentication protocols
3227c478bd9Sstevel@tonic-gate
3237c478bd9Sstevel@tonic-gate    The OpenSSH session process implements:
3247c478bd9Sstevel@tonic-gate
3257c478bd9Sstevel@tonic-gate     - the ssh message encoding/decoding
3267c478bd9Sstevel@tonic-gate     - transport protection
3277c478bd9Sstevel@tonic-gate     - most of the re-keying protocols
3287c478bd9Sstevel@tonic-gate     - the session protocols
3297c478bd9Sstevel@tonic-gate
3307c478bd9Sstevel@tonic-gate    The OpenSSH monitor process implements:
3317c478bd9Sstevel@tonic-gate
3327c478bd9Sstevel@tonic-gate     - the ssh message encoding/decoding
3337c478bd9Sstevel@tonic-gate     - parts of the key exchange and re-key protocols (primarily signing
3347c478bd9Sstevel@tonic-gate       of server replies with host private keys)
3357c478bd9Sstevel@tonic-gate     - most of the user authentication protocols, specifically:
3367c478bd9Sstevel@tonic-gate
3377c478bd9Sstevel@tonic-gate        - evaluation of ~/.ssh/authorized_keys (for pubkey userauth)
3387c478bd9Sstevel@tonic-gate        - evaluation of known hosts files (for hostbased userauth)
3397c478bd9Sstevel@tonic-gate        - evaluation of .shosts/.rhosts files (for hostbased userauth)
3407c478bd9Sstevel@tonic-gate        - verification of signatures w/ public keys (pubkey, hostbased)
3417c478bd9Sstevel@tonic-gate	- PAM API calls, conversation function
3427c478bd9Sstevel@tonic-gate	- GSS-API calls
3437c478bd9Sstevel@tonic-gate
3447c478bd9Sstevel@tonic-gate       Note that any vulnerabilities in the parsing of authorized_keys,
3457c478bd9Sstevel@tonic-gate       known hosts and .shosts/rhosts files are as exploitable in the
3467c478bd9Sstevel@tonic-gate       monitor as in a server w/o privilege separation.
3477c478bd9Sstevel@tonic-gate
3487c478bd9Sstevel@tonic-gate       Similarly for any vulnerabilities in PAM modules and GSS-API
3497c478bd9Sstevel@tonic-gate       mechanisms.
3507c478bd9Sstevel@tonic-gate
3517c478bd9Sstevel@tonic-gate    The SUNWssh server involves two processes which we will term
3527c478bd9Sstevel@tonic-gate    "session" and "monitor."
3537c478bd9Sstevel@tonic-gate
3547c478bd9Sstevel@tonic-gate    The SUNWssh monitor process implements:
3557c478bd9Sstevel@tonic-gate
3567c478bd9Sstevel@tonic-gate     - the ssh version string exchange
3577c478bd9Sstevel@tonic-gate     - the ssh message encoding/decoding
3587c478bd9Sstevel@tonic-gate     - transport protection
3597c478bd9Sstevel@tonic-gate     - all of the key exchange and re-key protocols
3607c478bd9Sstevel@tonic-gate     - all of the user authentication protocols
3617c478bd9Sstevel@tonic-gate
3627c478bd9Sstevel@tonic-gate    The SUNWssh session process implements:
3637c478bd9Sstevel@tonic-gate
3647c478bd9Sstevel@tonic-gate     - the ssh message encoding/decoding
3657c478bd9Sstevel@tonic-gate     - transport protection
3667c478bd9Sstevel@tonic-gate     - the session protocols
3677c478bd9Sstevel@tonic-gate
3687c478bd9Sstevel@tonic-gate    Obviously all of these processes also implement their side of the
3697c478bd9Sstevel@tonic-gate    monitor protocols.
3707c478bd9Sstevel@tonic-gate
3717c478bd9Sstevel@tonic-gate    The OpenSSH 3.5p1 monitor protocol, on Solaris, has approximately 20
3727c478bd9Sstevel@tonic-gate    monitor request and corresponding response messages.
3737c478bd9Sstevel@tonic-gate
374*cd7d5fafSJan Pechanec    The SUNWssh monitor protocol has 5 monitor request and response
3757c478bd9Sstevel@tonic-gate    messages; additionally, the monitor processes standard re-key
3767c478bd9Sstevel@tonic-gate    messages (but note: the monitor and the session process IPC is
3777c478bd9Sstevel@tonic-gate    completely unencrypted), which amounts to about 14 more messages
3787c478bd9Sstevel@tonic-gate    altogether.
3797c478bd9Sstevel@tonic-gate
3807c478bd9Sstevel@tonic-gate    Much of the OpenSSH monitor protocol is a variation of the
3817c478bd9Sstevel@tonic-gate    on-the-wire ssh protocols, with some contents re-packaging.  We
3827c478bd9Sstevel@tonic-gate    believe this does not afford the monitor much additional, if any
3837c478bd9Sstevel@tonic-gate    protection from attacks in the key exchange and user authentication
3847c478bd9Sstevel@tonic-gate    protocols.
3857c478bd9Sstevel@tonic-gate
3867c478bd9Sstevel@tonic-gate    The re-packaging that is done in the OpenSSH monitor protocol is
3877c478bd9Sstevel@tonic-gate    risky business.  By separating the act of signing some blob of data
3887c478bd9Sstevel@tonic-gate    from computing that blob of data one can create an oracle; this is
3897c478bd9Sstevel@tonic-gate    exactly what happened in the OpenSSH case.
3907c478bd9Sstevel@tonic-gate
3917c478bd9Sstevel@tonic-gate    As you can see in the next section, the SUNWssh privilege separation
3927c478bd9Sstevel@tonic-gate    could evolve somewhat in the OpenSSH direction by saving the monitor
3937c478bd9Sstevel@tonic-gate    all transport protection work, but we cannot save the monitor much,
3947c478bd9Sstevel@tonic-gate    if any work relating to authentication or key exchange.
3957c478bd9Sstevel@tonic-gate
3967c478bd9Sstevel@tonic-gate
3977c478bd9Sstevel@tonic-gate7.  Future Directions
3987c478bd9Sstevel@tonic-gate
3997c478bd9Sstevel@tonic-gate    The SUNWssh server privilege separation implementation could stand
4007c478bd9Sstevel@tonic-gate    several improvements.
4017c478bd9Sstevel@tonic-gate
4027c478bd9Sstevel@tonic-gate    The first improvement would be to have a single system-wide monitor.
4037c478bd9Sstevel@tonic-gate    This would reduce resource consumption.  The work needed to
4047c478bd9Sstevel@tonic-gate    implement such an enhancement is very similar to the work needed to
4057c478bd9Sstevel@tonic-gate    produce an SSH API and library, and it is not trivial.  If this is
4067c478bd9Sstevel@tonic-gate    not done then at least dropping PRIV_PROC_SETID and instead setting
4077c478bd9Sstevel@tonic-gate    the saved-set-user-id in the monitor to that of the logged in user
4087c478bd9Sstevel@tonic-gate    would be nice.
4097c478bd9Sstevel@tonic-gate
4107c478bd9Sstevel@tonic-gate    The second enhancement would be to add a "none" host key algorithm
4117c478bd9Sstevel@tonic-gate    to SSHv2 and a corresponding option in SUNWssh to disallow re-keying
4127c478bd9Sstevel@tonic-gate    with any other host key algorithm.  This would allow customers to
4137c478bd9Sstevel@tonic-gate    configure their server and monitor so that no re-key protocol
4147c478bd9Sstevel@tonic-gate    messages need be processed by the monitor.
4157c478bd9Sstevel@tonic-gate
4167c478bd9Sstevel@tonic-gate    A third enhancement would be to enhance the GSS-API mechanisms to
4177c478bd9Sstevel@tonic-gate    require fewer privileges.  In practice this means overhauling the
4187c478bd9Sstevel@tonic-gate    Kerberos V mechanism's replay cache.  This would allow the monitor
4197c478bd9Sstevel@tonic-gate    to run with fewer privileges.
4207c478bd9Sstevel@tonic-gate
4217c478bd9Sstevel@tonic-gate    Further, even without improving the Kerberos V mechanism's replay
4227c478bd9Sstevel@tonic-gate    cache it should be possible to drop at least PRIV_PROC_FORK/EXEC/
4237c478bd9Sstevel@tonic-gate    SESSION.
4247c478bd9Sstevel@tonic-gate
4257c478bd9Sstevel@tonic-gate    A fourth enhancement would to have the unprivileged process handle
4267c478bd9Sstevel@tonic-gate    all transport protection and proxy to the monitor all key exchange
4277c478bd9Sstevel@tonic-gate    and user authentication protocol messages.  This is a variation on
4287c478bd9Sstevel@tonic-gate    the OpenSSH model, but without the re-packaging of ssh message
4297c478bd9Sstevel@tonic-gate    contents seen there.  After authentication succeeds the monitor
4307c478bd9Sstevel@tonic-gate    could either change the unprivileged process' credentials (as can be
4317c478bd9Sstevel@tonic-gate    done with ppriv(1) or the unprivileged process would, as in OpenSSH,
4327c478bd9Sstevel@tonic-gate    pass the session keys/IVs/keystate to the monitor which would then
4337c478bd9Sstevel@tonic-gate    pass them to a new process, the session process, that would then run
4347c478bd9Sstevel@tonic-gate    as the logged in user.
4357c478bd9Sstevel@tonic-gate
4367c478bd9Sstevel@tonic-gate
4377c478bd9Sstevel@tonic-gate8.  Guide to the AltPrivSep Source Code
4387c478bd9Sstevel@tonic-gate
4397c478bd9Sstevel@tonic-gate
4407c478bd9Sstevel@tonic-gate    First, a brief introduction to the SUNWssh/OpenSSH source code.
4417c478bd9Sstevel@tonic-gate
4427c478bd9Sstevel@tonic-gate    The source code is organized as follows:
4437c478bd9Sstevel@tonic-gate
4447c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/etc/
4457c478bd9Sstevel@tonic-gate	    |
4467c478bd9Sstevel@tonic-gate	    +-> config files
4477c478bd9Sstevel@tonic-gate
4487c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/include/
4497c478bd9Sstevel@tonic-gate	    |
4507c478bd9Sstevel@tonic-gate	    +-> header files (note: none are installed/shipped)
4517c478bd9Sstevel@tonic-gate
4527c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/libopenbsd-compat/common/
4537c478bd9Sstevel@tonic-gate	    |
4547c478bd9Sstevel@tonic-gate	    +-> misc. portability source code
4557c478bd9Sstevel@tonic-gate
4567c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/libssh/common/
4577c478bd9Sstevel@tonic-gate	    |
4587c478bd9Sstevel@tonic-gate	    +-> implementation of encoding, transport protection,
4597c478bd9Sstevel@tonic-gate		various wrappers around cryptography, the key exchange
4607c478bd9Sstevel@tonic-gate		and host authentication protocols, the session
4617c478bd9Sstevel@tonic-gate		protocols, and misc. other code
4627c478bd9Sstevel@tonic-gate
4637c478bd9Sstevel@tonic-gate		cipher.c
4647c478bd9Sstevel@tonic-gate		mac.c
4657c478bd9Sstevel@tonic-gate		compress.c
4667c478bd9Sstevel@tonic-gate		packet.c
4677c478bd9Sstevel@tonic-gate		    |
4687c478bd9Sstevel@tonic-gate		    +-> transport protocol
4697c478bd9Sstevel@tonic-gate
4707c478bd9Sstevel@tonic-gate		buffer.c
4717c478bd9Sstevel@tonic-gate		bufaux.c
4727c478bd9Sstevel@tonic-gate		    |
4737c478bd9Sstevel@tonic-gate		    +-> encoding
4747c478bd9Sstevel@tonic-gate
4757c478bd9Sstevel@tonic-gate		channels.c
4767c478bd9Sstevel@tonic-gate		nchan.c
4777c478bd9Sstevel@tonic-gate		    |
4787c478bd9Sstevel@tonic-gate		    +-> session protocol
4797c478bd9Sstevel@tonic-gate
4807c478bd9Sstevel@tonic-gate		kex.c
4817c478bd9Sstevel@tonic-gate		kexdh.c
4827c478bd9Sstevel@tonic-gate		kexgex.c
4837c478bd9Sstevel@tonic-gate		    |
4847c478bd9Sstevel@tonic-gate		    +-> key exchange/re-key code common to ssh and sshd
4857c478bd9Sstevel@tonic-gate
4867c478bd9Sstevel@tonic-gate		kexdhs.c
4877c478bd9Sstevel@tonic-gate		kexgexs.c
4887c478bd9Sstevel@tonic-gate		kexgsss.c
4897c478bd9Sstevel@tonic-gate		    |
4907c478bd9Sstevel@tonic-gate		    +-> key exchange/re-key code (server only)
4917c478bd9Sstevel@tonic-gate
4927c478bd9Sstevel@tonic-gate		kexdhc.c
4937c478bd9Sstevel@tonic-gate		kexgexc.c
4947c478bd9Sstevel@tonic-gate		kexgssc.c
4957c478bd9Sstevel@tonic-gate		    |
4967c478bd9Sstevel@tonic-gate		    +-> key exchange/re-key code (client only)
4977c478bd9Sstevel@tonic-gate
4987c478bd9Sstevel@tonic-gate		dh.c
4997c478bd9Sstevel@tonic-gate		rsa.c
5007c478bd9Sstevel@tonic-gate		mpaux.c
5017c478bd9Sstevel@tonic-gate		ssh-rsa.c
5027c478bd9Sstevel@tonic-gate		ssh-dss.c
5037c478bd9Sstevel@tonic-gate		ssh-gss.c
5047c478bd9Sstevel@tonic-gate		    |
5057c478bd9Sstevel@tonic-gate		    +-> crypto wrappers/utilities
5067c478bd9Sstevel@tonic-gate
5077c478bd9Sstevel@tonic-gate		log.c
5087c478bd9Sstevel@tonic-gate		    |
5097c478bd9Sstevel@tonic-gate		    +-> logging, including debug logging, on stderr or
5107c478bd9Sstevel@tonic-gate			syslog
5117c478bd9Sstevel@tonic-gate
5127c478bd9Sstevel@tonic-gate
5137c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/ssh/
5147c478bd9Sstevel@tonic-gate	    |
5157c478bd9Sstevel@tonic-gate	    +-> ssh(1)
5167c478bd9Sstevel@tonic-gate
5177c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/sshd/
5187c478bd9Sstevel@tonic-gate	    |
5197c478bd9Sstevel@tonic-gate	    +-> sshd(1M), including auditing, implementation of user
5207c478bd9Sstevel@tonic-gate		authentication and the OpenSSH and SUNWssh monitors
5217c478bd9Sstevel@tonic-gate
5227c478bd9Sstevel@tonic-gate		sshd.c
5237c478bd9Sstevel@tonic-gate		    |
5247c478bd9Sstevel@tonic-gate		    +-> main()
5257c478bd9Sstevel@tonic-gate
5267c478bd9Sstevel@tonic-gate		auth*.c
5277c478bd9Sstevel@tonic-gate		    |
5287c478bd9Sstevel@tonic-gate		    +-> user authentication
5297c478bd9Sstevel@tonic-gate
5307c478bd9Sstevel@tonic-gate		serverloop.c
5317c478bd9Sstevel@tonic-gate		session.c
5327c478bd9Sstevel@tonic-gate		    |
5337c478bd9Sstevel@tonic-gate		    +-> session protocols
5347c478bd9Sstevel@tonic-gate
5357c478bd9Sstevel@tonic-gate		bsmaudit.[ch]
5367c478bd9Sstevel@tonic-gate		sshlogin.c
5377c478bd9Sstevel@tonic-gate		loginrec.c
5387c478bd9Sstevel@tonic-gate		    |
5397c478bd9Sstevel@tonic-gate		    +-> auditing and record-keeping
5407c478bd9Sstevel@tonic-gate
5417c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/<misc commands>/
5427c478bd9Sstevel@tonic-gate	    |
5437c478bd9Sstevel@tonic-gate	    +-> scp, sftp, sftp-server, ssh-agent, ssh-add, ...
5447c478bd9Sstevel@tonic-gate
5457c478bd9Sstevel@tonic-gate
5467c478bd9Sstevel@tonic-gate    The SUNWssh altprivsep adds two new source files:
5477c478bd9Sstevel@tonic-gate
5487c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/include/altprivsep.h
5497c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/sshd/altprivsep.c
5507c478bd9Sstevel@tonic-gate	    |
5517c478bd9Sstevel@tonic-gate	    +-> monitor start routine, altprivsep_packet_*() routines
5527c478bd9Sstevel@tonic-gate		for communication with the monitor, routines to help
5537c478bd9Sstevel@tonic-gate		with key exchanges, service procedures for the monitor,
5547c478bd9Sstevel@tonic-gate		etc...
5557c478bd9Sstevel@tonic-gate
5567c478bd9Sstevel@tonic-gate    and modifies the following:
5577c478bd9Sstevel@tonic-gate
5587c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/include/config.h
5597c478bd9Sstevel@tonic-gate	    |
5607c478bd9Sstevel@tonic-gate	    +> adds cpp define "ALTPRIVSEP"
5617c478bd9Sstevel@tonic-gate
5627c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/include/ssh2.h
5637c478bd9Sstevel@tonic-gate	    |
5647c478bd9Sstevel@tonic-gate	    +-> adds private message type "SSH2_PRIV_MSG_ALTPRIVSEP" (254)
5657c478bd9Sstevel@tonic-gate
5667c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/include/packet.h
5677c478bd9Sstevel@tonic-gate	    |
5687c478bd9Sstevel@tonic-gate	    +-> adds prototypes for several simple utility functions,
5697c478bd9Sstevel@tonic-gate		some of which are specifically meant to avoid having to
5707c478bd9Sstevel@tonic-gate		link altprivsep.c into ssh(1)
5717c478bd9Sstevel@tonic-gate
5727c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/libssh/common/kex.c
5737c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/libssh/common/packet.c
5747c478bd9Sstevel@tonic-gate	    |
5757c478bd9Sstevel@tonic-gate	    +-> implements the hooks needed to proxy re-key messages
5767c478bd9Sstevel@tonic-gate		to/from the monitor
5777c478bd9Sstevel@tonic-gate
5787c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/sshd/Makefile
5797c478bd9Sstevel@tonic-gate	    |
5807c478bd9Sstevel@tonic-gate	    +-> adds altprivsep.o to list of objects linked into sshd(1M)
5817c478bd9Sstevel@tonic-gate
5827c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/sshd/serverloop.c
5837c478bd9Sstevel@tonic-gate	    |
5847c478bd9Sstevel@tonic-gate	    +-> adds an event loop for the monitor
5857c478bd9Sstevel@tonic-gate		modifies the usual event loops for SSHv2
5867c478bd9Sstevel@tonic-gate
5877c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/sshd/session.c
5887c478bd9Sstevel@tonic-gate	    |
5897c478bd9Sstevel@tonic-gate	    +-> modifies do_login() and session_pty_cleanup2() to call
5907c478bd9Sstevel@tonic-gate		altprivsep_record_login/logout() instead of
5917c478bd9Sstevel@tonic-gate		record_login/logout().
5927c478bd9Sstevel@tonic-gate
5937c478bd9Sstevel@tonic-gate		modifies do_exec_pty() so that the server waits for the
5947c478bd9Sstevel@tonic-gate		call to altprivsep_record_login() in child process to
5957c478bd9Sstevel@tonic-gate		complete before returning so that the server and the
5967c478bd9Sstevel@tonic-gate		child processes do not compete for monitor IPC I/O.
5977c478bd9Sstevel@tonic-gate
5987c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/include/log.h
5997c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/libssh/common/log.c
6007c478bd9Sstevel@tonic-gate	    |
6017c478bd9Sstevel@tonic-gate	    +-> adds an internal interface, set_log_txt_prefix() so that
6027c478bd9Sstevel@tonic-gate		the monitor's debug and log messages get prefixed with a
6037c478bd9Sstevel@tonic-gate		string ("monitor ") that indicates they are from the
6047c478bd9Sstevel@tonic-gate		monitor
6057c478bd9Sstevel@tonic-gate
6067c478bd9Sstevel@tonic-gate	$SRC/cmd/ssh/sshd/sshd.c
6077c478bd9Sstevel@tonic-gate	    |
6087c478bd9Sstevel@tonic-gate	    +-> modifies the body of code that follows the user
6097c478bd9Sstevel@tonic-gate		authentication phase of the ssh protocols so as to start
6107c478bd9Sstevel@tonic-gate		the monitor and move the relevant code into the monitor
6117c478bd9Sstevel@tonic-gate		or session processes as appropriate while dropping
6127c478bd9Sstevel@tonic-gate		privileges and access to privileged resources in the
6137c478bd9Sstevel@tonic-gate		session process
6147c478bd9Sstevel@tonic-gate
6157c478bd9Sstevel@tonic-gate    The monitor uses the packet.h interfaces to communicate with the
6167c478bd9Sstevel@tonic-gate    session process as though it were its ssh client peer, but always
6177c478bd9Sstevel@tonic-gate    uses the "none" cipher, mac and compression algorithms and installs
6187c478bd9Sstevel@tonic-gate    even handlers only for the relevant key exchange messages and the
6197c478bd9Sstevel@tonic-gate    private monitor message used for the other monitor services.
6207c478bd9Sstevel@tonic-gate
6217c478bd9Sstevel@tonic-gate    The monitor serves the following services:
6227c478bd9Sstevel@tonic-gate
6237c478bd9Sstevel@tonic-gate     - APS_MSG_NEWKEYS_REQ	-> used to obtain keys/IVs after re-keys
6247c478bd9Sstevel@tonic-gate     - APS_MSG_RECORD_LOGIN	-> used to update utmpx/wtmpx
6257c478bd9Sstevel@tonic-gate     - APS_MSG_RECORD_LOGOUT	-> used to update utmpx/wtmpx
6267c478bd9Sstevel@tonic-gate
6277c478bd9Sstevel@tonic-gate    The session and monitor processes communicate over a pipe.
6287c478bd9Sstevel@tonic-gate
6297c478bd9Sstevel@tonic-gate    All monitor IPC I/O from the session process is blocking (though the
6307c478bd9Sstevel@tonic-gate    pipe is set to non-blocking I/O).  The monitor protocol is entirely
6317c478bd9Sstevel@tonic-gate    synchronous and relies on the re-key protocols being entirely
6327c478bd9Sstevel@tonic-gate    synchronous also (which they are, unlike the session protocols).
6337c478bd9Sstevel@tonic-gate
6347c478bd9Sstevel@tonic-gate    The kex.c and packet.c files are minimally modified, primarily to
6357c478bd9Sstevel@tonic-gate    prevent the monitor from handling SSH_MSG_NEWKEYS messages as a
6367c478bd9Sstevel@tonic-gate    normal ssh server should, instead letting the session process
6377c478bd9Sstevel@tonic-gate    process SSH_MSG_NEWKEYS messages by requesting the new keys
6387c478bd9Sstevel@tonic-gate    negotiated with client from the monitor.
6397c478bd9Sstevel@tonic-gate
6407c478bd9Sstevel@tonic-gate    Note that for SSHv1 no on-the-wire messages are processed by the
6417c478bd9Sstevel@tonic-gate    monitor after authentication.  In fact, the monitor thinks it's
6429a8058b5Sjp161948    running SSHv2, even if the on-the-wire protocol is v1.
6437c478bd9Sstevel@tonic-gate
6447c478bd9Sstevel@tonic-gate
6457c478bd9Sstevel@tonic-gateA.  References
6467c478bd9Sstevel@tonic-gate
6477c478bd9Sstevel@tonic-gate    The IETF SECSH Working Group:
6487c478bd9Sstevel@tonic-gate
6497c478bd9Sstevel@tonic-gate	http://www.ietf.org/html.charters/secsh-charter.html
6507c478bd9Sstevel@tonic-gate
6517c478bd9Sstevel@tonic-gate    The SSHv2 architecture, assigned numbers:
6527c478bd9Sstevel@tonic-gate
6537c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-architecture-16.txt
6547c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-assignednumbers-06.txt
6557c478bd9Sstevel@tonic-gate
6567c478bd9Sstevel@tonic-gate    New cipher modes for SSHv2:
6577c478bd9Sstevel@tonic-gate
6587c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-newmodes-02.txt
6597c478bd9Sstevel@tonic-gate
6607c478bd9Sstevel@tonic-gate    The SSHv2 "transport," including initial key exchange and re-key
6617c478bd9Sstevel@tonic-gate    protocols, but excluding negotiable DH group size and GSS-API-based
6627c478bd9Sstevel@tonic-gate    key exchange:
6637c478bd9Sstevel@tonic-gate
6647c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-transport-18.txt
6657c478bd9Sstevel@tonic-gate
6667c478bd9Sstevel@tonic-gate    Additional key exchange protocols for SSHv2:
6677c478bd9Sstevel@tonic-gate
6687c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-gsskeyex-08.txt
6697c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-dh-group-exchange-04.txt
6707c478bd9Sstevel@tonic-gate
6717c478bd9Sstevel@tonic-gate    Base user authentication spec for SSHv2 (includes none, password,
6727c478bd9Sstevel@tonic-gate    pubkey and hostbased user authentication):
6737c478bd9Sstevel@tonic-gate
6747c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-userauth-21.txt
6757c478bd9Sstevel@tonic-gate
6767c478bd9Sstevel@tonic-gate    SSHv2 user authentication using PAM-style prompting:
6777c478bd9Sstevel@tonic-gate
6787c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-auth-kbdinteract-06.txt
6797c478bd9Sstevel@tonic-gate
6807c478bd9Sstevel@tonic-gate    SSHv2 user authentication using the GSS-API:
6817c478bd9Sstevel@tonic-gate
6827c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-gsskeyex-08.txt
6837c478bd9Sstevel@tonic-gate
6847c478bd9Sstevel@tonic-gate    SSHv2 "session" protocol (i.e., the protocol used for pty sessions,
6857c478bd9Sstevel@tonic-gate    port forwarding, agent forwarding, X display forwarding, etc...):
6867c478bd9Sstevel@tonic-gate
6877c478bd9Sstevel@tonic-gate	http://www.ietf.org/internet-drafts/draft-ietf-secsh-connect-19.txt
688