diff --git a/Documentation/cloud-deployment.rst b/Documentation/cloud-deployment.rst index 634a4160..e9ab4bbe 100644 --- a/Documentation/cloud-deployment.rst +++ b/Documentation/cloud-deployment.rst @@ -114,7 +114,7 @@ cluster. #. Create the application-specific Manifest file :file:`python.manifest`:: - sgx.enclave_size = 256M + sgx.enclave_size = "256M" sgx.thread_num = 4 #. Graphenize the Python image and allow insecure runtime arguments:: diff --git a/Documentation/devel/performance.rst b/Documentation/devel/performance.rst index e65dbc45..4fd05829 100644 --- a/Documentation/devel/performance.rst +++ b/Documentation/devel/performance.rst @@ -370,16 +370,17 @@ particular, build Graphene in non-debug configuration (simple ``make SGX=1`` defaults to non-debug configuration). Also build the application itself in non-debug configuration (again, typically simple ``make SGX=1`` is sufficient). Finally, disable the debug log of Graphene by specifying the manifest option -``loader.debug_type = none``. +``loader.debug_type = "none"``. If your application periodically fails and complains about seemingly irrelevant things, it may be due to insufficient enclave memory. Please try to increase -enclave size by tweaking ``sgx.enclave_size=512M``, ``sgx.enclave_size=1G``, -``sgx.enclave_size=2G``, and so on. If this doesn't help, it could be due to -insufficient stack size: in this case try to increase ``sys.stack.size=256K``, -``sys.stack.size=2M``, ``sys.stack.size=4M`` and so on. Finally, if Graphene -complains about insufficient number of TCSs or threads, increase -``sgx.thread_num=4``, ``sgx.thread_num=8``, ``sgx.thread_num=16``, and so on. +enclave size by tweaking ``sgx.enclave_size = "512M"``, +``sgx.enclave_size = "1G"``, ``sgx.enclave_size = "2G"``, and so on. If this +doesn't help, it could be due to insufficient stack size: in this case try to +increase ``sys.stack.size = "256K"``, ``sys.stack.size = "2M"``, +``sys.stack.size = "4M"`` and so on. Finally, if Graphene complains about +insufficient number of TCSs or threads, increase ``sgx.thread_num = 4``, +``sgx.thread_num = 8``, ``sgx.thread_num = 16``, and so on. Do not forget about the cost of software encryption! Graphene transparently encrypts many means of communication: @@ -406,11 +407,11 @@ Once Graphene moves to a better manifest parser, this won't be an issue. Finally, recall that by default Graphene doesn't propagate environment variables into the SGX enclave. Thus, environment variables like ``OMP_NUM_THREADS`` and -``MKL_NUM_THREADS`` are not visible to the graphenized application by default. To -propagate them into the enclave, either use the insecure manifest option -``loader.insecure__use_host_env=1`` (don't use this in production!) or specify them -explicitly in the manifest via ``loader.env.OMP_NUM_THREADS=8``. Also, it is -always better to specify such environment variables explicitly because a +``MKL_NUM_THREADS`` are not visible to the graphenized application by default. +To propagate them into the enclave, either use the insecure manifest option +``loader.insecure__use_host_env = 1`` (don't use this in production!) or specify +them explicitly in the manifest via ``loader.env.OMP_NUM_THREADS = "8"``. Also, +it is always better to specify such environment variables explicitly because a graphenized application may determine the number of available CPUs incorrectly. .. _perf: diff --git a/Documentation/manifest-syntax.rst b/Documentation/manifest-syntax.rst index 9e33501c..aaa9e738 100644 --- a/Documentation/manifest-syntax.rst +++ b/Documentation/manifest-syntax.rst @@ -5,18 +5,20 @@ Manifest syntax A |~| manifest file is an application-specific configuration text file that specifies the environment and resources for running an application inside -Graphene. A |~| manifest file contains entries separated by line breaks. Each -configuration entry consists of a |~| key and a |~| value. Whitespaces -before/after the key and before/after the value are ignored. The value can be -written in quotes, indicating that the value should be assigned to this string -verbatim. (The quotes syntax is useful for values with leading/trailing -whitespaces, e.g. ``" SPACES! "``.) Each entry must be in the following format:: +Graphene. A |~| manifest file contains key-value pairs (as well as more +complicated table and array objects) in the TOML syntax. For the details of the +TOML syntax, see `the official documentation `__. - [Key][.Key][.Key] = [Value] or [Key][.Key][.Key] = "[Value]" +A typical string entry looks like this:: + + [Key][.Key][.Key] = "[Value]" + +A typical integer entry looks similar to the above but without double quotes:: + + [Key][.Key][.Key] = [Value] Comments can be inlined in a |~| manifest by starting them with a |~| hash sign -(``# comment...``). Any text after a |~| hash sign will be considered part of -a |~| comment and discarded while loading the manifest file. +(``# comment...``). Common syntax ------------- @@ -26,8 +28,8 @@ Debug type :: - loader.debug_type=[none|inline] - (Default: none) + loader.debug_type = "[none|inline]" + (Default: "none") This specifies the debug option while running the library OS. If the debug type is ``none``, no debug output will be printed to standard output. If the debug @@ -39,7 +41,7 @@ Preloaded libraries :: - loader.preload=[URI][,URI]... + loader.preload = "[URI][,URI]..." This syntax specifies the libraries to be preloaded before loading the executable. The URIs of the libraries must be separated by commas. The libraries @@ -50,7 +52,7 @@ Command-line arguments :: - loader.argv0_override=[STRING] + loader.argv0_override = "[STRING]" This syntax specifies an arbitrary string (typically the executable name) that will be passed as the first argument (``argv[0]``) to the executable. @@ -66,7 +68,7 @@ or :: - loader.argv_src_file = file:file_with_serialized_argv + loader.argv_src_file = "file:file_with_serialized_argv" If you want your application to use commandline arguments you need to either set ``loader.insecure__use_cmdline_argv`` (insecure in almost all cases) or point @@ -98,8 +100,8 @@ both of the following options: :: - loader.env.[ENVIRON]=[VALUE] - loader.env_src_file = file:file_with_serialized_envs + loader.env.[ENVIRON] = "[VALUE]" + loader.env_src_file = "file:file_with_serialized_envs" ``loader.env.[ENVIRON]`` adds/overwrites a single environment variable and can be used multiple times to specify more than one variable. @@ -121,7 +123,7 @@ Disabling ASLR :: - loader.insecure__disable_aslr=[1|0] + loader.insecure__disable_aslr = [1|0] (Default: 0) This specifies whether to disable Address Space Layout Randomization (ASLR). @@ -133,8 +135,8 @@ Graphene internal metadata size :: - loader.pal_internal_mem_size=[SIZE] - (default: 0) + loader.pal_internal_mem_size = "[SIZE]" + (default: "0") This syntax specifies how much additional memory Graphene reserves for its internal use (e.g., metadata for trusted/protected files, internal handles, @@ -144,7 +146,7 @@ Graphene loudly fails with "out of PAL memory" error. To run huge workloads, increase this limit by setting this option to e.g. ``64M`` (this would result in a total of 128MB used by Graphene for internal metadata). Note that this limit is included in ``sgx.enclave_size``, so if your enclave size is e.g. 512MB and -you specify ``loader.pal_internal_mem_size = 64MB``, then your application is +you specify ``loader.pal_internal_mem_size = "64MB"``, then your application is left with 384MB of usable memory. Stack size @@ -152,12 +154,13 @@ Stack size :: - sys.stack.size=[# of bytes (with K/M/G)] + sys.stack.size = "[SIZE]" + (default: "256K") This specifies the stack size of each thread in each Graphene process. The default value is determined by the library OS. Units like ``K`` |~| (KiB), ``M`` |~| (MiB), and ``G`` |~| (GiB) can be appended to the values for -convenience. For example, ``sys.stack.size=1M`` indicates a 1 |~| MiB stack +convenience. For example, ``sys.stack.size = "1M"`` indicates a 1 |~| MiB stack size. Program break (brk) size @@ -165,12 +168,13 @@ Program break (brk) size :: - sys.brk.max_size=[# of bytes (with K/M/G)] + sys.brk.max_size = "[SIZE]" + (default: "256K") This specifies the maximal program break (brk) size in each Graphene process. The default value of the program break size is determined by the library OS. Units like ``K`` (KiB), ``M`` (MiB), and ``G`` (GiB) can be appended to the -values for convenience. For example, ``sys.brk.max_size=1M`` indicates +values for convenience. For example, ``sys.brk.max_size = "1M"`` indicates a 1 |~| MiB brk size. Allowing eventfd @@ -178,7 +182,7 @@ Allowing eventfd :: - sys.insecure__allow_eventfd=[1|0] + sys.insecure__allow_eventfd = [1|0] (Default: 0) This specifies whether to allow system calls `eventfd()` and `eventfd2()`. Since @@ -190,9 +194,9 @@ FS mount points :: - fs.mount.[identifier].path=[PATH] - fs.mount.[identifier].type=[chroot|...] - fs.mount.[identifier].uri=[URI] + fs.mount.[identifier].type = "[chroot|...]" + fs.mount.[identifier].path = "[PATH]" + fs.mount.[identifier].uri = "[URI]" This syntax specifies how file systems are mounted inside the library OS. For dynamically linked binaries, usually at least one mount point is required in the @@ -210,7 +214,7 @@ Debug/production enclave :: - sgx.debug=[1|0] + sgx.debug = [1|0] (Default: 1) This syntax specifies whether the enclave can be debugged. Set it to ``1`` for @@ -221,8 +225,8 @@ Enclave size :: - sgx.enclave_size=[SIZE] - (default: 256M) + sgx.enclave_size = "[SIZE]" + (default: "256M") This syntax specifies the size of the enclave set during enclave creation time (recall that SGX |~| v1 requires a predetermined maximum size of the enclave). @@ -235,7 +239,7 @@ Number of threads :: - sgx.thread_num=[NUM] + sgx.thread_num = [NUM] (Default: 4) This syntax specifies the maximum number of threads that can be created inside @@ -249,7 +253,7 @@ Number of RPC threads (Exitless feature) :: - sgx.rpc_thread_num=[NUM] + sgx.rpc_thread_num = [NUM] (Default: 0) This syntax specifies the number of RPC threads that are created outside of @@ -278,9 +282,9 @@ Optional CPU features (AVX, AVX512, MPX) :: - sgx.require_avx=[1|0] - sgx.require_avx512=[1|0] - sgx.require_mpx=[1|0] + sgx.require_avx = [1|0] + sgx.require_avx512 = [1|0] + sgx.require_mpx = [1|0] (Default: 0) This syntax ensures that the CPU features are available and enabled for the @@ -294,8 +298,8 @@ ISV Product ID and SVN :: - sgx.isvprodid=[NUM] - sgx.isnsvn=[NUM] + sgx.isvprodid = [NUM] + sgx.isnsvn = [NUM] (Default: 0) This syntax specifies the ISV Product ID and SVN to be added to the enclave @@ -306,7 +310,7 @@ Allowed files :: - sgx.allowed_files.[identifier]=[URI] + sgx.allowed_files.[identifier] = "[URI]" This syntax specifies the files that are allowed to be loaded into the enclave unconditionally. These files are not cryptographically hashed and are thus not @@ -319,7 +323,7 @@ Trusted files :: - sgx.trusted_files.[identifier]=[URI] + sgx.trusted_files.[identifier] = "[URI]" This syntax specifies the files to be cryptographically hashed, and thus allowed to be loaded into the enclave. The signer tool will automatically generate @@ -333,8 +337,8 @@ Protected files :: - sgx.protected_files_key=[16-byte hex value] - sgx.protected_files.[identifier]=[URI] + sgx.protected_files_key = "[16-byte hex value]" + sgx.protected_files.[identifier] = "[URI]" This syntax specifies the files that are encrypted on disk and transparently decrypted when accessed by Graphene or by application running inside Graphene. @@ -359,8 +363,8 @@ File check policy :: - sgx.file_check_policy=[strict|allow_all_but_log] - (Default: strict) + sgx.file_check_policy = "[strict|allow_all_but_log]" + (Default: "strict") This syntax specifies the file check policy, determining the behavior of authentication when opening files. By default, only files explicitly listed as @@ -375,7 +379,7 @@ Trusted child processes :: - sgx.trusted_children.[identifier]=[URI of signature (.sig)] + sgx.trusted_children.[identifier] = "[URI of signature file (.sig)]" This syntax specifies the signatures of allowed child processes of the current application. Upon process creation, the enclave in the current (parent) process @@ -388,11 +392,11 @@ Attestation and quotes :: - sgx.remote_attestation=[1|0] + sgx.remote_attestation = [1|0] (Default: 0) - sgx.ra_client_linkable=[1|0] - (Default: 0) - sgx.ra_client_spid=[HEX] + + sgx.ra_client_linkable = [1|0] + sgx.ra_client_spid = "[HEX]" This syntax specifies the parameters for remote attestation. To enable it, ``remote_attestation`` must be set to ``1``. @@ -410,7 +414,7 @@ Enabling per-thread and process-wide SGX stats :: - sgx.enable_stats=[1|0] + sgx.enable_stats = [1|0] (Default: 0) This syntax specifies whether to enable SGX enclave-specific statistics: diff --git a/Documentation/manpages/gsc.rst b/Documentation/manpages/gsc.rst index 5368ddb2..fa23cdc2 100644 --- a/Documentation/manpages/gsc.rst +++ b/Documentation/manpages/gsc.rst @@ -535,9 +535,9 @@ The manifest generation excludes all files and paths starting with relies on some files in these directories, you must manually add them to the application-specific manifest:: - sgx.trusted_file.some_special_file_unique_name=file:PATH_TO_FILE + sgx.trusted_files.[identifier] = "[URI]" or - sgx.allowed_file.some_special_file_unique_name=file:PATH_TO_FILE + sgx.allowed_files.[identifier] = "[URI]" Docker images with non-executables as entrypoint ------------------------------------------------ diff --git a/Documentation/tutorials/pytorch/index.rst b/Documentation/tutorials/pytorch/index.rst index 86e1a54c..1c8c2f98 100644 --- a/Documentation/tutorials/pytorch/index.rst +++ b/Documentation/tutorials/pytorch/index.rst @@ -198,9 +198,9 @@ We mount the entire ``/Runtime/`` host-level directory to the ``/lib`` directory seen inside Graphene. This trick allows to transparently replace standard C libraries with Graphene-patched libraries:: - fs.mount.lib.type = chroot - fs.mount.lib.path = /lib - fs.mount.lib.uri = file:$(GRAPHENEDIR)/Runtime/ + fs.mount.lib.type = "chroot" + fs.mount.lib.path = "/lib" + fs.mount.lib.uri = "file:$(GRAPHENEDIR)/Runtime/" We also mount other directories such as ``/usr``, ``/etc``, and ``/tmp`` required by Python and PyTorch (they search for libraries and utility files in @@ -208,9 +208,9 @@ these system directories). Finally, we mount the path containing the Python packages installed via pip:: - fs.mount.pip.type = chroot - fs.mount.pip.path = $(HOME)/.local/lib - fs.mount.pip.uri = file:$(HOME)/.local/lib + fs.mount.pip.type = "chroot" + fs.mount.pip.path = "$(HOME)/.local/lib" + fs.mount.pip.uri = "file:$(HOME)/.local/lib" Now we can run ``make`` to build/copy all required Graphene files:: @@ -252,8 +252,8 @@ Below, we will highlight some of the SGX-specific manifest options in First, here are the following SGX-specific lines in the manifest template:: - sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 - sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 + sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" + sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" ... ``sgx.trusted_files.`` specifies a file that will be verified and trusted @@ -272,7 +272,7 @@ against the expected value in the manifest. The PyTorch manifest template also contains ``sgx.allowed_files.`` entries. They specify files unconditionally allowed by the enclave:: - sgx.allowed_files.pythonhome = file:$(HOME)/.local/lib + sgx.allowed_files.pythonhome = "file:$(HOME)/.local/lib" This line unconditionally allows all Python libraries in the path to be loaded into the enclave. Ideally, the developer needs to replace it with @@ -473,26 +473,26 @@ with your favorite text editor. Replace ``trusted_files`` with ``protected_files`` for the input files:: - # sgx.trusted_files.classes = file:classes.txt - sgx.protected_files.classes = file:classes.txt + # sgx.trusted_files.classes = "file:classes.txt" + sgx.protected_files.classes = "file:classes.txt" - # sgx.trusted_files.image = file:input.jpg - sgx.protected_files.image = file:input.jpg + # sgx.trusted_files.image = "file:input.jpg" + sgx.protected_files.image = "file:input.jpg" - # sgx.trusted_files.model = file:alexnet-pretrained.pt - sgx.protected_files.model = file:alexnet-pretrained.pt + # sgx.trusted_files.model = "file:alexnet-pretrained.pt" + sgx.protected_files.model = "file:alexnet-pretrained.pt" Also add ``result.txt`` as a protected file so that PyTorch writes the *encrypted* result into it:: - sgx.protected_files.result = file:result.txt + sgx.protected_files.result = "file:result.txt" Now, let's add the secret provisioning library to the manifest. Append the current directory ``./`` to ``LD_LIBRARY_PATH`` so that PyTorch and Graphene add-ons search for libraries in the current directory:: # this instructs in-Graphene dynamic loader to search for dependencies in the current directory - loader.env.LD_LIBRARY_PATH = /lib:/usr/lib:$(ARCH_LIBDIR):/usr/$(ARCH_LIBDIR):./ + loader.env.LD_LIBRARY_PATH = "/lib:/usr/lib:$(ARCH_LIBDIR):/usr/$(ARCH_LIBDIR):./" Add the following lines to enable remote secret provisioning and allow protected files to be transparently decrypted by the provisioned key. Recall that we @@ -503,14 +503,14 @@ the used environment variables and other manifest options, see `here sgx.remote_attestation = 1 - loader.env.LD_PRELOAD = libsecret_prov_attest.so - loader.env.SECRET_PROVISION_CONSTRUCTOR = 1 - loader.env.SECRET_PROVISION_SET_PF_KEY = 1 + loader.env.LD_PRELOAD = "libsecret_prov_attest.so" + loader.env.SECRET_PROVISION_CONSTRUCTOR = "1" + loader.env.SECRET_PROVISION_SET_PF_KEY = "1" loader.env.SECRET_PROVISION_CA_CHAIN_PATH = "certs/test-ca-sha256.crt" loader.env.SECRET_PROVISION_SERVERS = "localhost:4433" - sgx.trusted_files.libsecretprovattest = file:libsecret_prov_attest.so - sgx.trusted_files.cachain = file:certs/test-ca-sha256.crt + sgx.trusted_files.libsecretprovattest = "file:libsecret_prov_attest.so" + sgx.trusted_files.cachain = "file:certs/test-ca-sha256.crt" The ``libsecret_prov_attest.so`` library provides the in-enclave logic to attest the SGX enclave, Graphene instance, and the application running in it to the diff --git a/Examples/apache/Makefile b/Examples/apache/Makefile index 5f82be47..d7ece0c6 100644 --- a/Examples/apache/Makefile +++ b/Examples/apache/Makefile @@ -101,7 +101,7 @@ httpd-deps: httpd-ldd httpd-trusted-mods: httpd-modules @for F in `cat httpd-modules`; do \ N=`echo $$F | awk '{n=split($$1,s,/\/|\./); print s[n-1]}'`; \ - echo -n "sgx.trusted_files.$$N = file:$$F\\\\n"; \ + echo -n "sgx.trusted_files.$$N = \\\"file:$$F\\\"\\\\n"; \ done > $@ # Generating manifest rules for Apache dependencies @@ -111,7 +111,7 @@ httpd-trusted-libs: httpd-deps httpd-modules $(INSTALL_DIR)/bin/httpd for F in `cat httpd-deps`; do \ P=`ldd $$HTTPD_LIBS | grep $$F | awk '{print $$3; exit}'`; \ N=`echo $$F | tr --delete '-'`; \ - echo -n "sgx.trusted_files.$$N = file:$$P\\\\n"; \ + echo -n "sgx.trusted_files.$$N = \\\"file:$$P\\\"\\\\n"; \ done > $@ httpd.manifest: httpd.manifest.template httpd-trusted-mods httpd-trusted-libs diff --git a/Examples/apache/httpd.manifest.template b/Examples/apache/httpd.manifest.template index c3153d09..765880c7 100644 --- a/Examples/apache/httpd.manifest.template +++ b/Examples/apache/httpd.manifest.template @@ -2,53 +2,53 @@ # # This manifest was prepared and tested on Ubuntu 16.04. -loader.argv0_override = httpd +loader.argv0_override = "httpd" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 # Graphene environment, including the path to the library OS and the debug # option (inline/none). -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so -loader.debug_type = $(GRAPHENEDEBUG) +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" +loader.debug_type = "$(GRAPHENEDEBUG)" # Environment variables -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR) +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR)" # Mounted FSes. The following "chroot" FSes mount a part of the host FS into the # guest. Other parts of the host FS will not be available in the guest. # Default glibc files, mounted from the Runtime directory in GRAPHENEDIR. -fs.mount.lib.type = chroot -fs.mount.lib.path = /lib -fs.mount.lib.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib.type = "chroot" +fs.mount.lib.path = "/lib" +fs.mount.lib.uri = "file:$(GRAPHENEDIR)/Runtime" # Host-level libraries (e.g., /lib/x86_64-linux-gnu) required by Apache -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" # Host-level directory (/usr) required by Apache (needed for libaprutil-1.so) -fs.mount.usr.type = chroot -fs.mount.usr.path = /usr -fs.mount.usr.uri = file:/usr +fs.mount.usr.type = "chroot" +fs.mount.usr.path = "/usr" +fs.mount.usr.uri = "file:/usr" # Host-level directory (/etc) required by Apache (needed mostly for SSL/TLS) -fs.mount.etc.type = chroot -fs.mount.etc.path = /etc -fs.mount.etc.uri = file:/etc +fs.mount.etc.type = "chroot" +fs.mount.etc.path = "/etc" +fs.mount.etc.uri = "file:/etc" # Mount the current working directory -fs.mount.cwd.type = chroot -fs.mount.cwd.path = $(INSTALL_DIR_ABSPATH) -fs.mount.cwd.uri = file:$(INSTALL_DIR) +fs.mount.cwd.type = "chroot" +fs.mount.cwd.path = "$(INSTALL_DIR_ABSPATH)" +fs.mount.cwd.uri = "file:$(INSTALL_DIR)" # SGX general options # Set the virtual memory size of the SGX enclave. For SGX v1, the enclave # size must be specified during signing. If Apache needs more virtual memory # than the enclave size, Graphene will not be able to allocate it. -sgx.enclave_size = 256M +sgx.enclave_size = "256M" # Set the maximum number of enclave threads. For SGX v1, the number of enclave # TCSes must be specified during signing, so the application cannot use more @@ -64,48 +64,48 @@ sgx.thread_num = 32 # SGX trusted libraries # Glibc libraries -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 -sgx.trusted_files.libdl = file:$(GRAPHENEDIR)/Runtime/libdl.so.2 -sgx.trusted_files.librt = file:$(GRAPHENEDIR)/Runtime/librt.so.1 -sgx.trusted_files.libutil = file:$(GRAPHENEDIR)/Runtime/libutil.so.1 -sgx.trusted_files.libpthread = file:$(GRAPHENEDIR)/Runtime/libpthread.so.0 +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" +sgx.trusted_files.libdl = "file:$(GRAPHENEDIR)/Runtime/libdl.so.2" +sgx.trusted_files.librt = "file:$(GRAPHENEDIR)/Runtime/librt.so.1" +sgx.trusted_files.libutil = "file:$(GRAPHENEDIR)/Runtime/libutil.so.1" +sgx.trusted_files.libpthread = "file:$(GRAPHENEDIR)/Runtime/libpthread.so.0" # Other libraries required by Apache -sgx.trusted_files.libgcc_s = file:$(ARCH_LIBDIR)/libgcc_s.so.1 -sgx.trusted_files.nss_files = file:$(ARCH_LIBDIR)/libnss_files.so.2 -sgx.trusted_files.libnsscompat = file:$(ARCH_LIBDIR)/libnss_compat.so.2 -sgx.trusted_files.libnssnis = file:$(ARCH_LIBDIR)/libnss_nis.so.2 -sgx.trusted_files.libnsl = file:$(ARCH_LIBDIR)/libnsl.so.1 +sgx.trusted_files.libgcc_s = "file:$(ARCH_LIBDIR)/libgcc_s.so.1" +sgx.trusted_files.nss_files = "file:$(ARCH_LIBDIR)/libnss_files.so.2" +sgx.trusted_files.libnsscompat = "file:$(ARCH_LIBDIR)/libnss_compat.so.2" +sgx.trusted_files.libnssnis = "file:$(ARCH_LIBDIR)/libnss_nis.so.2" +sgx.trusted_files.libnsl = "file:$(ARCH_LIBDIR)/libnsl.so.1" # Apache modules and dependencies $(HTTPD_TRUSTED_MODS) $(HTTPD_TRUSTED_LIBS) # Apache configuration (trusted) -sgx.trusted_files.conf1 = file:$(INSTALL_DIR)/conf/httpd-graphene.conf -sgx.trusted_files.conf2 = file:$(INSTALL_DIR)/conf/extra/httpd-ssl-graphene.conf -sgx.trusted_files.conf3 = file:$(INSTALL_DIR)/conf/mime.types +sgx.trusted_files.conf1 = "file:$(INSTALL_DIR)/conf/httpd-graphene.conf" +sgx.trusted_files.conf2 = "file:$(INSTALL_DIR)/conf/extra/httpd-ssl-graphene.conf" +sgx.trusted_files.conf3 = "file:$(INSTALL_DIR)/conf/mime.types" # Apache SSL/TLS files (trusted) -sgx.trusted_files.server_cert = file:$(INSTALL_DIR)/conf/server.crt -sgx.trusted_files.server_key = file:$(INSTALL_DIR)/conf/server.key +sgx.trusted_files.server_cert = "file:$(INSTALL_DIR)/conf/server.crt" +sgx.trusted_files.server_key = "file:$(INSTALL_DIR)/conf/server.key" # Apache HTTP documents (trusted) # We only specify those documents used in our tests/benchmarks. -sgx.trusted_files.htdocs1 = file:$(INSTALL_DIR)/htdocs/index.html -sgx.trusted_files.htdocs2 = file:$(INSTALL_DIR)/htdocs/random/10K.1.html +sgx.trusted_files.htdocs1 = "file:$(INSTALL_DIR)/htdocs/index.html" +sgx.trusted_files.htdocs2 = "file:$(INSTALL_DIR)/htdocs/random/10K.1.html" # Apache logs directory (untrusted and allowed, since log files are not security-critical) -sgx.allowed_files.logs = file:$(INSTALL_DIR)/logs +sgx.allowed_files.logs = "file:$(INSTALL_DIR)/logs" # Name Service Switch (NSS) files, see 'man nsswitch.conf' -sgx.allowed_files.nsswitch = file:/etc/nsswitch.conf -sgx.allowed_files.ethers = file:/etc/ethers -sgx.allowed_files.hosts = file:/etc/hosts -sgx.allowed_files.group = file:/etc/group -sgx.allowed_files.passwd = file:/etc/passwd +sgx.allowed_files.nsswitch = "file:/etc/nsswitch.conf" +sgx.allowed_files.ethers = "file:/etc/ethers" +sgx.allowed_files.hosts = "file:/etc/hosts" +sgx.allowed_files.group = "file:/etc/group" +sgx.allowed_files.passwd = "file:/etc/passwd" # getaddrinfo(3) configuration file, see 'man gai.conf' -sgx.allowed_files.gaiconf = file:/etc/gai.conf +sgx.allowed_files.gaiconf = "file:/etc/gai.conf" diff --git a/Examples/bash/Makefile b/Examples/bash/Makefile index ad3377a7..543205d0 100644 --- a/Examples/bash/Makefile +++ b/Examples/bash/Makefile @@ -54,14 +54,14 @@ GLIBC_DEPS = linux-vdso /lib64/ld-linux-x86-64 libc libm librt libdl libutil lib for F in `cat $<`; do \ P=`ldd $(shell which $(basename $@)) | grep $$F | awk '{print $$3; exit}'`; \ N=`echo $$F | tr --delete '-'`; \ - echo -n "sgx.trusted_files.$$N = file:$$P\\\\n"; \ + echo -n "sgx.trusted_files.$$N = \\\"file:$$P\\\"\\\\n"; \ done > $@ .INTERMEDIATE: trusted-children trusted-children: @for F in $(PROGRAMS); do \ - echo -n "sgx.trusted_children.$$F = file:$$F.sig\\\\n"; \ - echo -n "sgx.trusted_files.$$F = file:$$F\\\\n"; \ + echo -n "sgx.trusted_children.$$F = \\\"file:$$F.sig\\\"\\\\n"; \ + echo -n "sgx.trusted_files.$$F = \\\"file:$$F\\\"\\\\n"; \ done > $@ bash.manifest: manifest.template trusted-children bash.trusted-libs diff --git a/Examples/bash/manifest.template b/Examples/bash/manifest.template index 5a9c6ca5..e893d57d 100644 --- a/Examples/bash/manifest.template +++ b/Examples/bash/manifest.template @@ -3,44 +3,44 @@ # # This manifest was prepared and tested on Ubuntu 16.04. -loader.argv0_override = $(ARGV0_OVERRIDE) +loader.argv0_override = "$(ARGV0_OVERRIDE)" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 # Graphene environment, including the path of the library OS and the debug # option (inline/none). -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so -loader.debug_type = $(GRAPHENEDEBUG) +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" +loader.debug_type = "$(GRAPHENEDEBUG)" # Environment variables -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR) -loader.env.PATH = / +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR)" +loader.env.PATH = "/" # Mounted FSes. The following "chroot" FSes mount a part of the host FS into the # guest. Other parts of the host FS will not be available in the guest. # Default glibc files, mounted from the Runtime directory in GRAPHENEDIR. -fs.mount.lib.type = chroot -fs.mount.lib.path = /lib -fs.mount.lib.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib.type = "chroot" +fs.mount.lib.path = "/lib" +fs.mount.lib.uri = "file:$(GRAPHENEDIR)/Runtime" # Host-level libraries (e.g., /lib/x86_64-linux-gnu) required by Bash -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" # Mount /bin -fs.mount.bin.type = chroot -fs.mount.bin.path = $(EXECDIR) -fs.mount.bin.uri = file:$(EXECDIR) +fs.mount.bin.type = "chroot" +fs.mount.bin.path = "$(EXECDIR)" +fs.mount.bin.uri = "file:$(EXECDIR)" # SGX general options # Set the virtual memory size of the SGX enclave. For SGX v1, the enclave # size must be specified during signing. If the program needs more virtual # memory than the enclave size, Graphene will not be able to allocate it. -sgx.enclave_size = 256M +sgx.enclave_size = "256M" # Set the maximum number of enclave threads. For SGX v1, the number of enclave # TCSes must be specified during signing, so the application cannot use more @@ -53,24 +53,24 @@ sgx.thread_num = 4 # SGX trusted libraries # Glibc libraries -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 -sgx.trusted_files.libdl = file:$(GRAPHENEDIR)/Runtime/libdl.so.2 -sgx.trusted_files.librt = file:$(GRAPHENEDIR)/Runtime/librt.so.1 -sgx.trusted_files.libutil = file:$(GRAPHENEDIR)/Runtime/libutil.so.1 -sgx.trusted_files.libpthread = file:$(GRAPHENEDIR)/Runtime/libpthread.so.0 +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" +sgx.trusted_files.libdl = "file:$(GRAPHENEDIR)/Runtime/libdl.so.2" +sgx.trusted_files.librt = "file:$(GRAPHENEDIR)/Runtime/librt.so.1" +sgx.trusted_files.libutil = "file:$(GRAPHENEDIR)/Runtime/libutil.so.1" +sgx.trusted_files.libpthread = "file:$(GRAPHENEDIR)/Runtime/libpthread.so.0" # Name Service Switch (NSS) libraries (Glibc dependencies) -sgx.trusted_files.libnsscompat = file:$(ARCH_LIBDIR)/libnss_compat.so.2 -sgx.trusted_files.libnssfiles = file:$(ARCH_LIBDIR)/libnss_files.so.2 -sgx.trusted_files.libnssnis = file:$(ARCH_LIBDIR)/libnss_nis.so.2 +sgx.trusted_files.libnsscompat = "file:$(ARCH_LIBDIR)/libnss_compat.so.2" +sgx.trusted_files.libnssfiles = "file:$(ARCH_LIBDIR)/libnss_files.so.2" +sgx.trusted_files.libnssnis = "file:$(ARCH_LIBDIR)/libnss_nis.so.2" # Additional libs opened by Bash at runtime -sgx.trusted_files.libselinux1 = file:$(ARCH_LIBDIR)/libselinux.so.1 -sgx.trusted_files.libpcre = file:$(ARCH_LIBDIR)/libpcre.so.3 -sgx.trusted_files.libacl = file:$(ARCH_LIBDIR)/libacl.so.1 -sgx.trusted_files.libattr = file:$(ARCH_LIBDIR)/libattr.so.1 +sgx.trusted_files.libselinux1 = "file:$(ARCH_LIBDIR)/libselinux.so.1" +sgx.trusted_files.libpcre = "file:$(ARCH_LIBDIR)/libpcre.so.3" +sgx.trusted_files.libacl = "file:$(ARCH_LIBDIR)/libacl.so.1" +sgx.trusted_files.libattr = "file:$(ARCH_LIBDIR)/libattr.so.1" # Other required libraries $(TRUSTED_LIBS) @@ -78,4 +78,4 @@ $(TRUSTED_LIBS) # Signatures of child enclaves $(TRUSTED_CHILDREN) -sgx.allowed_files.scripts = file:scripts +sgx.allowed_files.scripts = "file:scripts" diff --git a/Examples/blender/blender.manifest.template b/Examples/blender/blender.manifest.template index e7d59df4..5ce73d29 100644 --- a/Examples/blender/blender.manifest.template +++ b/Examples/blender/blender.manifest.template @@ -6,80 +6,80 @@ # Additionally, Blender scenes could allow for code execution (e.g. via bundled scripts), so # running untrusted scenes should not be allowed. This can be achieved for example by adding scenes # to trusted files or uploading them to a running and attested enclave via secured connection. -sgx.allowed_files.blender_dir = file:$(BLENDER_DIR)/$(BLENDER_VER)/ -sgx.allowed_files.blender_input = file:$(DATA_DIR)/scenes/ -sgx.allowed_files.blender_output = file:$(DATA_DIR)/images/ +sgx.allowed_files.blender_dir = "file:$(BLENDER_DIR)/$(BLENDER_VER)/" +sgx.allowed_files.blender_input = "file:$(DATA_DIR)/scenes/" +sgx.allowed_files.blender_output = "file:$(DATA_DIR)/images/" -loader.argv0_override = blender +loader.argv0_override = "blender" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 -loader.preload = file:$(GRAPHENE_DIR)/Runtime/libsysdb.so -loader.debug_type = $(GRAPHENE_DEBUG) +loader.preload = "file:$(GRAPHENE_DIR)/Runtime/libsysdb.so" +loader.debug_type = "$(GRAPHENE_DEBUG)" -loader.env.LD_LIBRARY_PATH = /graphene_lib:/blender_lib:/usr/$(ARCH_LIBDIR):$(ARCH_LIBDIR) -loader.env.HOME = /home/user +loader.env.LD_LIBRARY_PATH = "/graphene_lib:/blender_lib:/usr/$(ARCH_LIBDIR):$(ARCH_LIBDIR)" +loader.env.HOME = "/home/user" # Graphene implicitly copies host environment variables - overwriting troublesome one -loader.env.PWD = +loader.env.PWD = "" -fs.mount.graphene_lib.type = chroot -fs.mount.graphene_lib.path = /graphene_lib -fs.mount.graphene_lib.uri = file:$(GRAPHENE_DIR)/Runtime +fs.mount.graphene_lib.type = "chroot" +fs.mount.graphene_lib.path = "/graphene_lib" +fs.mount.graphene_lib.uri = "file:$(GRAPHENE_DIR)/Runtime" -fs.mount.blender_lib.type = chroot -fs.mount.blender_lib.path = /blender_lib -fs.mount.blender_lib.uri = file:$(BLENDER_DIR)/lib +fs.mount.blender_lib.type = "chroot" +fs.mount.blender_lib.path = "/blender_lib" +fs.mount.blender_lib.uri = "file:$(BLENDER_DIR)/lib" -fs.mount.usr_lib.type = chroot -fs.mount.usr_lib.path = /usr/$(ARCH_LIBDIR) -fs.mount.usr_lib.uri = file:/usr/$(ARCH_LIBDIR) +fs.mount.usr_lib.type = "chroot" +fs.mount.usr_lib.path = "/usr/$(ARCH_LIBDIR)" +fs.mount.usr_lib.uri = "file:/usr/$(ARCH_LIBDIR)" -fs.mount.lib.type = chroot -fs.mount.lib.path = $(ARCH_LIBDIR) -fs.mount.lib.uri = file:$(ARCH_LIBDIR) +fs.mount.lib.type = "chroot" +fs.mount.lib.path = "$(ARCH_LIBDIR)" +fs.mount.lib.uri = "file:$(ARCH_LIBDIR)" -fs.mount.scenes.type = chroot -fs.mount.scenes.path = /data -fs.mount.scenes.uri = file:$(DATA_DIR) +fs.mount.scenes.type = "chroot" +fs.mount.scenes.path = "/data" +fs.mount.scenes.uri = "file:$(DATA_DIR)" -fs.mount.blender.type = chroot -fs.mount.blender.path = /blender -fs.mount.blender.uri = file:$(BLENDER_DIR) +fs.mount.blender.type = "chroot" +fs.mount.blender.path = "/blender" +fs.mount.blender.uri = "file:$(BLENDER_DIR)" -sys.stack.size = 8M +sys.stack.size = "8M" -sgx.enclave_size = 2048M -sgx.thread_num = 28 +sgx.enclave_size = "2048M" +sgx.thread_num = 64 -sgx.trusted_files.ld = file:$(GRAPHENE_DIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENE_DIR)/Runtime/libc.so.6 -sgx.trusted_files.libdl = file:$(GRAPHENE_DIR)/Runtime/libdl.so.2 -sgx.trusted_files.libm = file:$(GRAPHENE_DIR)/Runtime/libm.so.6 -sgx.trusted_files.libpthread = file:$(GRAPHENE_DIR)/Runtime/libpthread.so.0 -sgx.trusted_files.libutil = file:$(GRAPHENE_DIR)/Runtime/libutil.so.1 -sgx.trusted_files.librt = file:$(GRAPHENE_DIR)/Runtime/librt.so.1 +sgx.trusted_files.ld = "file:$(GRAPHENE_DIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENE_DIR)/Runtime/libc.so.6" +sgx.trusted_files.libdl = "file:$(GRAPHENE_DIR)/Runtime/libdl.so.2" +sgx.trusted_files.libm = "file:$(GRAPHENE_DIR)/Runtime/libm.so.6" +sgx.trusted_files.libpthread = "file:$(GRAPHENE_DIR)/Runtime/libpthread.so.0" +sgx.trusted_files.libutil = "file:$(GRAPHENE_DIR)/Runtime/libutil.so.1" +sgx.trusted_files.librt = "file:$(GRAPHENE_DIR)/Runtime/librt.so.1" -sgx.trusted_files.libGL = file:$(BLENDER_DIR)/lib/libGL.so.1 -sgx.trusted_files.libglapi = file:$(BLENDER_DIR)/lib/libglapi.so.0 +sgx.trusted_files.libGL = "file:$(BLENDER_DIR)/lib/libGL.so.1" +sgx.trusted_files.libglapi = "file:$(BLENDER_DIR)/lib/libglapi.so.0" -sgx.trusted_files.libX11 = file:/usr/$(ARCH_LIBDIR)/libX11.so.6 -sgx.trusted_files.libXi = file:/usr/$(ARCH_LIBDIR)/libXi.so.6 -sgx.trusted_files.libXxf86vm = file:/usr/$(ARCH_LIBDIR)/libXxf86vm.so.1 -sgx.trusted_files.libXfixes = file:/usr/$(ARCH_LIBDIR)/libXfixes.so.3 -sgx.trusted_files.libXrender = file:/usr/$(ARCH_LIBDIR)/libXrender.so.1 -sgx.trusted_files.libgcc_s = file:$(ARCH_LIBDIR)/libgcc_s.so.1 -sgx.trusted_files.libz = file:$(ARCH_LIBDIR)/libz.so.1 -sgx.trusted_files.libXext = file:/usr/$(ARCH_LIBDIR)/libXext.so.6 -sgx.trusted_files.libxcb = file:/usr/$(ARCH_LIBDIR)/libxcb.so.1 -sgx.trusted_files.libXau = file:/usr/$(ARCH_LIBDIR)/libXau.so.6 -sgx.trusted_files.libXdmcp = file:/usr/$(ARCH_LIBDIR)/libXdmcp.so.6 -sgx.trusted_files.libstdcpp = file:/usr/$(ARCH_LIBDIR)/libstdc++.so.6 -sgx.trusted_files.libnuma = file:/usr/$(ARCH_LIBDIR)/libnuma.so.1 +sgx.trusted_files.libX11 = "file:/usr/$(ARCH_LIBDIR)/libX11.so.6" +sgx.trusted_files.libXi = "file:/usr/$(ARCH_LIBDIR)/libXi.so.6" +sgx.trusted_files.libXxf86vm = "file:/usr/$(ARCH_LIBDIR)/libXxf86vm.so.1" +sgx.trusted_files.libXfixes = "file:/usr/$(ARCH_LIBDIR)/libXfixes.so.3" +sgx.trusted_files.libXrender = "file:/usr/$(ARCH_LIBDIR)/libXrender.so.1" +sgx.trusted_files.libgcc_s = "file:$(ARCH_LIBDIR)/libgcc_s.so.1" +sgx.trusted_files.libz = "file:$(ARCH_LIBDIR)/libz.so.1" +sgx.trusted_files.libXext = "file:/usr/$(ARCH_LIBDIR)/libXext.so.6" +sgx.trusted_files.libxcb = "file:/usr/$(ARCH_LIBDIR)/libxcb.so.1" +sgx.trusted_files.libXau = "file:/usr/$(ARCH_LIBDIR)/libXau.so.6" +sgx.trusted_files.libXdmcp = "file:/usr/$(ARCH_LIBDIR)/libXdmcp.so.6" +sgx.trusted_files.libstdcpp = "file:/usr/$(ARCH_LIBDIR)/libstdc++.so.6" +sgx.trusted_files.libnuma = "file:/usr/$(ARCH_LIBDIR)/libnuma.so.1" # Ubuntu version specific files -# [Ubuntu18.04] sgx.trusted_files.libbsd = file:$(ARCH_LIBDIR)/libbsd.so.0 +# [Ubuntu18.04] sgx.trusted_files.libbsd = "file:$(ARCH_LIBDIR)/libbsd.so.0" diff --git a/Examples/busybox/busybox.manifest.template b/Examples/busybox/busybox.manifest.template index a3b9e02d..9447af72 100644 --- a/Examples/busybox/busybox.manifest.template +++ b/Examples/busybox/busybox.manifest.template @@ -6,7 +6,7 @@ # Name of the executable e.g. as visible through argv[0] when ran as manifest # file (`./pal_loader busybox.manifest`). -loader.argv0_override = busybox +loader.argv0_override = "busybox" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 @@ -15,12 +15,12 @@ loader.insecure__use_cmdline_argv = 1 # so it is always set to libsysdb.so. Note that GRAPHENEDIR macro is expanded # to relative path to Graphene repository in the Makefile as part of the # build process. -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" # Show/hide debug log of Graphene ('inline' or 'none' respectively). Note that # GRAPHENEDEBUG macro is expanded to inline/none in the Makefile as part of the # build process. -loader.debug_type = $(GRAPHENEDEBUG) +loader.debug_type = "$(GRAPHENEDEBUG)" ################################# ENV VARS ################################### @@ -34,14 +34,14 @@ loader.debug_type = $(GRAPHENEDEBUG) # - /lib is searched for Glibc libraries (ld, libc, libresolv) provided by # graphene, # - $(ARCH_LIBDIR) is searched for libcrypt, NSS libraries. -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR) +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR)" # Explicitly set some environment variables used by Busybox. -loader.env.PATH = /:/usr/sbin:/usr/bin:/sbin:/bin -loader.env.USERNAME = -loader.env.HOME = -loader.env.PWD = -loader.env.HOSTNAME = test +loader.env.PATH = "/:/usr/sbin:/usr/bin:/sbin:/bin" +loader.env.USERNAME = "" +loader.env.HOME = "" +loader.env.PWD = "" +loader.env.HOSTNAME = "test" ################################# MOUNT FS ################################### @@ -55,19 +55,19 @@ loader.env.HOSTNAME = test # (specified as 'uri', GRAPHENEDIR macro is expanded in the Makefile as part # of the build process) into in-Graphene visible directory /lib (specified # as 'path'). -fs.mount.lib1.type = chroot -fs.mount.lib1.path = /lib -fs.mount.lib1.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib1.type = "chroot" +fs.mount.lib1.path = "/lib" +fs.mount.lib1.uri = "file:$(GRAPHENEDIR)/Runtime" # Mount host-OS directory contanining libcrypt and NSS libraries. -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" # Mount host-OS directory to NSS files required by Glibc + NSS libraries. -fs.mount.etc.type = chroot -fs.mount.etc.path = /etc -fs.mount.etc.uri = file:/etc +fs.mount.etc.type = "chroot" +fs.mount.etc.path = "/etc" +fs.mount.etc.uri = "file:/etc" ############################# SGX: TRUSTED LIBS ############################### @@ -87,27 +87,27 @@ fs.mount.etc.uri = file:/etc # that this happens on the client machine. # Glibc libraries. -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libresolv = file:$(GRAPHENEDIR)/Runtime/libresolv.so.2 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libresolv = "file:$(GRAPHENEDIR)/Runtime/libresolv.so.2" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" # libcrypt is an explicit dependency of Busybox. We choose to install it on # host OS instead of downloading the sources, building, and linking Busybox # against the built library (which is possible but would require more effort). -sgx.trusted_files.libcrypt = file:$(ARCH_LIBDIR)/libcrypt.so.1 +sgx.trusted_files.libcrypt = "file:$(ARCH_LIBDIR)/libcrypt.so.1" # Name Service Switch (NSS) libraries. Glibc calls these libraries as part of # name-service information gathering. libnss_{compat,files,nis} are the # most widely used libraries, at least on Ubuntu. # For more info, see 'man nsswitch.conf'. -sgx.trusted_files.libnsscompat = file:$(ARCH_LIBDIR)/libnss_compat.so.2 -sgx.trusted_files.libnssfiles = file:$(ARCH_LIBDIR)/libnss_files.so.2 -sgx.trusted_files.libnssnis = file:$(ARCH_LIBDIR)/libnss_nis.so.2 +sgx.trusted_files.libnsscompat = "file:$(ARCH_LIBDIR)/libnss_compat.so.2" +sgx.trusted_files.libnssfiles = "file:$(ARCH_LIBDIR)/libnss_files.so.2" +sgx.trusted_files.libnssnis = "file:$(ARCH_LIBDIR)/libnss_nis.so.2" # libNSL is a dependency of libnss_compat above. It is a good example of nested # library dependencies required by Graphene-SGX. -sgx.trusted_files.libnsl = file:$(ARCH_LIBDIR)/libnsl.so.1 +sgx.trusted_files.libnsl = "file:$(ARCH_LIBDIR)/libnsl.so.1" ############################ SGX: TRUSTED FILES ############################### @@ -117,7 +117,7 @@ sgx.trusted_files.libnsl = file:$(ARCH_LIBDIR)/libnsl.so.1 # mismatch by Graphene-SGX). # # Busybox does not have any configuration files, so this section is empty. -# sgx.trusted_files.config = file: +# sgx.trusted_files.config = "file:" ############################# SGX: ALLOWED FILES ############################## @@ -127,12 +127,12 @@ sgx.trusted_files.libnsl = file:$(ARCH_LIBDIR)/libnsl.so.1 # Name Service Switch (NSS) files. Glibc reads these files as part of name- # service information gathering. For more info, see 'man nsswitch.conf'. -sgx.allowed_files.nsswitch = file:/etc/nsswitch.conf -sgx.allowed_files.ethers = file:/etc/ethers -sgx.allowed_files.hosts = file:/etc/hosts -sgx.allowed_files.group = file:/etc/group -sgx.allowed_files.passwd = file:/etc/passwd +sgx.allowed_files.nsswitch = "file:/etc/nsswitch.conf" +sgx.allowed_files.ethers = "file:/etc/ethers" +sgx.allowed_files.hosts = "file:/etc/hosts" +sgx.allowed_files.group = "file:/etc/group" +sgx.allowed_files.passwd = "file:/etc/passwd" # Busybox uses timezone settings, which are located in /etc/localtime for # glibc-based host systems. -sgx.allowed_files.localtime = file:/etc/localtime +sgx.allowed_files.localtime = "file:/etc/localtime" diff --git a/Examples/capnproto/Makefile b/Examples/capnproto/Makefile index 9dea1c46..c693dc21 100644 --- a/Examples/capnproto/Makefile +++ b/Examples/capnproto/Makefile @@ -73,7 +73,7 @@ addressbook-trusted-libs: addressbook-deps @for F in `cat addressbook-deps`; do \ P=`ldd $(SRCDIR)/addressbook | grep $$F | awk '{print $$3; exit}'`; \ N=`echo $$F | tr --delete '.' | tr --delete '-' | tr --delete '+'`; \ - echo -n "sgx.trusted_files.$$N = file:$$P\\\\n"; \ + echo -n "sgx.trusted_files.$$N = \\\"file:$$P\\\"\\\\n"; \ done > $@ addressbook.manifest: addressbook.manifest.template addressbook-trusted-libs diff --git a/Examples/capnproto/addressbook.manifest.template b/Examples/capnproto/addressbook.manifest.template index 11a568ff..2f49d83c 100644 --- a/Examples/capnproto/addressbook.manifest.template +++ b/Examples/capnproto/addressbook.manifest.template @@ -3,46 +3,46 @@ # This manifest was prepared and tested on Ubuntu 16.04 and Ubuntu 18.04. # LibOS layer library of Graphene (currently only one implementation, libsysdb) -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" # Show/hide debug log of Graphene ('inline' or 'none' respectively) -loader.debug_type = $(GRAPHENEDEBUG) +loader.debug_type = "$(GRAPHENEDEBUG)" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 # Specify paths to search for libraries (usual LD_LIBRARY_PATH syntax) -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/$(ARCH_LIBDIR) +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR):/usr/$(ARCH_LIBDIR)" # Mount host-OS directory to Graphene glibc/runtime libraries -fs.mount.lib.type = chroot -fs.mount.lib.path = /lib -fs.mount.lib.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib.type = "chroot" +fs.mount.lib.path = "/lib" +fs.mount.lib.uri = "file:$(GRAPHENEDIR)/Runtime" # Mount host-OS directory to Name Service Switch (NSS) libraries -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" # Mount host-OS directory to libcapnp lib required by Addressbook -fs.mount.lib3.type = chroot -fs.mount.lib3.path = /usr/$(ARCH_LIBDIR) -fs.mount.lib3.uri = file:/usr/$(ARCH_LIBDIR) +fs.mount.lib3.type = "chroot" +fs.mount.lib3.path = "/usr/$(ARCH_LIBDIR)" +fs.mount.lib3.uri = "file:/usr/$(ARCH_LIBDIR)" # Mount host-OS directory to NSS files required by Glibc + NSS libs -fs.mount.etc.type = chroot -fs.mount.etc.path = /etc -fs.mount.etc.uri = file:/etc +fs.mount.etc.type = "chroot" +fs.mount.etc.path = "/etc" +fs.mount.etc.uri = "file:/etc" # Set enclave size (somewhat arbitrarily) to 256MB. -sgx.enclave_size = 256M +sgx.enclave_size = "256M" # Set maximum number of in-enclave threads (somewhat arbitrarily) to 8 sgx.thread_num = 8 # Glibc libraries -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 -sgx.trusted_files.libpthread = file:$(GRAPHENEDIR)/Runtime/libpthread.so.0 +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" +sgx.trusted_files.libpthread = "file:$(GRAPHENEDIR)/Runtime/libpthread.so.0" $(TRUSTEDLIBS) diff --git a/Examples/curl/Makefile b/Examples/curl/Makefile index b6d683ad..f104a5f3 100644 --- a/Examples/curl/Makefile +++ b/Examples/curl/Makefile @@ -49,7 +49,7 @@ curl-trusted-libs: curl-deps @for F in `cat curl-deps`; do \ P=`ldd $(CURL_DIR)/curl | grep $$F | awk '{print $$3; exit}'`; \ N=`echo $$F | tr --delete '.' | tr --delete '-'`; \ - echo -n "sgx.trusted_files.$$N = file:$$P\\\\n"; \ + echo -n "sgx.trusted_files.$$N = \\\"file:$$P\\\"\\\\n"; \ done > $@ curl.manifest: curl.manifest.template curl-trusted-libs diff --git a/Examples/curl/curl.manifest.template b/Examples/curl/curl.manifest.template index f6e5557c..1073cbf5 100644 --- a/Examples/curl/curl.manifest.template +++ b/Examples/curl/curl.manifest.template @@ -2,14 +2,14 @@ # # This manifest was prepared and tested on Ubuntu 16.04. -loader.argv0_override = curl +loader.argv0_override = "curl" # LibOS layer library of Graphene. There is currently only one implementation, # so it is always set to libsysdb.so. -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" # Show/hide debug log of Graphene ('inline' or 'none' respectively). -loader.debug_type = $(GRAPHENEDEBUG) +loader.debug_type = "$(GRAPHENEDEBUG)" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 @@ -17,33 +17,33 @@ loader.insecure__use_cmdline_argv = 1 # Specify paths to search for libraries. The usual LD_LIBRARY_PATH syntax # applies. Paths must be in-Graphene visible paths, not host-OS paths (i.e., # paths must be taken from fs.mount.xxx.path, not fs.mount.xxx.uri). -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/$(ARCH_LIBDIR) +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR):/usr/$(ARCH_LIBDIR)" # Mount host-OS directory to required libraries (in 'uri') into in-Graphene # visible directory /lib (in 'path'). -fs.mount.lib.type = chroot -fs.mount.lib.path = /lib -fs.mount.lib.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib.type = "chroot" +fs.mount.lib.path = "/lib" +fs.mount.lib.uri = "file:$(GRAPHENEDIR)/Runtime" -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" -fs.mount.lib3.type = chroot -fs.mount.lib3.path = /usr$(ARCH_LIBDIR) -fs.mount.lib3.uri = file:/usr/$(ARCH_LIBDIR) +fs.mount.lib3.type = "chroot" +fs.mount.lib3.path = "/usr$(ARCH_LIBDIR)" +fs.mount.lib3.uri = "file:/usr/$(ARCH_LIBDIR)" -fs.mount.etc.type = chroot -fs.mount.etc.path = /etc -fs.mount.etc.uri = file:/etc +fs.mount.etc.type = "chroot" +fs.mount.etc.path = "/etc" +fs.mount.etc.uri = "file:/etc" -fs.mount.curl.type = chroot -fs.mount.curl.path = $(CURL_DIR) -fs.mount.curl.uri = file:$(CURL_DIR) +fs.mount.curl.type = "chroot" +fs.mount.curl.path = "$(CURL_DIR)" +fs.mount.curl.uri = "file:$(CURL_DIR)" # Set enclave size (somewhat arbitrarily) to 256MB. Recall that SGX v1 requires # to specify enclave size at enclave creation time. -sgx.enclave_size = 256M +sgx.enclave_size = "256M" # Set maximum number of in-enclave threads (somewhat arbitrarily) to 4. Recall # that SGX v1 requires to specify the maximum number of simultaneous threads at @@ -52,26 +52,26 @@ sgx.thread_num = 4 # Specify all libraries used by curl and its dependencies (including all libs # which can be loaded at runtime via dlopen). -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 -sgx.trusted_files.libdl = file:$(GRAPHENEDIR)/Runtime/libdl.so.2 -sgx.trusted_files.librt = file:$(GRAPHENEDIR)/Runtime/librt.so.1 -sgx.trusted_files.libutil = file:$(GRAPHENEDIR)/Runtime/libutil.so.1 -sgx.trusted_files.libpthread = file:$(GRAPHENEDIR)/Runtime/libpthread.so.0 -sgx.trusted_files.libresolv = file:$(GRAPHENEDIR)/Runtime/libresolv.so.2 -sgx.trusted_files.libnssdns = file:$(GRAPHENEDIR)/Runtime/libnss_dns.so.2 -sgx.trusted_files.libnss_files = file:$(ARCH_LIBDIR)/libnss_files.so.2 -sgx.trusted_files.libnss_mdns4_minimal = file:$(ARCH_LIBDIR)/libnss_mdns4_minimal.so.2 +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" +sgx.trusted_files.libdl = "file:$(GRAPHENEDIR)/Runtime/libdl.so.2" +sgx.trusted_files.librt = "file:$(GRAPHENEDIR)/Runtime/librt.so.1" +sgx.trusted_files.libutil = "file:$(GRAPHENEDIR)/Runtime/libutil.so.1" +sgx.trusted_files.libpthread = "file:$(GRAPHENEDIR)/Runtime/libpthread.so.0" +sgx.trusted_files.libresolv = "file:$(GRAPHENEDIR)/Runtime/libresolv.so.2" +sgx.trusted_files.libnssdns = "file:$(GRAPHENEDIR)/Runtime/libnss_dns.so.2" +sgx.trusted_files.libnss_files = "file:$(ARCH_LIBDIR)/libnss_files.so.2" +sgx.trusted_files.libnss_mdns4_minimal = "file:$(ARCH_LIBDIR)/libnss_mdns4_minimal.so.2" $(CURL_TRUSTED_LIBS) # Name Service Switch (NSS) files. Glibc reads these files as part of name- # service information gathering. For more info, see 'man nsswitch.conf'. -sgx.allowed_files.nsswitch = file:/etc/nsswitch.conf -sgx.allowed_files.hostconf = file:/etc/host.conf -sgx.allowed_files.resolvconf = file:/etc/resolv.conf -sgx.allowed_files.ethers = file:/etc/ethers -sgx.allowed_files.hosts = file:/etc/hosts -sgx.allowed_files.group = file:/etc/group -sgx.allowed_files.passwd = file:/etc/passwd -sgx.allowed_files.gaiconf = file:/etc/gai.conf +sgx.allowed_files.nsswitch = "file:/etc/nsswitch.conf" +sgx.allowed_files.hostconf = "file:/etc/host.conf" +sgx.allowed_files.resolvconf = "file:/etc/resolv.conf" +sgx.allowed_files.ethers = "file:/etc/ethers" +sgx.allowed_files.hosts = "file:/etc/hosts" +sgx.allowed_files.group = "file:/etc/group" +sgx.allowed_files.passwd = "file:/etc/passwd" +sgx.allowed_files.gaiconf = "file:/etc/gai.conf" diff --git a/Examples/gcc/Makefile b/Examples/gcc/Makefile index f6a5bc85..60482a8d 100644 --- a/Examples/gcc/Makefile +++ b/Examples/gcc/Makefile @@ -109,7 +109,7 @@ cc1-ldd: cc1 for F in `cat $<`; do \ P=`cat $*-ldd | grep $$F | awk '{print $$3; exit}'`; \ N=`echo $$F | tr --delete '-'`; \ - echo -n "sgx.trusted_files.$$N = file:$$P\\\\n"; \ + echo -n "sgx.trusted_files.$$N = \\\"file:$$P\\\"\\\\n"; \ done > $@ .PHONY: check diff --git a/Examples/gcc/as.manifest.template b/Examples/gcc/as.manifest.template index 5d4c2f98..177a0871 100644 --- a/Examples/gcc/as.manifest.template +++ b/Examples/gcc/as.manifest.template @@ -1,40 +1,39 @@ -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so -loader.argv0_override = as -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR) -loader.env.PATH = / -loader.env.COMPILER_PATH = /:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/ -loader.debug_type = $(GRAPHENEDEBUG) +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" +loader.argv0_override = "as" +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR)" +loader.env.PATH = "/" +loader.debug_type = "$(GRAPHENEDEBUG)" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 -fs.mount.lib1.type = chroot -fs.mount.lib1.path = /lib -fs.mount.lib1.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib1.type = "chroot" +fs.mount.lib1.path = "/lib" +fs.mount.lib1.uri = "file:$(GRAPHENEDIR)/Runtime" -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" -fs.mount.usr.type = chroot -fs.mount.usr.path = /usr -fs.mount.usr.uri = file:/usr +fs.mount.usr.type = "chroot" +fs.mount.usr.path = "/usr" +fs.mount.usr.uri = "file:/usr" -fs.mount.tmp.type = chroot -fs.mount.tmp.path = /tmp -fs.mount.tmp.uri = file:/tmp +fs.mount.tmp.type = "chroot" +fs.mount.tmp.path = "/tmp" +fs.mount.tmp.uri = "file:/tmp" -sgx.enclave_size = 1G +sgx.enclave_size = "1G" sgx.static_address = 1 -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libdl = file:$(GRAPHENEDIR)/Runtime/libdl.so.2 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 -sgx.trusted_files.libpthread = file:$(GRAPHENEDIR)/Runtime/libpthread.so.0 -sgx.trusted_files.libz = file:$(ARCH_LIBDIR)/libz.so.1 -sgx.trusted_files.libopcodes = file:/usr/$(ARCH_LIBDIR)/libopcodes-$(BINUTILS_VERSION)-system.so -sgx.trusted_files.libbfd = file:/usr/$(ARCH_LIBDIR)/libbfd-$(BINUTILS_VERSION)-system.so +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libdl = "file:$(GRAPHENEDIR)/Runtime/libdl.so.2" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" +sgx.trusted_files.libpthread = "file:$(GRAPHENEDIR)/Runtime/libpthread.so.0" +sgx.trusted_files.libz = "file:$(ARCH_LIBDIR)/libz.so.1" +sgx.trusted_files.libopcodes = "file:/usr/$(ARCH_LIBDIR)/libopcodes-$(BINUTILS_VERSION)-system.so" +sgx.trusted_files.libbfd = "file:/usr/$(ARCH_LIBDIR)/libbfd-$(BINUTILS_VERSION)-system.so" -sgx.allowed_files.tmp = file:/tmp -sgx.allowed_files.test_files = file:test_files +sgx.allowed_files.tmp = "file:/tmp" +sgx.allowed_files.test_files = "file:test_files" diff --git a/Examples/gcc/cc1.manifest.template b/Examples/gcc/cc1.manifest.template index cc81e593..b2893f36 100644 --- a/Examples/gcc/cc1.manifest.template +++ b/Examples/gcc/cc1.manifest.template @@ -1,42 +1,42 @@ -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so -loader.argv0_override = cc1 -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR) -loader.env.PATH = / -loader.env.COMPILER_PATH = /:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/ -loader.debug_type = $(GRAPHENEDEBUG) +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" +loader.argv0_override = "cc1" +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR)" +loader.env.PATH = "/" +loader.env.COMPILER_PATH = "/:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/" +loader.debug_type = "$(GRAPHENEDEBUG)" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 -fs.mount.lib1.type = chroot -fs.mount.lib1.path = /lib -fs.mount.lib1.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib1.type = "chroot" +fs.mount.lib1.path = "/lib" +fs.mount.lib1.uri = "file:$(GRAPHENEDIR)/Runtime" -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" -fs.mount.usr.type = chroot -fs.mount.usr.path = /usr -fs.mount.usr.uri = file:/usr +fs.mount.usr.type = "chroot" +fs.mount.usr.path = "/usr" +fs.mount.usr.uri = "file:/usr" -fs.mount.tmp.type = chroot -fs.mount.tmp.path = /tmp -fs.mount.tmp.uri = file:/tmp +fs.mount.tmp.type = "chroot" +fs.mount.tmp.path = "/tmp" +fs.mount.tmp.uri = "file:/tmp" -sgx.enclave_size = 1G +sgx.enclave_size = "1G" sgx.static_address = 1 -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libdl = file:$(GRAPHENEDIR)/Runtime/libdl.so.2 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 -sgx.trusted_files.libpthread = file:$(GRAPHENEDIR)/Runtime/libpthread.so.0 +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libdl = "file:$(GRAPHENEDIR)/Runtime/libdl.so.2" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" +sgx.trusted_files.libpthread = "file:$(GRAPHENEDIR)/Runtime/libpthread.so.0" $(CC1_TRUSTED_LIBS) -sgx.allowed_files.tmp = file:/tmp -sgx.allowed_files.test_files = file:test_files -sgx.allowed_files.inc = file:/usr/include -sgx.allowed_files.gccinc = file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/include -sgx.allowed_files.gccincfixed = file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/include-fixed +sgx.allowed_files.tmp = "file:/tmp" +sgx.allowed_files.test_files = "file:test_files" +sgx.allowed_files.inc = "file:/usr/include" +sgx.allowed_files.gccinc = "file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/include" +sgx.allowed_files.gccincfixed = "file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/include-fixed" diff --git a/Examples/gcc/collect2.manifest.template b/Examples/gcc/collect2.manifest.template index 6ea011be..68ef3807 100644 --- a/Examples/gcc/collect2.manifest.template +++ b/Examples/gcc/collect2.manifest.template @@ -1,41 +1,41 @@ -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so -loader.argv0_override = collect2 -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR) -loader.env.PATH = / -loader.env.COMPILER_PATH = /:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/ -loader.debug_type = $(GRAPHENEDEBUG) +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" +loader.argv0_override = "collect2" +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR)" +loader.env.PATH = "/" +loader.env.COMPILER_PATH = "/:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/" +loader.debug_type = "$(GRAPHENEDEBUG)" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 -fs.mount.lib1.type = chroot -fs.mount.lib1.path = /lib -fs.mount.lib1.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib1.type = "chroot" +fs.mount.lib1.path = "/lib" +fs.mount.lib1.uri = "file:$(GRAPHENEDIR)/Runtime" -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" -fs.mount.usr.type = chroot -fs.mount.usr.path = /usr -fs.mount.usr.uri = file:/usr +fs.mount.usr.type = "chroot" +fs.mount.usr.path = "/usr" +fs.mount.usr.uri = "file:/usr" -fs.mount.tmp.type = chroot -fs.mount.tmp.path = /tmp -fs.mount.tmp.uri = file:/tmp +fs.mount.tmp.type = "chroot" +fs.mount.tmp.path = "/tmp" +fs.mount.tmp.uri = "file:/tmp" -sgx.enclave_size = 1G +sgx.enclave_size = "1G" sgx.static_address = 1 -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libdl = file:$(GRAPHENEDIR)/Runtime/libdl.so.2 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 -sgx.trusted_files.libpthread = file:$(GRAPHENEDIR)/Runtime/libpthread.so.0 +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libdl = "file:$(GRAPHENEDIR)/Runtime/libdl.so.2" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" +sgx.trusted_files.libpthread = "file:$(GRAPHENEDIR)/Runtime/libpthread.so.0" -sgx.trusted_files.linker = file:ld +sgx.trusted_files.linker = "file:ld" -sgx.allowed_files.tmp = file:/tmp -sgx.allowed_files.test_files = file:test_files +sgx.allowed_files.tmp = "file:/tmp" +sgx.allowed_files.test_files = "file:test_files" -sgx.trusted_children.linker = file:ld.sig +sgx.trusted_children.linker = "file:ld.sig" diff --git a/Examples/gcc/gcc.manifest.template b/Examples/gcc/gcc.manifest.template index b3b7c745..91b566ee 100644 --- a/Examples/gcc/gcc.manifest.template +++ b/Examples/gcc/gcc.manifest.template @@ -1,45 +1,45 @@ -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so -loader.argv0_override = gcc -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR) -loader.env.PATH = / -loader.env.COMPILER_PATH = /:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/ -loader.debug_type = $(GRAPHENEDEBUG) +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" +loader.argv0_override = "gcc" +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR)" +loader.env.PATH = "/" +loader.env.COMPILER_PATH = "/:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/" +loader.debug_type = "$(GRAPHENEDEBUG)" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 -fs.mount.lib1.type = chroot -fs.mount.lib1.path = /lib -fs.mount.lib1.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib1.type = "chroot" +fs.mount.lib1.path = "/lib" +fs.mount.lib1.uri = "file:$(GRAPHENEDIR)/Runtime" -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" -fs.mount.usr.type = chroot -fs.mount.usr.path = /usr -fs.mount.usr.uri = file:/usr +fs.mount.usr.type = "chroot" +fs.mount.usr.path = "/usr" +fs.mount.usr.uri = "file:/usr" -fs.mount.tmp.type = chroot -fs.mount.tmp.path = /tmp -fs.mount.tmp.uri = file:/tmp +fs.mount.tmp.type = "chroot" +fs.mount.tmp.path = "/tmp" +fs.mount.tmp.uri = "file:/tmp" -sgx.enclave_size = 1G +sgx.enclave_size = "1G" sgx.static_address = 1 -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libdl = file:$(GRAPHENEDIR)/Runtime/libdl.so.2 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 -sgx.trusted_files.libpthread = file:$(GRAPHENEDIR)/Runtime/libpthread.so.0 +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libdl = "file:$(GRAPHENEDIR)/Runtime/libdl.so.2" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" +sgx.trusted_files.libpthread = "file:$(GRAPHENEDIR)/Runtime/libpthread.so.0" -sgx.trusted_files.cc1 = file:cc1 -sgx.trusted_files.collect2 = file:collect2 -sgx.trusted_files.as = file:as +sgx.trusted_files.cc1 = "file:cc1" +sgx.trusted_files.collect2 = "file:collect2" +sgx.trusted_files.as = "file:as" -sgx.allowed_files.tmp = file:/tmp -sgx.allowed_files.test_files = file:test_files +sgx.allowed_files.tmp = "file:/tmp" +sgx.allowed_files.test_files = "file:test_files" -sgx.trusted_children.cc1 = file:cc1.sig -sgx.trusted_children.collect2 = file:collect2.sig -sgx.trusted_children.as = file:as.sig +sgx.trusted_children.cc1 = "file:cc1.sig" +sgx.trusted_children.collect2 = "file:collect2.sig" +sgx.trusted_children.as = "file:as.sig" diff --git a/Examples/gcc/ld-gcc-7-trusted-files b/Examples/gcc/ld-gcc-7-trusted-files index 51779154..9187bde3 100644 --- a/Examples/gcc/ld-gcc-7-trusted-files +++ b/Examples/gcc/ld-gcc-7-trusted-files @@ -1 +1 @@ -sgx.trusted_files.crtbeginSo = file:/usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o\nsgx.trusted_files.libgccsso = file:/usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1\nsgx.trusted_files.crtendSo = file:/usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o \ No newline at end of file +sgx.trusted_files.crtbeginSo = \"file:/usr/lib/gcc/x86_64-linux-gnu/7/crtbeginS.o\"\nsgx.trusted_files.libgccsso = \"file:/usr/lib/gcc/x86_64-linux-gnu/7/libgcc_s.so.1\"\nsgx.trusted_files.crtendSo = \"file:/usr/lib/gcc/x86_64-linux-gnu/7/crtendS.o\" diff --git a/Examples/gcc/ld.manifest.template b/Examples/gcc/ld.manifest.template index 3054584d..14b429fe 100644 --- a/Examples/gcc/ld.manifest.template +++ b/Examples/gcc/ld.manifest.template @@ -1,52 +1,52 @@ -loader.preload = file:$(GRAPHENEDIR)/Runtime/libsysdb.so -loader.argv0_override = ld -loader.env.LD_LIBRARY_PATH = /lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR) -loader.env.PATH = / -loader.env.COMPILER_PATH = /:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/ -loader.debug_type = $(GRAPHENEDEBUG) +loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so" +loader.argv0_override = "ld" +loader.env.LD_LIBRARY_PATH = "/lib:$(ARCH_LIBDIR):/usr/lib:/usr/$(ARCH_LIBDIR)" +loader.env.PATH = "/" +loader.env.COMPILER_PATH = "/:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/" +loader.debug_type = "$(GRAPHENEDEBUG)" # Read application arguments directly from the command line. Don't use this on production! loader.insecure__use_cmdline_argv = 1 -fs.mount.lib1.type = chroot -fs.mount.lib1.path = /lib -fs.mount.lib1.uri = file:$(GRAPHENEDIR)/Runtime +fs.mount.lib1.type = "chroot" +fs.mount.lib1.path = "/lib" +fs.mount.lib1.uri = "file:$(GRAPHENEDIR)/Runtime" -fs.mount.lib2.type = chroot -fs.mount.lib2.path = $(ARCH_LIBDIR) -fs.mount.lib2.uri = file:$(ARCH_LIBDIR) +fs.mount.lib2.type = "chroot" +fs.mount.lib2.path = "$(ARCH_LIBDIR)" +fs.mount.lib2.uri = "file:$(ARCH_LIBDIR)" -fs.mount.usr.type = chroot -fs.mount.usr.path = /usr -fs.mount.usr.uri = file:/usr +fs.mount.usr.type = "chroot" +fs.mount.usr.path = "/usr" +fs.mount.usr.uri = "file:/usr" -fs.mount.tmp.type = chroot -fs.mount.tmp.path = /tmp -fs.mount.tmp.uri = file:/tmp +fs.mount.tmp.type = "chroot" +fs.mount.tmp.path = "/tmp" +fs.mount.tmp.uri = "file:/tmp" -sgx.enclave_size = 1G +sgx.enclave_size = "1G" sgx.static_address = 1 -sgx.trusted_files.ld = file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2 -sgx.trusted_files.libc = file:$(GRAPHENEDIR)/Runtime/libc.so.6 -sgx.trusted_files.libdl = file:$(GRAPHENEDIR)/Runtime/libdl.so.2 -sgx.trusted_files.libm = file:$(GRAPHENEDIR)/Runtime/libm.so.6 -sgx.trusted_files.libpthread = file:$(GRAPHENEDIR)/Runtime/libpthread.so.0 -sgx.trusted_files.libz = file:$(ARCH_LIBDIR)/libz.so.1 -sgx.trusted_files.libbfd = file:/usr/$(ARCH_LIBDIR)/libbfd-$(BINUTILS_VERSION)-system.so +sgx.trusted_files.ld = "file:$(GRAPHENEDIR)/Runtime/ld-linux-x86-64.so.2" +sgx.trusted_files.libc = "file:$(GRAPHENEDIR)/Runtime/libc.so.6" +sgx.trusted_files.libdl = "file:$(GRAPHENEDIR)/Runtime/libdl.so.2" +sgx.trusted_files.libm = "file:$(GRAPHENEDIR)/Runtime/libm.so.6" +sgx.trusted_files.libpthread = "file:$(GRAPHENEDIR)/Runtime/libpthread.so.0" +sgx.trusted_files.libz = "file:$(ARCH_LIBDIR)/libz.so.1" +sgx.trusted_files.libbfd = "file:/usr/$(ARCH_LIBDIR)/libbfd-$(BINUTILS_VERSION)-system.so" -sgx.trusted_files.liblto = file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/liblto_plugin.so -sgx.trusted_files.libgcc = file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/libgcc_s.so -sgx.trusted_files.libgcca = file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/libgcc.a -sgx.trusted_files.crtend = file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/crtend.o -sgx.trusted_files.crtbegin = file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/crtbegin.o +sgx.trusted_files.liblto = "file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/liblto_plugin.so" +sgx.trusted_files.libgcc = "file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/libgcc_s.so" +sgx.trusted_files.libgcca = "file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/libgcc.a" +sgx.trusted_files.crtend = "file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/crtend.o" +sgx.trusted_files.crtbegin = "file:$(GCC_LIB_PATH)/$(GCC_MAJOR_VERSION)/crtbegin.o" $(LD_TRUSTED_FILES) -sgx.allowed_files.tmp = file:/tmp -sgx.allowed_files.test_files = file:test_files -sgx.allowed_files.aout = file:a.out +sgx.allowed_files.tmp = "file:/tmp" +sgx.allowed_files.test_files = "file:test_files" +sgx.allowed_files.aout = "file:a.out" -sgx.allowed_files.hostdebug = file:/usr/lib/debug/usr/$(ARCH_LIBDIR) -sgx.allowed_files.hostusrlib = file:/usr/$(ARCH_LIBDIR) -sgx.allowed_files.hostlib = file:$(ARCH_LIBDIR) +sgx.allowed_files.hostdebug = "file:/usr/lib/debug/usr/$(ARCH_LIBDIR)" +sgx.allowed_files.hostusrlib = "file:/usr/$(ARCH_LIBDIR)" +sgx.allowed_files.hostlib = "file:$(ARCH_LIBDIR)" diff --git a/Examples/lighttpd/Makefile b/Examples/lighttpd/Makefile index dad8d572..51ab6a95 100644 --- a/Examples/lighttpd/Makefile +++ b/Examples/lighttpd/Makefile @@ -84,14 +84,14 @@ lighttpd-trusted-libs: lighttpd-deps for F in `cat lighttpd-deps`; do \ P=`$(LDD) $$LIGHTTPD_LIBS $(INSTALL_DIR)/sbin/lighttpd | $(GREP) $$F | $(AWK) '{print $$3; exit}'`; \ N=`echo $$F | tr --delete '-'`; \ - echo -n "sgx.trusted_files.$$N = file:$$P\\\\n"; \ + echo -n "sgx.trusted_files.$$N = \\\"file:$$P\\\"\\\\n"; \ done > $@ .INTERMEDIATE: lighttpd-trusted-mods lighttpd-trusted-mods: @for F in $(LIGHTTPD_LIBS); do \ N=`basename $$F .so | tr --delete '-'`; \ - echo -n "sgx.trusted_files.$$N = file:$$F\\\\n"; \ + echo -n "sgx.trusted_files.$$N = \\\"file:$$F\\\"\\\\n"; \ done > $@ lighttpd.manifest: lighttpd.manifest.template lighttpd-trusted-libs lighttpd-trusted-mods diff --git a/Examples/lighttpd/lighttpd.manifest.template b/Examples/lighttpd/lighttpd.manifest.template index d26d88ab..6d09eecd 100644 --- a/Examples/lighttpd/lighttpd.manifest.template +++ b/Examples/lighttpd/lighttpd.manifest.template @@ -6,53 +6,53 @@ # # ./pal_loader lighttpd.manifest