confidential-computing-modules
confidential-computing-modules copied to clipboard
[example/~/server] TEEノードのGraceful shutdown実装
- actix-webにより、基本的なgraceful shutdown機能は提供されている(https://github.com/actix/actix-website/blob/master/content/docs/server.md#graceful-shutdown)
- 一方、別途 enclaveのdestroyもshutdown時に実行する必要がある(
sgx_destroy_enclave
)
Reference
- https://github.com/apache/incubator-teaclave/commit/196419554ad25dcb86fc2fb1e807f62e9ee6c8e0
- https://dingelish.github.io/sgx_tse/sgx_types/fn.sgx_destroy_enclave.html
Intel® Software Guard Extensions (Intel® SGX) SDK for Linux* OS内の記述
Destroy an Enclave: To release the enclave memory, you need to invoke sgx_destroy_enclave provided by the sgx_urts library. It will recycle the EPC memory and untrus- ted resources used by that enclave instance.
oakのshutdown実装 https://github.com/project-oak/oak/blob/21d434914aecd6441dd25df06bac7cff047ce14b/oak_loader/src/main.rs#L58-L73