| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 | 
              Graphene Library OS with Intel SGX Support        A Linux-compatible Library OS for Multi-Process Applications1. WHAT IS GRAPHENE?Graphene Library OS is a project to provided lightweight guest OSes withsupport for Linux multi-process applications. Comparable to virtualmachines, Graphene can run applications in an isolated environment, withvirtualization benefits such as guest customization, platform independenceand migration.Graphene Library OS supports native, unmodified Linux appliations uponany platform that Graphene Library OS has been ported to. Currently,Graphene Library OS is successfully ported to Linux, FreeBSD and Intel SGXenclaves upon Linux platforms.With the Intel SGX support, Graphene Library OS can secure a criticalapplication in a hardware encrypted memory region. Graphene Library OS canprotect applications against malicious system stack, with minimal portingeffort.Graphene Library OS is a work published in Eurosys 2014. For moreinformation. see the paper: Tsai, et al, "Cooperation and Security Isolationof Library OSes for Multi-Process Applications", Eurosys 2014.2. HOW TO BUILD GRAPHENE?Graphene Library OS is consist of five parts:  - Instrumented GNU Library C  - LibOS (a shared library named "libsysdb.so")  - PAL, a.k.a Platform Adaption Layer (a shared library named "libpal.so")  - Reference monitor (a shared library named "libpal_sec.so")  - Minor kernel customization and kernel modulesGraphene Library OS currently only works on x86_64 architecture.Graphene Library OS is tested to be compiling and running on Ubuntu 12.04/14.04(both server and desktop version), along with Linux kernel 3.5/3.14.We recommand to build and install Graphene with the same host platform.Other distributions of 64-bit Linux can potentially, but the result is notguaranteed. If you find Graphene not working on other distributions, pleasecontact us with a detailed bug report.The following packages are required for building Graphene: (can be installedwith 'apt-get install')   - build-essential   - autoconf   - gawkThe following packages are also required for building Graphene for SGX (canbe installed with 'apt-get install'):   - python-protobuf   - python-cryptoTo build the system, simply run the following commands in the root of thesource tree:    make    (Add Graphene kernel as a boot option by commands like "update-grub")    (reboot and choose the Graphene kernel)Please note that the building process may pause before building the Linuxkernel, because it requires you to provide a sensible configuration file(.config). The Graphene kernel requires the following options to be enabledin the configuration:  - CONFIG_GRAPHENE=y  - CONFIG_GRAPHENE_BULK_IPC=y  - CONFIG_GRAPHENE_ISOLATE=yEach part of Graphene can be built separately in the subdirectories.To build Graphene library OS with debug symbols, run "make DEBUG=1" instead of"make".For more details about the building and installation, see the Graphene githubWiki page: <https://github.com/oscarlab/graphene/wiki>.    2-1. BUILD WITH INTEL SGX SUPPORTTo build Graphene Library OS with Intel SGX support, run "make SGX=1" insteadof "make". "DEBUG=1" can be used to build with debug symbols. Using "make SGX=1"in the test or regression directory will automatically generate the enclavesignatures (in .sig files).A 3072-bit RSA private key (PEM format) is required for signing the enclaves.The default enclave key is placed in 'host/Linux-SGX/signer/enclave-key.pem',or the key can be specified through environment variable 'SGX_ENCLAVE_KEY'when building Graphene with Intel SGX support. If you don't have a private key,create it with the following command:    openssl genrsa -3 -out enclave-key.pem 3072After signing the enclaves, users may ship the application files with thebuilt Graphene Library OS, along with a SGX-specific manifest (.manifest.sgxfiles) and the signatures, to the Intel SGX-enabled hosts. The Intel SGXLinux SDK is required for running Graphene Library OS. Download and installfrom the official Intel github repositories:    <https://github.com/01org/linux-sgx>    <https://github.com/01org/linux-sgx-driver>A Linux driver must be installed before runing Graphene Library OS in enclaves.Simply run the following command to build the driver:    cd Pal/src/host/Linux-SGX/sgx-driver    make    (The console will be prompted to ask for the path of Intel SGX driver code)    sudo ./load.shFinally generating the runtime enclave tokens by running "make SGX_RUN=1".3. HOW TO RUN AN APPLICATION IN GRAPHENE?Graphene library OS uses PAL (libpal.so) as a loader to bootstrap anapplication in the library OS. To start Graphene, PAL (libpal.so) will haveto be run as an executable, with the name of the program, and a "manifestfile" given from the command line. Graphene provides three options forspcifying the programs and manifest files:    option 1: (automatic manifest)    [PATH TO Runtime]/pal_loader [PROGRAM] [ARGUMENTS]...    (Manifest file: "[PROGRAM].manifest" or "manifest")    option 2: (given manifest)    [PATH TO Runtime]/pal_loader [MANIFEST] [ARGUMENTS]...    option 3: (manifest as a script)    [PATH TO MANIFEST]/[MANIFEST] [ARGUMENTS]...    (Manifest must have "#![PATH_TO_PAL]/libpal.so" as the first line)Using "libpal.so" as loader to start Graphene will not attach the applicationsto the Graphene reference monitor. Tha applications will have betterperformance, but no strong security isolation. To attach the applications tothe Graphene reference monitor, Graphene must be started with the PALreference monitor loader (libpal_sec.so). Graphene provides three options forspcifying the programs and manifest files to the loader:    option 4: (automatic manifest - with reference monitor)    SEC=1 [PATH TO Runtime]/pal_loader [PROGRAM] [ARGUMENTS]...    (Manifest file: "[PROGRAM].manifest" or "manifest")    option 5: (given manifest - with reference monitor)    SEC=1 [PATH TO Pal/src]/pal_loader [MANIFEST] [ARGUMENTS]...    option 6: (manifest as a script - with reference monitor)    SEC=1 [PATH TO MANIFEST]/[MANIFEST] [ARGUMENTS]...    (Manifest must have "#![PATH TO Pal/src]/pal_sec" as the first line)Although manifest files are optional for Graphene, running an applicationusually requires some minimal configuration in its manifest file. Asensible manifest file will include paths to the library OS and GNUlibrary C, environment variables such as LD_LIBRARY_PATH, file systems tobe mounted, and isolation rules to be enforced in the reference monitor.Here is an example of manifest files:    loader.preload = file:LibOS/shim/src/libsysdb.so    loader.env.LDL_LIBRAY_PATH = /lib    fs.mount.glibc.type = chroot    fs.mount.glibc.path = /lib    fs.mount.glibc.uri = file:LibOS/buildMore examples can be found in the test directories (LibOS/shim/test). We havealso tested several commercial applications such as GCC, Bash and Apache,and the manifest files that bootstrap them in Graphene are provided in theindividual directories.For more information and the detail of the manifest syntax, see the Graphenegithub Wiki page: <https://github.com/oscarlab/graphene/wiki>.4. HOW TO CONTACT THE MAINTAINER?For any questions or bug reports, please contact us:Chia-Che Tsai <chitsai@cs.stonybrook.edu>Donald Porter <porter@cs.stonybrook.edu>or post an issue on our github repository:        <https://github.com/oscarlab/graphene/issues>
 |