2.12. 验证 attestation
您可以通过创建带有 relaxed Kata 代理策略并检索其密钥的测试 pod 来验证 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.runtime.cc_init_data: <initdata_string>1 spec: runtimeClassName: kata-remote containers: - name: skr-openshift image: registry.access.redhat.com/ubi9/ubi:9.3 command: - sleep - "36000" securityContext: privileged: false seccompProfile: type: RuntimeDefault- 1
- 可选:在 pod 注解中设置 initdata 会覆盖对等 pod 配置映射中的全局
INITDATA设置。
运行以下命令来创建 pod:
$ oc create -f test-pod.yaml运行以下命令登录到 pod:
$ oc exec -it ocp-cc-pod -- bash运行以下命令来获取 pod secret:
$ curl http://127.0.0.1:8006/cdh/resource/default/kbsres1/key1输出示例
res1val1/ #