In this demo the string Hello SGX World from Ruby is written into the file HelloAgain.txt. The Ruby application is in folder /app/Hello.rb.
- The Docker entrypoint executes first
Hello.rbwith ruby and renames the file toHelloAgainUnsafe.txt. - Next it executes
Hello.rbagain, this time with ruby-sgx.- Note, when ruby-sgx writes a file it is encrypted with a key only the container it knows.
- Both files are written to the shared folder
/tmp/secret. - We observe that in the shared folder
- file
HelloAgainUnsafe.txtis in plaintext, while - file
HelloAgain.txtis encrypted
- file
docker compose build
docker compose up
Compare the files:
cd /tmp/secret/
ls
cat HelloAgain.txt
cat HelloAgainUnsafe.txt