Skip to content

Commit ab58063

Browse files
committed
feat: update signing key generation and image tagging for TEE application
1 parent d68429a commit ab58063

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

src/guides/build-iapp/advanced/create-your-first-sgx-app.md

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,19 @@ chmod +x sconify.sh
7474

7575
## Build the TEE docker image
7676

77+
Before wrapping your iExec confidential application with Scone, you need to
78+
generate a custom signing key. This key is required for the sconification
79+
process and will be referenced in the Docker command below.
80+
81+
Generate your enclave signing key with:
82+
83+
```bash
84+
openssl genrsa -3 -out enclave-key.pem 3072
85+
```
86+
87+
This will create an `enclave-key.pem` file in your current directory. You will
88+
use this file in the sconify Docker command to sign your TEE image.
89+
7790
We will use the following script to wrap the sconification process, copy the
7891
`sconify.sh` script in the current directory:
7992

@@ -88,10 +101,11 @@ ENTRYPOINT="node /app/app.js"
88101
# Declare image related variables
89102
IMG_NAME=tee-scone-hello-world
90103
IMG_FROM=<docker-hub-user>/hello-world:1.0.0
91-
IMG_TO=<docker-hub-user>/${IMG_NAME}:1.0.0-debug
104+
IMG_TO=<docker-hub-user>/${IMG_NAME}:1.0.0
92105

93106
# Run the sconifier to build the TEE image based on the non-TEE image
94107
docker run -it --rm \
108+
-v $PWD/enclave-key.pem:/sig/enclave-key.pem \
95109
-v /var/run/docker.sock:/var/run/docker.sock \
96110
registry.scontain.com/scone-production/iexec-sconify-image:5.9.1-v16\
97111
sconify_iexec \
@@ -122,10 +136,11 @@ ENTRYPOINT="python3 /app/app.py"
122136
# Declare image related variables
123137
IMG_NAME=tee-scone-hello-world
124138
IMG_FROM=<docker-hub-user>/hello-world:1.0.0
125-
IMG_TO=<docker-hub-user>/${IMG_NAME}:1.0.0-debug
139+
IMG_TO=<docker-hub-user>/${IMG_NAME}:1.0.0
126140

127141
# Run the sconifier to build the TEE image based on the non-TEE image
128142
docker run -it \
143+
-v $PWD/enclave-key.pem:/sig/enclave-key.pem \
129144
-v /var/run/docker.sock:/var/run/docker.sock \
130145
registry.scontain.com/scone-production/iexec-sconify-image:5.9.1-v16\
131146
sconify_iexec \
@@ -158,21 +173,11 @@ Run the `sconify.sh` script to build the Scone TEE application:
158173
Push your image on DockerHub:
159174

160175
```bash
161-
docker push <docker-hub-user>/tee-scone-hello-world:1.0.0-debug
176+
docker push <docker-hub-user>/tee-scone-hello-world:1.0.0
162177
```
163178

164179
Congratulations, you just built your Scone TEE application.
165180

166-
::: info
167-
168-
You may have noticed the `tee-debug` flag in the image name, the built image is
169-
actually in TEE debug mode, this allows you to have some debug features while
170-
developing the app.
171-
172-
Once you are happy with the debug app, contact us to go to production!
173-
174-
:::
175-
176181
## Test your app on iExec
177182

178183
At this stage, your application is ready to be tested on iExec. The process is
@@ -198,7 +203,7 @@ Edit `iexec.json` and fill in the standard keys and the `mrenclave` object:
198203
"owner": "<your-wallet-address>", // starts with 0x
199204
"name": "tee-scone-hello-world", // application name
200205
"type": "DOCKER",
201-
"multiaddr": "docker.io/<docker-hub-user>/tee-scone-hello-world:1.0.0-debug", // app image
206+
"multiaddr": "docker.io/<docker-hub-user>/tee-scone-hello-world:1.0.0", // app image
202207
"checksum": "<checksum>", // starts with 0x, update it with your own image digest
203208
"mrenclave": {
204209
"framework": "SCONE", // TEE framework (keep default value)
@@ -225,7 +230,7 @@ Run your TEE image with `SCONE_HASH=1` to get the enclave fingerprint
225230
(mrenclave):
226231

227232
```bash
228-
docker run --rm -e SCONE_HASH=1 <docker-hub-user>/tee-scone-hello-world:1.0.0-debug
233+
docker run --rm -e SCONE_HASH=1 <docker-hub-user>/tee-scone-hello-world:1.0.0
229234
```
230235

231236
:::

0 commit comments

Comments
 (0)