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

Alpine Linux support #105

Open
mssun opened this issue Oct 19, 2022 · 7 comments
Open

Alpine Linux support #105

mssun opened this issue Oct 19, 2022 · 7 comments

Comments

@mssun
Copy link

mssun commented Oct 19, 2022

Description of the problem

Since Gramine doesn't support Alpine Linux (gramineproject/gramine#993), same thing for GSC.

Note that this issue depends on the feature of supporting Gramine in Alpine.

@dimakuv
Copy link
Contributor

dimakuv commented Oct 20, 2022

This also depends on: are all Gramine run-time dependencies available as packages on Alpine?

When I look at our minimalistic Docker image: https://github.com/gramineproject/gramine/blob/master/packaging/docker/Dockerfile

I see:

  • curl gnupg2 binutils packages -- should be available on Alpine
  • SGX SDK/PSW packages -- AFAIK they are not available on Alpine

@mssun Do you know if SGX SDK/PSW is supported on Alpine? Also, did you try to build Gramine on Alpine (I think it should work if we enable musl and maybe disable glibc during meson setup)?

@mssun
Copy link
Author

mssun commented Oct 20, 2022

I don't think SGX SDK/PSW supports Apline officially.

For SGX SDK/PSW, what functions does Gramine use with the SDK/PSW specifically? If this is for architectural enclaves, we can suggest to use the host AESM service and map the domain socket file (/run/aesmd/aesmd.socket) into container.

I did an initial PoC of Gramine on Alpine. I compiled Gramine with Ubuntu, copied all Gramine artifacts to Alpine (Alpine may have different directory structure), resolved library dependencies (e.g., Python, glibc, protobuf, make, etc.). With these efforts, I can successfully compile the manifest file, sign the enclave, and run the hello world sample with gramine-sgx. However, this is just a PoC and a complete testing is needed.

@dimakuv
Copy link
Contributor

dimakuv commented Oct 21, 2022

Gramine needs SGX SDK/PSW for two purposes:

I agree that for the first purpose (AESM services), we can suggest to use AESM service from the host and map its socket into the container. This will unfortunately mean that it will be impossible to use a bare-metal (non-container) deployment of Gramine, but maybe it's good enough for now.

The second purpose (libsgx_dcap_quoteverify.so) is more complicated. Gramine links against this library, so it must be placed into the Alpine container. I'm unclear if e.g. one can simply copy this shared library (and maybe some of its dependency files) from an Ubuntu system to the Alpine container, and it will just work.

Well, the second purpose is only relevant if Gramine wants to use DCAP remote attestation (more specifically, DCAP quote verification). I would say that this doesn't happen in all scenarios, but I guess it's a pretty important part of SGX flows. So we need to solve this issue somehow, otherwise Gramine-on-Alpine will have a serious limitation.

@mssun It would be interesting to perform a test of DCAP quote verification in Gramine. For example, to run a ra-tls-mbedtls example. If we make this example work (in a not too hacky way), then I think we can work on a real Alpine support.

@dimakuv
Copy link
Contributor

dimakuv commented Nov 16, 2022

@MWShan (a maintainer of Intel SGX SDK/PSW/DCAP) told me that the libsgx_dcap_quoteverify.so library can be simply built inside of the Alpine container, against the Musl C lib. The library should be built from https://github.com/intel/SGXDataCenterAttestationPrimitives/, under the QuoteVerification/ directory. It should be straight-forward since it doesn't depend on anything special.

@anirudhgargi
Copy link

Is there any plans to support Alpine in GSC soon ? I see gramine got the support in here.

@dimakuv
Copy link
Contributor

dimakuv commented Sep 11, 2023

Is there any plans to support Alpine in GSC soon ? I see gramine got the support in here.

@aneessahib @anjalirai-intel @sahason Do you know if anyone is working on this support?

@aneessahib
Copy link
Contributor

@sahason will start some work on this, but priority will be best effort.

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

4 participants