Running programs in controlled environment

When flexibility, speed and security can go hand in hand

On Shared libraries I said that running the programs into a controlled environment can avoid the Shared libraries attack. Well, there is much more than that. This is a perfect example of how flexibility, convenience and security can goes hand in hand. Not just it help avoiding the shared library attack, but it also provide a easy way of installing individual programs in his own location. For example, KDE programs search for their resources relatively to the paths listed into the KDEDIRS environment variable. If one wish to install a big number of KDE programs each into his own directory, he have to update KDEDIRS with a big number of directories. This not just will slow down the programs (who have to search a very large number of directories till find what it need) but in case we want to have 2 or more different versions of the same program, we can get conflicts betwen resources.
The same is valid for shared libraries directories (imagine a LD_LIBRARY_PATH with 100 or more entries) and with PATH (since many packages come with auxiliary executables, it rely on PATH for finding them). It is obviously, that a version of LD_LIBRARY_PATH attack, can work for PATH variable too. So, by having the possibility to start programs into a controlled environment, we can get benefits in: security, flexibility and speed.

How to achieve that

Sys++ components for running programs in controlled environment

The easy way to run a program into a controlled environment is to use a shell script who set the environment variables it need, then exec the program. Well, as I presented in ShLib controlled, a eventually virus, may use LD_PRELOAD variable to attack the exec* family of function from /bin/bash. This is possible since bash is dynamically linked with libc. By doing so, it(the virus) get the opportunity to reverse all the security settings done by script, thus letting the target program vulnerable to LD_PREALOD and/or LD_LIBRARY_PATH attack. Another problem with using a bash script is that it proliferate the"overscripting abuse". A bash script is not easy to manipulate by GUI editors, and it need to be edited/maintained by a administrator rather than a automated program. This is not the way to go, especially for "Unix on desktop".
The solution I propose, is a small program self contained(statically linked) so it doesn't depend by any shared library (thus invulnerable to shared library attack). This program will read a XML file (rather than a bash program), who describe the environment the program have to run into. This XML file is much easy to edit than a bash script, and can be managed by software rather than by humans (with vi, joe or emacs:-). The XML file, also enable that every program (started by such a file) have associated with it a icon, a description, electronic signature and so on. Better than in Windows, isn't it :-)

Sys++ environment controllers

In Sys++, there come 3 different programs, intended to run another program into a controlled environment: The executables for these 3 programs and the GUI for managing the trust database, will be available for download from this page some times in near future. Keep watch it.


Advanced Unix programming techniques page

Sys++ Project Home page

Visit M.T.M. Home Page