Skip to content

Commit effbb04

Browse files
matdibudcmiddle
authored andcommitted
docs: fix markdown code blocks
Some markdown code blocks were rendering incorrectly: - code blocks without an explicit language were sometimes interpreted as math formulas - rego blocks were not labelled or were labelled as opa - yaml's had invalid whitespace and syntax - bash snippets that echo to a file were marked as being that file's format - mix-ups between shell scripts (```bash) and console sessions (```console) Signed-off-by: Matei Dibu <contact@mateidibu.dev>
1 parent 5da00d0 commit effbb04

29 files changed

+219
-217
lines changed

content/en/blog/2024/building-trust-into-os-images-for-coco.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This option is appealing for certain CoCo deployments. If we have a Trusted Exec
2525

2626
An expected SEV-SNP launch measurement for Linux direct boot with Qemu can be calculated using trusted artifacts (firmware, kernel & initrd) and a few platform parameters. Please note that the respective kernel/fw components and tools are still being actively developed. The [AMDESE/AMDSEV](https://github.com/AMDESE/AMDSEV/tree/snp-latest) repository provides instructions and pointers to a working set of revisions.
2727

28-
```bash
28+
```console
2929
$ sev-snp-measure \
3030
--mode snp \
3131
--vcpus=1 \
@@ -49,7 +49,7 @@ A rootfs can comfortably host the infrastructure components and we can still pac
4949

5050
DM-Verity volumes feature a hash tree and a root hash in addition to the actual data. The hash tree can be stored on disk next to the verity volume or as a local file. We'll store the hash-tree as file for brevity and write a string `CoCo` into a file `/coco` on the formatted volume:
5151

52-
```bash
52+
```console
5353
$ dd if=/dev/zero of=rootfs.raw bs=1M count=100
5454
$ DEVICE="$(sudo losetup --show -f rootfs.raw)"
5555
$ sudo cfdisk "$DEVICE"
@@ -77,7 +77,7 @@ $ export ROOT_HASH=ad86ff8492be2ee204cb54d70c84412c2dc89cefd34e263184f4e00295a41
7777

7878
Now we toggle a bit on the raw image (`CoCo` => `DoCo` in `/coco`). If the image is attached as a block device via dm-verity, there will be IO errors and respective entries in the kernel log, once we attempt to read the file.
7979

80-
```bash
80+
```console
8181
$ hexdump -C rootfs.raw | grep CoCo
8282
06000000 43 6f 43 6f 0a 00 00 00 00 00 00 00 00 00 00 00 |CoCo............|
8383
$ printf '\x44' | dd of=rootfs.raw bs=1 seek="$((16#06000000))" count=1 conv=notrunc
@@ -113,7 +113,7 @@ To retrieve the expected measurements, for a dm-verity protected OS image, we ca
113113
In a TEE the vTPM would have to be isolated from both the Host and the Guest OS. We use `swtpm` to retrieve reference values here.
114114
{{% /alert %}}
115115

116-
```bash
116+
```console
117117
$ swtpm socket \
118118
--tpmstate dir=/tmp/vtpm \
119119
--ctrl type=unixio,path=/tmp/vtpm/swtpm.sock \
@@ -123,8 +123,8 @@ $ swtpm socket \
123123

124124
We retrieve VM firmware from debian's repository and attach the vTPM socket as character device:
125125

126-
```bash
127-
# retrieve vm firmware from debian's repo
126+
```console
127+
$ # retrieve vm firmware from debian's repo
128128
$ wget http://security.debian.org/debian-security/pool/updates/main/e/edk2/ovmf_2022.11-6+deb12u1_all.deb
129129
$ mkdir fw
130130
$ dpkg-deb -x ovmf_2022.11-6+deb12u1_all.deb fw/
@@ -146,7 +146,7 @@ $ qemu-system-x86_64 \
146146

147147
Once logged into the VM we can retrieve the relevant measurements in the form of PCRs (the package `tpm2_tools` needs to be available):
148148

149-
```bash
149+
```console
150150
$ tpm2_pcrread sha256:0,1,2,3,4,5,6,7,8,9,10,11
151151
sha256:
152152
0 : 0x61E3B90D0862D052BF6C802E0FD2A44A671A37FE2EB67368D89CB56E5D23014E
@@ -165,7 +165,7 @@ $ tpm2_pcrread sha256:0,1,2,3,4,5,6,7,8,9,10,11
165165

166166
If we boot the same image on a Confidential VM in Azure's cloud, we'll see different measurements. This is expected since the early boot stack does not match our reference setup:
167167

168-
```bash
168+
```console
169169
$ tpm2_pcrread sha256:0,1,2,3,4,5,6,7,8,9,10,11
170170
sha256:
171171
0 : 0x782B20B10F55CC46E2142CC2145D548698073E5BEB82752C8D7F9279F0D8A273
@@ -184,7 +184,7 @@ $ tpm2_pcrread sha256:0,1,2,3,4,5,6,7,8,9,10,11
184184

185185
We can identify the common PCRs between the measurements in a cloud VM and those that we gathered in our reference setup. Those are good candidates to include them as [reference values](https://confidentialcontainers.org/docs/attestation/reference-values/) in a relying party against which a TEE's evidence can be verified.
186186

187-
```bash
187+
```console
188188
$ grep -F -x -f pcr_reference.txt pcr_cloud.txt
189189
3 : 0x3D458CFE55CC03EA1F443F1562BEEC8DF51C75E14A9FCF9A7234A13F198E7969
190190
8 : 0x0000000000000000000000000000000000000000000000000000000000000000

content/en/blog/2024/coco-without-confidential-hardware.md

Lines changed: 52 additions & 52 deletions
Large diffs are not rendered by default.

content/en/blog/2024/policing-a-sandbox.md

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For the implementers of such a solution, this choice comes with a few challenges
2323

2424
This would be the sequence of RPC calls that are issued to a Kata agent in the Guest VM (for brevity we'll refer to it as _Agent_ in the text below), if we launch a simple Nginx Pod. There are 2 containers being launched, because a Pod includes the implicit `pause` container:
2525

26-
```
26+
```text
2727
create_sandbox
2828
get_guest_details
2929
copy_file
@@ -62,7 +62,6 @@ In order to preserve the integrity of a Confidential Pod, we need to observe clo
6262
Kata-Containers currently features an implementation of a policy engine using the popular [Rego](https://www.openpolicyagent.org/docs/latest/policy-language) language. Convenience tooling can assist and automate aspects of authoring a policy for a workload. The following would be an example policy (hand-crafted for brevity, real policy bodies would be larger) in which we allow the launch of specific OCI images, the execution of certain commands, Kata management endpoints, but disallow pretty much everything else during runtime:
6363

6464
```rego
65-
"""
6665
package agent_policy
6766
6867
import future.keywords.in
@@ -85,13 +84,13 @@ default ExecProcessRequest := false
8584
8685
CreateContainerRequest if {
8786
every storage in input.storages {
88-
some allowed_image in policy_data.allowed_images
89-
storage.source == allowed_image
90-
}
87+
some allowed_image in policy_data.allowed_images
88+
storage.source == allowed_image
89+
}
9190
}
9291
9392
ExecProcessRequest if {
94-
input_command = concat(" ", input.process.Args)
93+
input_command = concat(" ", input.process.Args)
9594
some allowed_command in policy_data.allowed_commands
9695
input_command == allowed_command
9796
}
@@ -180,8 +179,8 @@ Host-Data is a field in a TEE’s evidence that is passed into a confidential Gu
180179

181180
Example: Producing a SHA256 digest of the Init-Data file
182181

183-
```bash
184-
openssl dgst -sha256 --binary init-data.toml | xxd -p -c32
182+
```console
183+
$ openssl dgst -sha256 --binary init-data.toml | xxd -p -c32
185184
bdc9a7390bb371258fb7fb8be5a8de5ced6a07dd077d1ce04ec26e06eaf68f60
186185
```
187186

@@ -191,10 +190,10 @@ Instead of seeding the Init-Data hash into a Host-Data field at launch, we can a
191190

192191
Example: Extending an empty SHA256 runtime measurement register with the digest of an Init-Data file
193192

194-
```bash
195-
dd if=/dev/zero of=zeroes bs=32 count=1
196-
openssl dgst -sha256 --binary init-data.toml > init-data.digest
197-
openssl dgst -sha256 --binary <(cat zeroes init-data.digest) | xxd -p -c32
193+
```console
194+
$ dd if=/dev/zero of=zeroes bs=32 count=1
195+
$ openssl dgst -sha256 --binary init-data.toml > init-data.digest
196+
$ openssl dgst -sha256 --binary <(cat zeroes init-data.digest) | xxd -p -c32
198197
7aaf19294adabd752bf095e1f076baed85d4b088fa990cb575ad0f3e0569f292
199198
```
200199

@@ -231,46 +230,46 @@ cat nginx-cc.yaml | jq \
231230

232231
If the Pod came up successfully, it passed the initial policy check for the image already.
233232

234-
```bash
235-
kubectl get pod
233+
```console
234+
$ kubectl get pod
236235
NAME READY STATUS RESTARTS AGE
237236
nginx-cc-694cc48b65-lklj7 1/1 Running 0 83s
238237
```
239238

240239
According to the policy only certain commands are allowed to be executed in the container. Executing `whoami` should be fine, while `ls` should be rejected:
241240

242-
```bash
243-
kubectl exec -it deploy/nginx-cc -- whoami
241+
```console
242+
$ kubectl exec -it deploy/nginx-cc -- whoami
244243
root
245244
```
246245

247-
```bash
248-
kubectl exec -it deploy/nginx-cc -- ls
246+
```console
247+
$ kubectl exec -it deploy/nginx-cc -- ls
249248
error: Internal error occurred: error executing command in container: failed to
250249
exec in container: failed to start exec "e2d8bad68b64d6918e6bda08a43f457196b5f30d6616baa94a0be0f443238980": cannot enter container 914c589fe74d1fcac834d0dcfa3b6a45562996661278b4a8de5511366d6a4609, with err rpc error: code = PermissionDenied desc = "ExecProcessRequest is blocked by policy: ": unknown
251250
```
252251

253-
In our example we tie the Init-Data measurement to the TEE evidence using a Runtime Measurement into PCR8 of a vTPM. Assuming a 0-initalized SHA256 register, we can calculate the expected value by extend the zeroes with the SHA256 digest of the Init-Data file:
252+
In our example we tie the Init-Data measurement to the TEE evidence using a Runtime Measurement into PCR8 of a vTPM. Assuming a 0-initialized SHA256 register, we can calculate the expected value by extend the zeroes with the SHA256 digest of the Init-Data file:
254253

255-
```bash
256-
dd if=/dev/zero of=zeroes bs=32 count=1
257-
openssl dgst -sha256 --binary init-data.toml > init-data.digest
258-
openssl dgst -sha256 --binary <(cat zeroes init-data.digest) | xxd -p -c32
254+
```console
255+
$ dd if=/dev/zero of=zeroes bs=32 count=1
256+
$ openssl dgst -sha256 --binary init-data.toml > init-data.digest
257+
$ openssl dgst -sha256 --binary <(cat zeroes init-data.digest) | xxd -p -c32
259258
765156eda5fe806552610f2b6e828509a8b898ad014c76ad8600261eb7c5e63f
260259
```
261260

262261
As part of the policy we also allow-listed a specific command that can request a KBS token using an endpoint that is exposed to a container by a [specific Guest Component](https://github.com/confidential-containers/guest-components/tree/41ad96d4b2e5e9dc205c6d41f7b550629cea677f/api-server-rest). Note: This is not something a user would want to typically enable, since this token is used to retrieve confidential secrets and we would not want it to leak outside the Guest. We are using it here to illustrate that we _could_ retrieve a secret in the container, since we passed remote attestation including the verification of the Init-Data digest.
263262

264263

265-
```bash
266-
kubectl exec deploy/nginx-cc -- curl -s http://127.0.0.1:8006/aa/token\?token_type=kbs | jq -c 'keys'
264+
```console
265+
$ kubectl exec deploy/nginx-cc -- curl -s http://127.0.0.1:8006/aa/token\?token_type=kbs | jq -c 'keys'
267266
["tee_keypair","token"]
268267
```
269268

270269
Since this has been successful we can inspect the logs of the Attestation Service (bundled into a KBS here) to confirm it has been considered in the appraisal. The first text block shows the claims from the (successfully verified) TEE evidence, the second block is displaying the acceptable reference values for a PCR8 measurement:
271270

272-
```bash
273-
kubectl logs deploy/kbs -n coco-tenant | grep -C 2 765156eda5fe806552610f2b6e828509a8b898ad014c76ad8600261eb7c5e63f
271+
```console
272+
$ kubectl logs deploy/kbs -n coco-tenant | grep -C 2 765156eda5fe806552610f2b6e828509a8b898ad014c76ad8600261eb7c5e63f
274273
...
275274
"aztdxvtpm.tpm.pcr06": String("65f0a56c41416fa82d573df151746dc1d6af7bd8d4a503b2ab07664305d01e59"),
276275
"aztdxvtpm.tpm.pcr07": String("124daf47b4d67179a77dc3c1bcca198ae1ee1d094a2a879974842e44ab98bb06"),
@@ -282,7 +281,7 @@ kubectl logs deploy/kbs -n coco-tenant | grep -C 2 765156eda5fe806552610f2b6e828
282281
"7aaf19294adabd752bf095e1f076baed85d4b088fa990cb575ad0f3e0569f292",
283282
"765156eda5fe806552610f2b6e828509a8b898ad014c76ad8600261eb7c5e63f",
284283
],
285-
"aztdxvtpm.tpm.pcr10": [],
284+
"aztdxvtpm.tpm.pcr10": [],
286285
```
287286

288287
### Size Limitations

content/en/blog/2025/coco-and-slsa.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Following is the current state of provenance generation of the CoCo projects:
9090

9191
Formerly exclusively a place to host layers for container images, OCI registries today can serve a multitude of use cases, such as Helm Charts or Attestation data. A registry is a content-addressable store, which means that it is named after a digest of its content.
9292

93-
```sh
93+
```console
9494
$ DIGEST="84ec2a70279219a45d327ec1f2f112d019bc9dcdd0e19f1ba7689b646c2de0c2"
9595
$ oras manifest fetch "quay.io/curl/curl@sha256:${DIGEST}" | sha256sum
9696
84ec2a70279219a45d327ec1f2f112d019bc9dcdd0e19f1ba7689b646c2de0c2 -
@@ -99,23 +99,23 @@ $ oras manifest fetch "quay.io/curl/curl@sha256:${DIGEST}" | sha256sum
9999
We also use OCI registries to distribute and cache artifacts in the CoCo project.
100100
There is a convention of specifying upstream dependencies in a `versions.yaml` file this:
101101

102-
```sh
102+
```yaml
103103
oci:
104-
...
104+
# ...
105105
kata-containers:
106-
registry: ghcr.io/kata-containers/cached-artefacts
107-
reference: 3.13.0
106+
registry: ghcr.io/kata-containers/cached-artefacts
107+
reference: 3.13.0
108108
guest-components:
109-
registry: ghcr.io/confidential-containers/guest-components
110-
reference: 3df6c412059f29127715c3fdbac9fa41f56cfce4
109+
registry: ghcr.io/confidential-containers/guest-components
110+
reference: 3df6c412059f29127715c3fdbac9fa41f56cfce4
111111
```
112112
113113
Note that the `reference` in this case is a tag, sometimes a version, and sometimes a reference to the digest of a given git commit, not the digest of the OCI artefact. What do we express from this specification, and what do we want to verify?
114114
We might want to resolve a tag to a git digest first, so tag 3.13.0 resolves to the digest `2777b13db748f9ba785c7d2be4fcb6ac9c9af265`. Knowing the git digest, we now want to verify that official repository runners built the artefact from the main branch using the source code and build workflows from that above digest.
115115
This is what the SLSA attestation that we created during the artefact's build can substantiate.
116116
It wouldn't make sense to attest against an artifact using an OCI tag alias (those are not immutable, and one can move it to point to something else); the attestations are tied to an OCI artifact referenced by its digest and conveniently stored alongside this in the same repo. We can find it manually if we search for referrers of our OCI artifact.
117117

118-
```sh
118+
```console
119119
$ GIT_DGST="2777b13db748f9ba785c7d2be4fcb6ac9c9af265"
120120
$ oras resolve "ghcr.io/kata-containers/cached-artefacts/agent:${GIT_DGST}-x86_64"
121121
sha256:c127db93af2fcefddebbe98013e359a7c30b9130317a96aab50093af0dbe8464
@@ -132,7 +132,7 @@ As mentioned previously, Github provides a command line option to verify the [pr
132132

133133
The following snippet from the cloud-api-adaptor project's [Makefile](https://github.com/confidential-containers/cloud-api-adaptor/blob/main/src/cloud-api-adaptor/podvm/Makefile.inc) shows an example usage:
134134

135-
```sh
135+
```bash
136136
define pull_agent_artifact
137137
$(eval $(call generate_tag,tag,$(KATA_REF),$(ARCH)))
138138
$(eval OCI_IMAGE := $(KATA_REGISTRY)/agent)

content/en/blog/2026/trustee-deployment.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ kubectl get csv -n operators
8383

8484
We should expect something like:
8585

86-
```bash
86+
```text
8787
NAME DISPLAY VERSION REPLACES PHASE
8888
trustee-operator.v0.17.0 Trustee Operator 0.17.0 trustee-operator.v0.5.0 Succeeded
8989
```
@@ -178,7 +178,7 @@ EOF
178178
<summary>Permissive Mode</summary>
179179
TrusteeConfig CR creation:
180180

181-
```bash
181+
```yaml
182182
apiVersion: confidentialcontainers.org/v1alpha1
183183
kind: TrusteeConfig
184184
metadata:
@@ -308,18 +308,18 @@ kubectl config set-context --current --namespace=operators
308308

309309
### Check if the PODs are running
310310

311-
```bash
312-
kubectl get pods -n operators
311+
```console
312+
$ kubectl get pods -n operators
313313
NAME READY STATUS RESTARTS AGE
314314
trustee-deployment-7bdc6858d7-bdncx 1/1 Running 0 69s
315315
trustee-operator-controller-manager-6c584fc969-8dz2d 1/1 Running 0 4h7m
316316
```
317317

318318
Also, the log should report something like:
319319

320-
```bash
321-
POD_NAME=$(kubectl get pods -l app=kbs -o jsonpath='{.items[0].metadata.name}' -n operators)
322-
kubectl logs -n operators $POD_NAME
320+
```console
321+
$ export POD_NAME=$(kubectl get pods -l app=kbs -o jsonpath='{.items[0].metadata.name}' -n operators)
322+
$ kubectl logs -n operators $POD_NAME
323323
[2026-02-10T15:21:47Z INFO kbs] Using config file /etc/kbs-config/kbs-config.toml
324324
[2026-02-10T15:21:47Z INFO tracing::span] Initialize RVPS;
325325
[2026-02-10T15:21:47Z INFO attestation_service::rvps] launch a built-in RVPS.
@@ -362,16 +362,16 @@ Finally we are able to test the entire attestation protocol, when fetching one o
362362
Note: Make sure the resource-policy is permissive for testing purposes.
363363
For example:
364364

365-
```
366-
package policy
367-
default allow = true
365+
```rego
366+
package policy
367+
default allow = true
368368
```
369369

370370

371-
```bash
372-
kubectl get secret trustee-tls-cert -n operators -o json | jq -r '.data."tls.crt"' | base64 --decode > https.crt
373-
kubectl cp -n operators https.crt kbs-client:/
374-
kubectl exec -it -n operators kbs-client -- kbs-client --cert-file https.crt --url https://kbs-service:8080 get-resource --path default/kbsres1/key1
371+
```console
372+
$ kubectl get secret trustee-tls-cert -n operators -o json | jq -r '.data."tls.crt"' | base64 --decode > https.crt
373+
$ kubectl cp -n operators https.crt kbs-client:/
374+
$ kubectl exec -it -n operators kbs-client -- kbs-client --cert-file https.crt --url https://kbs-service:8080 get-resource --path default/kbsres1/key1
375375
cmVzMXZhbDE=
376376
```
377377

@@ -385,4 +385,4 @@ We’ll get *res1val1*, the secret we created before.
385385

386386
## Summary
387387

388-
In this blog we have shown how to use the Trustee operator for deploying Trustee and run the attestation workflow with a sample attester.
388+
In this blog we have shown how to use the Trustee operator for deploying Trustee and run the attestation workflow with a sample attester.

content/en/docs/attestation/client-tool/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ git clone https://github.com/confidential-containers/trustee.git
4646
```
4747

4848
Build the client
49-
```
49+
```bash
5050
cd kbs
5151
make CLI_FEATURES=sample_only cli
5252
sudo make install-cli

content/en/docs/attestation/coco-setup/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ If you are using Trustee with Confidential Containers, you'll need to point
1414
your CoCo workload to your Trustee.
1515

1616
In your pod definition, add the following annotation.
17-
```bash
17+
```yaml
1818
io.katacontainers.config.hypervisor.kernel_params: "agent.aa_kbc_params=cc_kbc::http://<kbs-ip>:<kbs-port>"
1919
```
2020

content/en/docs/attestation/installation/kubernetes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ kubectl get pods -n operators --watch
2626
```
2727

2828
The operator controller should be running.
29-
```bash
29+
```text
3030
NAME READY STATUS RESTARTS AGE
3131
trustee-operator-controller-manager-77cb448dc-7vxck 1/1 Running 0 11m
3232
```
@@ -57,7 +57,7 @@ kubectl get pods -n operators --selector=app=kbs
5757
```
5858

5959
The Trustee deployment should be running.
60-
```bash
60+
```text
6161
NAME READY STATUS RESTARTS AGE
6262
trustee-deployment-f97fb74d6-w5qsm 1/1 Running 0 25m
6363
```

0 commit comments

Comments
 (0)