Skip to content
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

FR: Separate BoringSSL interface to have a minimal trusted interface internally to an enclave #8

Open
mr-ma opened this issue Aug 1, 2018 · 5 comments

Comments

@mr-ma
Copy link

mr-ma commented Aug 1, 2018

I wonder if the current BoringSSL wrapper is actually benefiting from the trusted hardware (see https://github.com/google/channel-id-enclave/tree/master/boringssl). Simply put, are the secrets (private key, session key, etc.) allocated inside enclaves?

@deeglaze
Copy link
Contributor

deeglaze commented Aug 1, 2018

Will you please elaborate on what you mean by "allocated inside enclaves"? Do you mean actual memory allocation, the creation of keys from a random source, or how one gets secret keys into an enclave from an untrusted environment?

@mr-ma
Copy link
Author

mr-ma commented Aug 2, 2018

Yep, more specifically, I'm curious to know if private keys, session keys used to communicate with clients, and all the code related to the TLS protocol implementation (e.g. SSL_read() and SSL_write()) are placed inside enclaves.
Right now, I'm more concerned about the runtime protection of TLS in hostile environments. Secure secret provisioning would be the next problem to tackle.

@deeglaze
Copy link
Contributor

deeglaze commented Aug 2, 2018

Every instance of memory allocation, either via the stack, malloc, or new, are all internal to enclaves. The enclave heap is entirely within the enclave memory, and the BoringSSL code is statically linked into Asylo enclave object files, so everything is within the enclave.

It is very awkward to write memory outside of the enclave. The only interface that does it is our boundary-crossing code. You essentially have to cast an int passed in from the untrusted environment to a void* in order to start writing to untrusted memory.

@mr-ma
Copy link
Author

mr-ma commented Aug 3, 2018

Thanks for the clarification. This is actually convenient.
However, shipping the entire TLS library into an enclave yields an excessive code base residing in trusted regions, which is in some cases undesirable (see the main motivation behind Glamdring)

IMO it would be very useful to have a trusted BoringSSL library in which only sensitive code (ssl_read, ssl_write, etc.) and data (private keys and session secrets) reside inside enclaves.

@deeglaze
Copy link
Contributor

deeglaze commented Aug 6, 2018

Okay, yes. Asylo currently doesn't have a lightweight way to call out of the enclave to user-defined interfaces/library wrappers. You can achieve this by using gRPC to make RPCs out of the enclave. This is an interesting offering for minimizing the TCB, so we'll keep it in mind for our roadmap.

I'll keep this issue open and edit the title to track this feature request.

@deeglaze deeglaze changed the title BoringSSL wrapper and trusted hardware FR: Separate BoringSSL interface to have a minimal trusted interface internally to an enclave Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants