11. October 2022 #952
dimakuv
started this conversation in
Meeting notes
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Agenda
(please write your proposed agenda items in comments under this discussion)
UDS between independent Gramine instances
Ying presented a tiny PoC-level patch to Gramine that proves that it is possible to have an encrypted UDS between two independent Gramine instances. There are two changes:
Removing
instance_id
in the host-level UDS name in theget_gramine_unix_socket_addr()
function: https://github.com/gramineproject/gramine/blob/master/pal/src/host/linux-common/gramine_unix_socket_addr.c.strlen(name) > 64
to distinguish between app pipes and internal Gramine pipes/UDSes and app UDSes. The former have randomly-generated rather-long names, the latter typically have names that are less than 64 chars. This is a hack, and will not be admitted as a PR.bool is_shared_pipe
) in LibOS and PAL. This boolean will befalse
for application pipes, internal Gramine pipes, internal Gramine UDSes. And it will betrue
only for application UDSes.instance_id
to the LibOS component and move the creation of the host-socket name to the LibOS (as a concatenation ofinstance_id/random_name
for application pipes, internal Gramine pipes, internal Gramine UDSes and as simplyuds_name
for application UDSes).Using a sealing SGX key based on MRSIGNER to set up
g_master_key
here: https://github.com/gramineproject/gramine/blob/5fd2145632d81ff3d4af40899eb8f7fb2135e663/pal/src/host/linux-sgx/pal_main.c#L655?plain=1. This forces creation of the same pipes-encryption key for all Gramine instances with the same MRSIGNER, and so two independent Gramine instances are able to talk to each other.Gramine (the app) needs to talk to Occlum (remote server). Such deployment is part of the Enclave-CC project, and one more thing to implement/finalize.
[ Rather independent thought from Borys: Two Gramine instances have different FS views. So the same in-Gramine path of a UDS in one Gramine instance (on which the first enclave listens) may not be the same on the host as the same in-Gramine path in another Gramine instance (at which the second enclave connects). Generally, this problem concerns any files in independent Gramine instances (with their own manifest files). Even worse, this problem concerns the same Gramine instance, if the FS mount points start to alias. ]
Beta Was this translation helpful? Give feedback.
All reactions