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
Add your user name to the Docker group (open a new shell after this so the change takes effect):
42
+
Add your user name to the Docker group (open a new shell afterwards so the change takes effect):
43
43
```bash
44
44
sudo usermod -aG docker $USER
45
45
newgrp docker
@@ -52,28 +52,28 @@ Clone the **kata** branch of the **cca-trustee** repository:
52
52
git clone -b kata https://github.com/ArmDeveloperEcosystem/cca-trustee.git
53
53
```
54
54
55
-
This repository contains configuration to run Trustee services (KBS, AS, RVPS, keyprovider) with CCA attestation support as a simple cluster. The configuration is based on the recommended settings from[KBS Cluster](https://github.com/confidential-containers/trustee/blob/main/kbs/docs/cluster.md).
55
+
This repository includes a Docker Compose configuration that starts Trustee services (KBS, AS, RVPS, and a key provider) with Arm CCA attestation support as a simple local cluster. The configuration follows the recommended approach described in the Trustee documentation for running a[KBS Cluster](https://github.com/confidential-containers/trustee/blob/main/kbs/docs/cluster.md).
Start the Trustee services Docker containers (as detached services):
76
+
Start the Trustee services as detached containers:
77
77
```bash { output_lines = "2-9" }
78
78
docker compose up -d
79
79
✔ Network cca-trustee Created
@@ -86,28 +86,26 @@ docker compose up -d
86
86
✔ Container cca-trustee-kbs-client-1 Created
87
87
```
88
88
89
-
While running the demo you can also check logs of the Trustee services in this terminal:
89
+
To view logs while running the demo:
90
90
```bash
91
91
docker compose logs <service>
92
92
```
93
-
Where **service** is either **as**, **kbs** or **rvps**.
93
+
Where <service> is one of as, kbs or rvps.
94
94
95
-
## Publish an encrypted docker image
95
+
## Publish an encrypted container image
96
96
97
-
Generate an image encryption key:
97
+
Generate a 32-byte image encryption key:
98
98
```bash
99
99
head -c 32 /dev/urandom | openssl enc >image.key
100
100
```
101
+
Learn more about how the attestation result is used to evaluate the trustworthiness of a CCA realm and how attestation policy gates secrets release in the ["Run an end-to-end Attestation with Arm CCA and Trustee"](/learning-paths/servers-and-cloud-computing/cca-trustee) Learning Path.
101
102
102
-
Publish the encryption key as a KBS secret resource. This resource can be obtained only with an attestation token with **affirming** status.
103
-
104
-
Learn more about how the attestation result is used to evaluate the trustworthiness of a CCA realm and how attestation policy gates secrets release in
105
-
["Run an end-to-end Attestation with Arm CCA and Trustee"](/learning-paths/servers-and-cloud-computing/cca-trustee)
103
+
Publish the encryption key as a KBS secret resource. This resource is only released when the requester presents an attestation token with affirming status.
106
104
```bash
107
105
./publish-key.sh
108
106
```
109
107
110
-
Encrypt a**busybox**docker image with the published key and push it into the local docker registry with**busybox_encrypted** name:
108
+
Encrypt the**busybox** image using the published key, then push it to the local registry as**busybox_encrypted**:
111
109
```bash { output_lines = "2-9" }
112
110
./encrypt_image.sh
113
111
Encrypting docker://busybox image with busybox_encrypted name
@@ -119,12 +117,12 @@ Writing manifest to image destination
119
117
Inspecting MIMEType of docker://registry:5000/busybox_encrypted image
**encrypt_image.sh** uses [skopeo](https://github.com/containers/skopeo) in the Trustee **keyprovider** container to pull, encrypt and push docker images.
138
-
Without parameters it encrypts **busybox** docker image which will be used in this Learning Path.
139
-
You can use this script to encrypt other docker images as well. For example with this command it will encrypt
140
-
**alpine** docker image and push it into the local docker registry with **alpine_encrypted** name.
135
+
**encrypt_image.sh** uses [skopeo](https://github.com/containers/skopeo) inside the Trustee keyprovider container to pull, encrypt, and push images.
136
+
By default it encrypts busybox, which is used throughout this Learning Path. You can also encrypt other images. For example, this command encrypts **alpine** and pushes it as **alpine_encrypted**:
141
137
142
138
```bash
143
139
./encrypt_image.sh alpine
144
140
```
145
141
{{% /notice %}}
146
142
147
-
You have prepared infrastructure and ready to start Confidential Containers in CCA realm.
143
+
At this point, the host-side infrastructure is running and the encrypted image is available from the local registry.
148
144
149
145
## Launch an FVP
150
146
151
-
With the Trustee Services running in one terminal, open up a new terminal in which you will run Confidential Containers.
147
+
With the Trustee services running in one terminal, open a second terminal for the Confidential Containers environment.
152
148
153
-
Pull the Docker image with the pre-built FVP, and then run the container connected to the same Docker network:
149
+
Pull the pre-built FVP container image and run it on the same Docker network:
docker run --rm -it --network cca-trustee armswdev/cca-learning-path:cca-simulation-with-kata-v3
160
156
```
161
157
162
-
Within your running container, launch the **run-cca-fvp.sh** script to run the Arm CCA pre-built binaries on the FVP:
158
+
Inside your running container, launch the `run-cca-fvp.sh` script to run the Arm CCA pre-built binaries on the FVP:
163
159
164
160
```bash
165
161
./run-cca-fvp.sh
166
162
```
167
163
168
-
The **run-cca-fvp.sh** script uses the **screen** command to connect to the different UARTs in the FVP.
164
+
The `run-cca-fvp.sh` script uses the `screen` command to connect to the different UARTs in the FVP.
169
165
170
-
When the host Linux boots, уnter root as the username:
166
+
When the host Linux boots, enter root as the username:
171
167
```output
172
168
173
169
Welcome to the CCA host
174
170
host login: root
175
171
(host) #
176
172
```
177
173
178
-
## Inject the local docker registry self-signed certificate
174
+
## Inject the local Docker registry certificate
179
175
180
-
The local docker registry service was deployed with a self-signed certificate.
181
-
To trust this certificate it needs to be added into the CA certificates list in the guest VM image.
176
+
The local registry is configured with a self-signed TLS certificate. To allow the guest VM to trust the registry, add this certificate to the guest image’s CA certificate store.
182
177
183
-
Inject the local docker repository certificate into the image:
178
+
Inject the registry certificate into the guest filesystem image:
184
179
```bash { output_lines = "2-6" }
185
180
inject_registry_cert.sh
186
181
@@ -192,12 +187,11 @@ inject_registry_cert.sh
192
187
193
188
## Calculate Realm Initial Measurement (RIM)
194
189
195
-
For a successful attestation of your CCA realm you need to provide the Trustee Reference Values Provider Service (RVPS) with a knowngood reference value.
190
+
To validate the guest during attestation, the Trustee Reference Values Provider Service (RVPS) must be configured with a known-good reference value for the Realm.
196
191
197
-
In a production environment, the known good reference value is generated using a deployment-specific process.
198
-
This Learning Path includes **rim_calc.sh** script which:
199
-
- Runs qemu-system-aarch64-cca-experimental (used by Kata containers to run a guest VM in Arm CCA realm) to dump Device Tree into a file.
200
-
- Checks Kata shim configuration file for guest VM delpoyment parameters.
192
+
In production, reference values are generated as part of a deployment-specific build and release process. This Learning Path includes a helper script, `rim_calc.sh`, which:
193
+
- Runs qemu-system-aarch64-cca-experimental (used by Kata containers to launch a guest VM inside an Arm CCA realm) to dump the guest Device Tree into a file.
194
+
- Reads the Kata shim configuration to capture guest deployment parameters
201
195
- Uses ["cca-realm-measurements"](https://github.com/veraison/cca-realm-measurements) to calculate the realm initial measurement (RIM).
202
196
203
197
Run the script:
@@ -216,24 +210,23 @@ Realm Extensible Measurements (REMs) are not used for attestation in this Learni
216
210
217
211
## Endorse Realm Initial Measurement (RIM)
218
212
219
-
In the terminal where you started Trustee services, run **endorse-rim.sh** script with the RIM as a parameter:
213
+
In the terminal where you started Trustee services, run `endorse-rim.sh` and pass the RIM value:
@@ -271,13 +264,12 @@ These messages can be ignored. The docker image will be downloaded by **image-rs
271
264
{{% /notice %}}
272
265
273
266
{{% notice Failed attestation note %}}
274
-
If you forget to endorse RIM for your environment or make a mistake doing that, then CCA realm attestation would fail.
275
-
In this case you will see an image decryption error when starting a confidential container with an encrypted image.
267
+
If the RIM is not endorsed (or the wrong value is configured), attestation will fail and the guest will be unable to retrieve the decryption key. In this case, container startup fails with an image decryption error:
276
268
```
277
269
FATA[0189] failed to create shim task: rpc status: Status { code: INTERNAL, message: "[CDH] [ERROR]: Image Pull error: Failed to pull image registry:5000/busybox_encrypted from all mirror/mapping locations or original location: image: registry:5000/busybox_encrypted:latest, error: Errors happened when pulling image: Failed to decrypt layer: Failed to decrypt the image layer, please ensure that the decryption key is placed and correct", details: [], special_fields: SpecialFields { unknown_fields: UnknownFields { fields: None }, cached_size: CachedSize { size: 0 } } }
278
270
```
279
271
280
-
By checking KBS logs (in the terminal where you run Trustee services) you could see that the encryption key couldn't be obtained because of an AS policy:
272
+
Checking the KBS logs (in the terminal running Trustee services) shows the request was denied by policy:
You have successfully run a confidential container with Arm CCA using an encrypted image.
282
+
You have now successfully launched a Confidential Container in an Arm CCA Realm using an encrypted container image.
291
283
292
284
{{% notice Unencrypted docker images note %}}
293
-
In this Learning Path environment you can also run confidential containers in Arm CCA realm from any unencrypted docker images.
294
-
Please notice that you need to define the **annotation** parameter so **image-rs** knows where to pull the image from.
295
-
For example:
285
+
In this Learning Path environment, you can also run Confidential Containers from unencrypted images. You still need to set the `io.kubernetes.cri.image-name` annotation so **image-rs** knows where to pull the image from. For example:
296
286
```
297
287
nerdctl run --runtime io.containerd.kata.v2 --rm -it --annotation io.kubernetes.cri.image-name=alpine:latest alpine sh
0 commit comments