You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+66-56Lines changed: 66 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,27 +4,26 @@
4
4
5
5
The _iExec Secret Management Service_ (SMS) stores user secrets and provisions them to authorized Trusted Execution Environment (TEE) applications running on the iExec network.
6
6
7
-
Two TEE frameworks for TEE tasks are supported on the iExec platform:
8
-
9
-
* Scone
10
-
* Gramine
7
+
> [!IMPORTANT]
8
+
> Support for Intel TDX based TEE enclaves is being introduced on the iExec platform.
9
+
> The Scone and Gramine TEE SGX frameworks are being deprecated and their support will be removed in the future.
11
10
12
11
### Details
13
12
14
-
* Confidential assets you have (password, token, API key, AES key, ..) should be securely transferred from your machine to the SMS over a TLS channel (iExec SDK is recommended). This operation is only done once.
13
+
* Confidential assets you own (password, token, API key, AES key, ..) should be securely transferred from your machine to the SMS over a TLS channel (iExec SDK is recommended). This operation is only done once.
15
14
* Internally, secrets are encrypted with standard AES encryption before being written to disk.
16
15
* The iExec SMS secret provisioning policy is based on on-chain ACL (PoCo). PoCo smart contracts define simple ACL rules where individuals have ownership of on-chain objects they have deployed (workerpool, application, secret-dataset & requester).
17
16
* Each individual who is the owner of an object could define a policy on it. For example, "As a Requester (0xAlice), I only authorize my confidential Secret-Dataset (0xSecretOfAlice) to be used by the application of Bob (0xAppOfBob) I trust which will run on the Workerpool of Carl (0xWorkerpoolOfCarl)".
18
-
* When the secure application of Bob starts, the secret of Alice is written into a temporary session and sent over TLS to a dedicated Configuration & Attestation Service (CAS) enclave responsible for communicating with the final application enclave.
17
+
* When the secure application of Bob starts, the secret of Alice is written into a temporary session and sent over TLS to a dedicated Configuration & Attestation Service (CAS) enclave responsible for communicating with the final application enclave.
19
18
* If the application enclave is legit (measurable with its mrenclave with Scone), it will receive the secrets.
20
-
* To sum up, if all checks are correct, the secret of Alice will cross the following environments: Alice-Host -> iExec-SMS -> Scone-CAS -> Bob-Scone-Application
19
+
* To sum up, if all checks are correct, the secret of Alice will cross the following environments:
20
+
Alice-Host -> iExec-SMS -> TEE Session Storage (depends on TEE framework) -> Bob-Application (running in a TEE enclave)
21
21
22
22
## Configuration
23
23
24
24
The _iExec Secret Management Service_ is available as an OCI image on [Docker Hub](https://hub.docker.com/r/iexechub/iexec-sms/tags).
25
25
26
26
A single _iExec Secret Management Service_ instance supports a single TEE framework.
27
-
To support both Scone and Gramine TEE tasks, two instances of _iExec SMS_ must be configured.
28
27
29
28
To run properly, the _iExec Secret Management Service_ requires:
30
29
* A blockchain node. iExec smart contracts must be deployed on the blockchain network.
@@ -33,52 +32,61 @@ To run properly, the _iExec Secret Management Service_ requires:
33
32
* for Scone TEE tasks:
34
33
* a Scontain _Configuration and Attestation Service_ (CAS).
35
34
* a valid OCI image configuration of a Scontain _Local Attestation Service_ (LAS). This service will be deployed by an iExec Worker to compute TEE tasks.
36
-
* for Gramine TEE tasks:
37
-
* an _iExec Secret Provisioner Service_ (_iExec SPS_) instance.
35
+
* for TDX TEE tasks:
36
+
* an _iExec Session Storage_ instance.
37
+
* a _iExec Secret Broker Server_ instance.
38
38
39
39
The _iExec Secret Management Service_ can be started locally for development purpose.
40
40
It is not advised to use an instance with such configuration in production.
41
41
42
42
To support:
43
43
* Scone TEE tasks, set `IEXEC_SMS_TEE_RUNTIME_FRAMEWORK=scone`, then configure the SMS with properties of all following tables.
44
-
*Gramine TEE tasks, set `IEXEC_SMS_TEE_RUNTIME_FRAMEWORK=gramine`, then configure the SMS with properties of following table.
44
+
*TDX TEE tasks, set `IEXEC_SMS_TEE_RUNTIME_FRAMEWORK=tdx`, then configure the SMS with properties of following table.
45
45
46
-
### Environment variables (Scone or Gramine TEE framework)
46
+
### Properties and environment variables
47
47
48
-
| Environment variable | Description | Type | Default Scone-configuration value | Default Gramine-configuration value |
48
+
|Property name |Environment variable | Description | Type | Default value |
49
49
| --- | --- | --- | --- | --- |
50
-
|`IEXEC_SMS_TEE_RUNTIME_FRAMEWORK`| Define which TEE framework this _iExec SMS_ supports. |`scone` or `gramine`|||
51
-
|`IEXEC_SMS_PORT`| Server HTTP port. | Positive integer |`13300`|`13300`|
52
-
|`IEXEC_SMS_H2_URL`| JDBC URL of the database. | URL |`jdbc:h2:file:/data/sms-h2`|`jdbc:h2:file:/data/sms-h2`|
53
-
|`IEXEC_SMS_H2_CONSOLE`| Whether to enable the H2 console. | Boolean |`false`|`false`|
54
-
|`IEXEC_SMS_STORAGE_ENCRYPTION_AES_KEY_PATH`| Path to the key created and used to encrypt secrets. | String |`src/main/resources/iexec-sms-aes.key`|`src/main/resources/iexec-sms-aes.key`|
55
-
|`IEXEC_SMS_ADMIN_API_KEY`| API key used to authorize calls to `/admin` endpoints. | String |||
56
-
|`IEXEC_SMS_ADMIN_STORAGE_LOCATION`| Storage location where to persist replicated backups. It must be an absolute directory path. | String |`/backup`|`/backup`|
57
-
|`IEXEC_CHAIN_ID`| Chain ID of the blockchain network to connect. | Positive integer |`134`|`134`|
58
-
|`IEXEC_IS_SIDECHAIN`| Define whether iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean |`true`|`true`|
59
-
|`IEXEC_BLOCKCHAIN_NODE_ADDRESS`| URL to connect to the blockchain node. | URL |`https://bellecour.iex.ec`|`https://bellecour.iex.ec`|
60
-
|`IEXEC_HUB_ADDRESS`| Proxy contract address to interact with the iExec on-chain protocol. | String |`0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f`|`0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f`|
61
-
|`IEXEC_BLOCK_TIME`| Duration between consecutive blocks on the blockchain network. | String |`PT5S`|`PT5S`|
62
-
|`IEXEC_GAS_PRICE_MULTIPLIER`| Transactions will be sent with `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER`. | Float |`1.0`|`1.0`|
63
-
|`IEXEC_GAS_PRICE_CAP`| In Wei, will be used for transactions if `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER > IEXEC_GAS_PRICE_CAP`. | Integer |`22000000000`|`22000000000`|
64
-
|`IEXEC_SECRET_PROVISIONER_WEB_HOSTNAME`| Secret provisioner server host for session management. Used to post sessions of secrets. | String |`localhost`|`localhost`|
65
-
|`IEXEC_SECRET_PROVISIONER_WEB_PORT`| Secret provisioner server port for session management. | Positive integer |`8081`|`8080`|
66
-
|`IEXEC_SECRET_PROVISIONER_ENCLAVE_HOSTNAME`| Secret provisioner server host for retrieving secrets from attested enclaves. Typically used by workers to execute TEE tasks. | Positive integer |`localhost`|`localhost`|
67
-
|`IEXEC_SECRET_PROVISIONER_ENCLAVE_PORT`| Secret provisioner server port for retrieving secrets from attested enclaves. | Positive integer |`18765`|`4433`|
68
-
|`IEXEC_TEE_CHALLENGE_CLEANUP_CRON`| Cron expression to configure TEE challenges cleanup policy. | String |`@hourly`|`@hourly`|
69
-
|`IEXEC_TEE_CHALLENGE_CLEANUP_MAX_BATCH_SIZE`| Max number of TEE challenges whose missing deadline could be set at a given time. | Integer |`500`|`500`|
70
-
|`IEXEC_TEE_CHALLENGE_CLEANUP_RETENTION_DURATION`| Retention duration when setting missing final deadline. | Duration |`P5D`|`P5D`|
71
-
|`TEE_WORKER_PIPELINES_0_VERSION`| Worker pipeline version | String |`v5`|`v5`|
72
-
|`TEE_WORKER_PIPELINES_0_PRECOMPUTE_IMAGE`| TEE enabled OCI image name for worker pre-compute stage | String |||
73
-
|`TEE_WORKER_PIPELINES_0_PRECOMPUTE_FINGERPRINT`| Fingerprint (mrenclave) of the TEE enabled worker pre-compute image | String |||
74
-
|`TEE_WORKER_PIPELINES_0_PRECOMPUTE_HEAPSIZE`| Required heap size for a worker pre-compute enclave using units like KB, MB, GB | DataSize |`3GB`|`3GB`|
75
-
|`TEE_WORKER_PIPELINES_0_PRECOMPUTE_ENTRYPOINT`| Command executed when starting a container from the TEE enabled worker pre-compute image | String |`java -jar /app/app.jar`|`/bin/bash /apploader.sh`|
76
-
|`TEE_WORKER_PIPELINES_0_POSTCOMPUTE_IMAGE`| TEE enabled OCI image name for worker post-compute stage | String |||
77
-
|`TEE_WORKER_PIPELINES_0_POSTCOMPUTE_FINGERPRINT`| Fingerprint (mrenclave) of the TEE enabled worker post-compute image | String |||
78
-
|`TEE_WORKER_PIPELINES_0_POSTCOMPUTE_HEAPSIZE`| Required heap size for a worker post-compute enclave using units like KB, MB, GB | DataSize |`3GB`|`3GB`|
79
-
|`TEE_WORKER_PIPELINES_0_POSTCOMPUTE_ENTRYPOINT`| Command executed when starting a container from the TEE enabled worker post-compute image | String |`java -jar /app/app.jar`|`/bin/bash /apploader.sh`|
50
+
|`spring.profiles.active`|`IEXEC_SMS_TEE_RUNTIME_FRAMEWORK`| Define which TEE framework this _iExec SMS_ supports. |`scone` or `tdx`||
51
+
|`server.port`|`IEXEC_SMS_PORT`| Server HTTP port. | Positive integer |`13300`|
52
+
|`spring.datasource.url`|`IEXEC_SMS_H2_URL`| JDBC URL of the database. | URL |`jdbc:h2:file:/data/sms-h2`|
53
+
|`spring.h2.console.enabled`|`IEXEC_SMS_H2_CONSOLE`| Whether to enable the H2 console. | Boolean |`false`|
54
+
|`encryption.aes-key-path`|`IEXEC_SMS_STORAGE_ENCRYPTION_AES_KEY_PATH`| Path to the key created and used to encrypt secrets. | String |`src/main/resources/iexec-sms-aes.key`|
55
+
|`admin.api-key`|`IEXEC_SMS_ADMIN_API_KEY`| API key used to authorize calls to `/admin` endpoints. | String ||
56
+
|`admin.storage-location`|`IEXEC_SMS_ADMIN_STORAGE_LOCATION`| Storage location where to persist replicated backups. It must be an absolute directory path. | String |`/backup`|
57
+
|`chain.id`|`IEXEC_CHAIN_ID`| Chain ID of the blockchain network to connect. | Positive integer |`134`|
58
+
|`chain.sidechain`|`IEXEC_IS_SIDECHAIN`| Define whether iExec on-chain protocol is built on top of token (`false`) or native currency (`true`). | Boolean |`true`|
59
+
|`chain.node-address`|`IEXEC_BLOCKCHAIN_NODE_ADDRESS`| URL to connect to the blockchain node. | URL |`https://bellecour.iex.ec`|
60
+
|`chain.hub-address`|`IEXEC_HUB_ADDRESS`| Proxy contract address to interact with the iExec on-chain protocol. | String |`0x3eca1B216A7DF1C7689aEb259fFB83ADFB894E7f`|
61
+
|`chain.block-time`|`IEXEC_BLOCK_TIME`| Duration between consecutive blocks on the blockchain network. | String |`PT5S`|
62
+
|`chain.gas-price-multiplier`|`IEXEC_GAS_PRICE_MULTIPLIER`| Transactions will be sent with `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER`. | Float |`1.0`|
63
+
|`chain.gas-price-cap`|`IEXEC_GAS_PRICE_CAP`| In Wei, will be used for transactions if `networkGasPrice * IEXEC_GAS_PRICE_MULTIPLIER > IEXEC_GAS_PRICE_CAP`. | Integer |`22000000000`|
64
+
|`ipfs.gateway-url`|| Url of the IPFS gateway to use to fetch bulk processing related data when handling such a task. | URL ||
65
+
|`metrics.storage.refresh-interval`|`IEXEC_SMS_METRICS_STORAGE_REFRESH_INTERVAL`| Time interval in seconds between consecutive queries to fetch database content statistics. | Integer | 30 |
66
+
|`tee.secret-provisioner.web.hostname`|`IEXEC_SECRET_PROVISIONER_WEB_HOSTNAME`| Secret provisioner server host for session management. Used to post sessions of secrets. | String |`localhost`|
67
+
|`tee.secret-provisioner.web.port`|`IEXEC_SECRET_PROVISIONER_WEB_PORT`| Secret provisioner server port for session management. | Positive integer ||
68
+
|`tee.secret-provisioner.enclave.hostname`|`IEXEC_SECRET_PROVISIONER_ENCLAVE_HOSTNAME`| Secret provisioner server host for retrieving secrets from attested enclaves. Typically used by workers to execute TEE tasks. | Positive integer |`localhost`|
69
+
|`tee.secret-provisioner.enclave.port`|`IEXEC_SECRET_PROVISIONER_ENCLAVE_PORT`| Secret provisioner server port for retrieving secrets from attested enclaves. | Positive integer ||
70
+
|`tee.challenge.cleanup.cron`|`IEXEC_TEE_CHALLENGE_CLEANUP_CRON`| Cron expression to configure TEE challenges cleanup policy. | String |`@hourly`|
71
+
|`tee.challenge.cleanup.missing-deadline-max-batch-size`|`IEXEC_TEE_CHALLENGE_CLEANUP_MAX_BATCH_SIZE`| Max number of TEE challenges whose missing deadline could be set at a given time. | Integer |`500`|
72
+
|`tee.challenge.cleanup.missing-deadline-retention-duration`|`IEXEC_TEE_CHALLENGE_CLEANUP_RETENTION_DURATION`| Retention duration when setting missing final deadline. | Duration |`P5D`|
73
+
|`tee.worker.pipelines[].version`|`TEE_WORKER_PIPELINES_0_VERSION`| Worker pipeline version | String |`v5`|
74
+
|`tee.worker.pipelines[].pre-compute.image`|`TEE_WORKER_PIPELINES_0_PRECOMPUTE_IMAGE`| TEE enabled OCI image name for worker pre-compute stage | String ||
75
+
|`tee.worker.pipelines[].pre-compute.fingerprint`|`TEE_WORKER_PIPELINES_0_PRECOMPUTE_FINGERPRINT`| Fingerprint (mrenclave) of the TEE enabled worker pre-compute image | String ||
76
+
|`tee.worker.pipelines[].pre-compute.heap-size`|`TEE_WORKER_PIPELINES_0_PRECOMPUTE_HEAPSIZE`| Required heap size for a worker pre-compute enclave using units like KB, MB, GB | DataSize |`1GB`|
77
+
|`tee.worker.pipelines[].pre-compute.entrypoint`|`TEE_WORKER_PIPELINES_0_PRECOMPUTE_ENTRYPOINT`| Command executed when starting a container from the TEE enabled worker pre-compute image | String |`/app/tee-worker-pre-compute`|
78
+
|`tee.worker.pipelines[].post-compute.image`|`TEE_WORKER_PIPELINES_0_POSTCOMPUTE_IMAGE`| TEE enabled OCI image name for worker post-compute stage | String ||
79
+
|`tee.worker.pipelines[].post-compute.fingerprint`|`TEE_WORKER_PIPELINES_0_POSTCOMPUTE_FINGERPRINT`| Fingerprint (mrenclave) of the TEE enabled worker post-compute image | String ||
80
+
|`tee.worker.pipelines[].post-compute.heap-size`|`TEE_WORKER_PIPELINES_0_POSTCOMPUTE_HEAPSIZE`| Required heap size for a worker post-compute enclave using units like KB, MB, GB | DataSize |`1GB`|
81
+
|`tee.worker.pipelines[].post-compute.entrypoint`|`TEE_WORKER_PIPELINES_0_POSTCOMPUTE_ENTRYPOINT`| Command executed when starting a container from the TEE enabled worker post-compute image | String |`/app/tee-worker-post-compute`|
82
+
83
+
> [!IMPORTANT]
84
+
> The environment variables are starting to be sunset in order to bring better configurability in the future.
85
+
> It is recommended to use variables derived from application properties to benefit from Spring framework features
86
+
> (see [Relaxed Binding](https://docs.spring.io/spring-boot/3.3/reference/features/external-config.html#features.external-config.typesafe-configuration-properties.relaxed-binding)).
80
87
81
88
## Heap Size Configuration
89
+
82
90
The heap size configuration supports the following units:
83
91
84
92
-**B** for bytes
@@ -88,36 +96,38 @@ The heap size configuration supports the following units:
88
96
-**TB** for terabytes
89
97
90
98
### Example Values
99
+
91
100
-`3GB`
92
101
-`4096MB`
93
102
-`1TB`
94
103
95
104
### Conversion Table
96
-
| Unit | Bytes Equivalent |
97
-
|------|-----------------------------|
98
-
| 1 KB | 1,024 B |
99
-
| 1 MB| 1,024 KB (1,048,576 B)|
100
-
| 1 GB| 1,024 MB (1,073,741,824 B) |
101
-
| 1 TB| 1,024 GB (1,099,511,627,776 B) |
105
+
106
+
| Unit | Bytes Equivalent |
107
+
|------|----------------------------|
108
+
| 1 KB| 1,024 B |
109
+
| 1 MB| 1,024 KB (1,048,576 B)|
110
+
| 1 GB| 1,024 MB (1,073,741,824 B) |
102
111
103
112
### Required Pipeline Configuration
104
113
105
-
The TEE worker pipeline configurations (`application-gramine.yml` and `application-scone.yml`) **no longer provide default values** for pre-compute and post-compute settings.
114
+
The TEE worker pipeline configurations (`application-scone.yml` and `application-tdx.yml`) **no longer provide default values** for pre-compute and post-compute settings.
106
115
The configuration must be set by SMS operator.
107
116
108
117
#### **Example Configuration (to be provided by SMS operator)**
0 commit comments