5.11. 验证 attestation
您可以通过创建一个测试 pod 来从红帽构建的 Trustee 检索特定资源,以验证 attestation 过程。
重要
此流程是验证 attestation 是否正常工作的示例。不要将敏感数据写入标准 I/O,因为可使用内存转储捕获数据。只有写入内存的数据才会被加密。
流程
创建
test-pod.yaml清单文件:apiVersion: v1 kind: Pod metadata: name: ocp-cc-pod labels: app: ocp-cc-pod annotations: io.katacontainers.config.hypervisor.cc_init_data: <initdata_string>1 spec: runtimeClassName: kata-cc containers: - name: skr-openshift image: registry.access.redhat.com/ubi9/ubi:latest command: - sleep - "36000" securityContext: privileged: false seccompProfile: type: RuntimeDefault metadata: name: coco-test-pod labels: app: coco-test-pod annotations: io.katacontainers.config.hypervisor.cc_init_data: <initdata_string>2 spec: runtimeClassName: kata-cc containers: - name: test-container image: registry.access.redhat.com/ubi9/ubi:9.3 command: - sleep - "36000" securityContext: privileged: false seccompProfile: type: RuntimeDefault运行以下命令来创建 pod:
$ oc create -f test-pod.yaml运行以下命令登录到 pod:
$ oc exec -it ocp-cc-pod -- bash运行以下命令,获取红帽构建的 Trustee 资源:
$ curl http://127.0.0.1:8006/cdh/resource/default/attestation-status/status输出示例
success #/