Giter Club home page Giter Club logo

Comments (6)

adombeck avatar adombeck commented on May 24, 2024

The issue seems to be that the socket is not accessible from within the enclave, even though I included sgx.allowed_files.socket = file:socket in the manifest. If I create the socket in the enclave before connecting to it, it works without problems.

from graphene.

chiache avatar chiache commented on May 24, 2024

Hi, sorry for the late response.

The design of Graphene library OS makes it impossible to connect an application with UNIX socket created on the host. A Graphene instance acts like a guest OS, so no OS states are shared between Graphene and the host OS except external resources like files and sockets. If you need to connect the guest with the host, I suggest you use a loopback socket (bound on localhost).

Hope this helps!

from graphene.

adombeck avatar adombeck commented on May 24, 2024

The design of Graphene library OS makes it impossible to connect an application with UNIX socket created on the host. A Graphene instance acts like a guest OS, so no OS states are shared between Graphene and the host OS except external resources like files and sockets.

I don't see how Unix domain sockets are different in this aspect from files and sockets. I think you could share them with the host OS the same way like other files and sockets.
I'm currently using a "normal" socket as a workaround, so this doesn't have high priority for me, but maybe I will look into this at some point and prepare a patch.

from graphene.

chiache avatar chiache commented on May 24, 2024

Graphene is supposed to share OS states as little as possible with the host OS. Sharing one more abstraction means adding more routes for the untrusted OS to attack the applications in enclaves. For Linux applications, UNIX sockets are more treated as the in-kernel abstraction than an external resource like files or sockets. You can think of a guest OS as a container, which usually doesn't allow or recommend you to share UNIX sockets with the host OS.

from graphene.

donporter avatar donporter commented on May 24, 2024

I don't want to pull a lot of code into Graphene proper to special-case Unix sockets. But I think it would be acceptable on a Linux host to make a Unix socket look like an outward-facing pipe from Graphene's perspective. I would prefer to keep any changes in the manifest and PAL code (with some reasonable error handling for non-Unix systems).

from graphene.

donporter avatar donporter commented on May 24, 2024

@adombeck - would be happy to review a more concrete proposal (before you spend too much time coding something), or a pull request (obviously).

from graphene.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.