Privilege Separated OpenSSH (original) (raw)

We use an unprivileged child process to contain and restrict the effects of programming errors. A bug in the unprivileged child process does not result in a system compromise. In other words, the goal is complete privilege separation within in OpenSSH.

| Privilege separation uses two processes: The privileged parent process that monitors the progress of the unprivileged child process. The child process is unprivileged. This is achieved by changing its uid/gid to an unused user and restricting its file system access via chroot() to /var/empty. It is the only process that processes network data. The privileged parent can be modelled by a very small finite-state machine so that it is easy to reason about the code that is being executed with privileges.A well defined interface between privileged parent and unprivileged child allows the child to delegate operations that require privileges to the parent. Successful authentication is determined by the parent process.Communication between the privileged and the unprivileged process is achieved by pipes. Shared memory stores state that can not be otherwise exported. The child has to ask the privileged parent to determine if authentication was successful or not. | | Diagram | | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ---------------------------------------------------------------------------------------------------------------------- |

If the child process gets corrupted and believes that the remote user has been authenticated, access will not be granted unless the parent has reached the same decision.

Previously any corruption in the sshd could lead to an immediate remote root compromise if it happened before authentication, and to local root compromise if it happend after authentication.Privilege Separation will make suchcompromise very difficult if not impossible. Privilege separation is a powerful principle to improve cyber security that can also be applied to other authentication services.

Project Status

References

Source code

The source code is available in the OpenBSD CVS respository.

Acknowledgments

Markus Friedlhas helped with writing code for privilege separation and his suggestions have improved its quality significantly.

Portability

Maintaining portability is a high priority. The interface to the shared memory is very well abstracted and should be easy to re-implement on operating systems that do not support anonymous memory maps.

The portable OpenSSH supports Privilege Separation. A few issues with some operating systems are still being worked on.