Closed black197 closed 2 years ago
@boryspoplawski is working on the Big Sockets Rewrite. Borys, does this sound familiar to you? I think we indeed had some problems with AF_UNIX
sockets in Python. Is this a legit issue? Will it be fixed in your rewrite?
It should work even now, no idea why it does not.
Will it be fixed in your rewrite?
Hopefully.
@black197 could you verify if https://github.com/gramineproject/gramine/pull/579 fixes the problem? It does for me
@black197 could you verify if #579 fixes the problem? It does for me
It works. Thank you very much.
@black197 That PR is still not merged, this issue will be closed automatically on merge.
@black197 That PR is still not merged, this issue will be closed automatically on merge.
Got it. Besides, I noticed that in #579 there's no entry for UNIX socket in FS. So how am I able to connect to the socket outside gramine, like in another program? I appreciate any help.
So how am I able to connect to the socket outside gramine, like in another program?
You cannot do this with UNIX domain sockets (AF_UNIX
sockets). This is a deliberate security decision in Gramine.
The reason behind this is that UNIX domain sockets are automatically encrypted by Gramine (similarly to classic pipes). So when two Gramine threads/processes communicate with each other via UNIX domain sockets, then share an encryption key and know how to transparently encrypt/decrypt packets sent on these sockets.
This cannot be done in any secure and transparent way when Gramine process would communicate with an outside program. The outside program doesn't know how to encrypt UNIX domain sockets, and doesn't have the encryption key (that is only shared between Gramine processes).
That's why the only sockets that allow communication of Gramine with other programs is AF_INET
(classic TCP or UDP connections).
@dimakuv Oh I see. Thank you very much. Then I have to try other ways.
Description of the problem
I want to run gramine-sgx in ubuntu18.04 docker container so I built gramine from master and successfully run the helloworld with gramine-sgx. And I'm tring to bind unix socket in python3.6 with gramine-sgx but it failed. It doesn't work with gramine-direct too. If I run it without gramine, the python script can work fine.
Here's my output:
Here's part of my python code:
Makefile:
And fdk.manifest:
Gramine commit hash
commit 35a6654c