This repository contains research and a rewrite of the code from aws-nitro-enclaves-samples/vsock_sample/py. The goal is to demonstrate how to use VSOCK in an AWS Enclave environment and to rewrite the code without using third-party modules.
For graceful error handling, please refer to mdlayher/vsock.
This repository is divided into two main folders:
- portable
- full node
In the portable folder, I used golang.org/x/sys/unix directly without applying proper design decisions.
In the full node folder, I separated concerns based on AWS Enclave environment and VSOCK logic. For VSOCK logic, I created a library at PyiTheinKyaw/vsock and imported it in server.go
and client.go
.
This script is used to build the Docker image. It has two options:
-pt
: Refers to the portable version.-fl
: Refers to the full version.
After building, the EIF file will be placed under the eif/
folder.
This script is used to run the generated EIF. Users can provide a custom CID and choose whether to run the enclave in debug mode or not.
You can change the port number in the .env
file.