-
Notifications
You must be signed in to change notification settings - Fork 159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integration with Graphene #525
Comments
Hi @bigdata-memory, thanks for the proposal. Teaclave is a FaaS-like platform consisting of multiple services. One can register and invoke functions to the platform through the frontend service. Then, Teaclave will help to do authentication, authorization, task preparation, etc and finally dispatch a task to the execution service. Currently, we have three executors for different languages and scenarios. For example, the builtin executor only execute functions written in Rust natively, while, the mesapy executor can run functions written in Python dynamically. Therefore, to integrate with Graphene, or any other LibOS kind of system in Teaclave, we need to introduce another kind of executor. Luckly, the execution service in Teaclave are designed as a stateless and isolated service which takes a task, executes it and write back the result. Inputs/Outputs of a functions are defined as function arguments, input/output files stored in protected file system. In our design, we prohibit any untrusted I/O interfaces (e.g., write date to the untrusted file system, networks I/O) in the executor to protecting sensitive data operated by the function. Above are some background about our design rationals. Here, I list some concepts involved in integrating with Graphene.
Recently, we added a WebAssembly executor. You can see recents changes to see how to add an executor in Teaclave. Here is a simple document https://teaclave.apache.org/docs/adding-executors/. The WebAssembly executor is just a reference. For integrating with Graphene (or other LibOS executors), the design may be different. I'm not sure whether to link the LibOS within the execution service or put it as a separate enclave along with the execution service. The later may need additional attestation mechanism. At last, can you propose a simple design so that we can work on it together? Please let me know if you have any questions regarding to the current Teaclave design. Thanks! |
Hi @mssun, Thanks you very much for the detailed explanation on leveraging LibOS kind system in Teaclave. It is very helpful for us to work on this effectively. the GSGX so far only has relative stable CLI interface and its internal APIs are not designed for 3rd party integration since it's API still under evolving. roughly, we may consider to running GSGX instance as sidecars along with its execution driver service and do mutual attestation with its driver beforehand. It is just my preliminary idea for now, we may define assumption, constraints and requirements for this soon later. Thanks! |
In attestation page, the way to binding is |
We don't have the revoking mechanism currently. Right now, there is a freshness timer for the attestation/certificate. Once it's timeout, the service will do another attestation and update the report, re-issue the certificate as well. |
I'm also interested in incorporating Graphene as an Executor of Teaclave. However, I think we must take serious consideration about the interfaces of Graphene (mainly system calls). As @bigdata-memory mentioned, many syscalls are handled by libOS, but there're also many syscalls which are forwarded, either in unaltered way or with some changes, to the OS kernel. These forwarded syscalls includes I/O operations on file system, Networks, as well as timing system (e.g. To avoid using such untrusted interfaces and information leakage on these interfaces, Teaclave implements no untrusted interface. And Graphene aims to support trusted binary, whereas Teaclave assumes potentially malicious function. Such difference in threat model results in the differences on supported/exposed interfaces to binaries/functions running inside Graphene/Teaclave. If we want to leverage Graphene's power, we may need to think about several questions:
|
Hi @ya0guang, Glad to know you also got interested in this. Yes. as you mentioned, the Graphene forwards many |
Hi @mssun, as we talked, the |
In addition, |
Hi @ya0guang I'm studying the PR #504 as a guide to adding Graphene as an executor. In the example script wasm_simple_add.py, the payload_file: wasm_simple_add_payload/simple_add.wasm is loaded and registered in |
Hi @bigdata-memory , I think you're right about this example! Since the enclave measurement is determined by its initial code and data before instantiation, the payload which is loaded into Teaclave after instantiation cannot affect the measurement. At least for MesaPy and WASM executor, the payload is uploaded by the user and then loaded after enclave instantiation. However I guess the story may be different for the |
@bigdata-memory, thanks for pointing out this issue. I just checked that Graphene is in LGPL v3.0 license. As stated in ASF 3rd Party License Policy:
Therefore, I suggest NOT to include any Graphene code in Teaclave or as a third-party dependency. Given this situation, if we plan to integrate with Graphene. I suggest to do the followings in Teaclave:
|
@mssun, thank you for the suggestion. regarding |
@bigdata-memory Regarding the design, how is that going to facilitate the attestation flow in the Teaclave? Will it provide additional features or benefits on top of it? |
@hanboa Thank you for this question, Yes, you are right, the attestation flow is not explicitly shown here, In this design draft, we consider to retrieve the |
@mssun As we discussed, It is quite challenging to maintain the security model for this integration because the GSGX is not designed to be integrated at API level, it has to be running in external processes, the secrets and encrypted workload/inputs/arguments are required to be exchanged with a new pre-load module which, in turns, needs to do the following tasks:
In addition, The GSGX is limited to run unique workload, it means it doesn't natively support measurement decoupling feature (refused by GSGX maintainer ITL), it implies a huge performance penalties and significant SGX resource consumption for FaaS usage scenario. |
Motivation & problem statement
As #502 questioned that the integration with a LibOS would be interesting feature for a FaaS platform because allowing to run regular app. directly in enclave along with LibOS handling most syscalls may further improve the usability and simplify the usage model. Theoretically, the performance might be improved slightly as well. from the other side, the app. dev. is agnostic to the LibOS/Kernel. so the app. might contains IO/Mem intensive operations that will have negative impact on performance even stability.
Proposed solution
Regarding Graphene, which is a LibOS that can support unmodified app. to run inside enclave, its multiple process feature may not be very useful for FaaS. In this stage, I think we may need to define an interface for LibOS kind integration first to manage the lifecycle&IO of trusted LibOS enclave instance.
The text was updated successfully, but these errors were encountered: