第 5 章 使用您自己的证书颁发机构捆绑包
您可以让机构的证书颁发机构(CA)捆绑包与红帽的受信任的 Artifact Signer (RHTAS)服务签名和验证构建工件。
先决条件
- 安装在 Red Hat OpenShift Container Platform 上运行的 RHTAS operator。
- 正在运行的 Securesign 实例。
- 您的 CA 根证书。
-
安装了
oc二进制文件的工作站。
流程
从命令行登录到 OpenShift:
语法
oc login --token=TOKEN --server=SERVER_URL_AND_PORTExample
$ oc login --token=sha256~ZvFDBvoIYAbVECixS4-WmkN4RfnNd8Neh3y1WuiFPXC --server=https://example.com:6443注意您可以从 OpenShift Web 控制台找到用于命令行的登录令牌和 URL。登录 OpenShift Web 控制台。单击您的用户名,然后单击 Copy login command。如果被要求,再次提供您的用户名和密码,然后单击 Display Token 以查看该命令。
切换到 RHTAS 项目:
Example
$ oc project trusted-artifact-signer使用机构的 CA root 证书捆绑包创建新 ConfigMap:
Example
$ oc create configmap custom-ca-bundle --from-file=ca-bundle.crt重要证书文件名必须是
ca-bundle.crt。打开 Securesign 资源进行编辑:
Example
$ oc edit Securesign securesign-sample在
metadata.annotations部分下添加rhtas.redhat.com/trusted-ca:Example
apiVersion: rhtas.redhat.com/v1alpha1 kind: Securesign metadata: name: example-instance annotations: rhtas.redhat.com/trusted-ca: custom-ca-bundle spec: ...- 保存并退出编辑器。
打开 Fulcio 资源进行编辑:
Example
$ oc edit Fulcio securesign-sample在
metadata.annotations部分下添加rhtas.redhat.com/trusted-ca:Example
apiVersion: rhtas.redhat.com/v1alpha1 kind: Fulcio metadata: name: example-instance annotations: rhtas.redhat.com/trusted-ca: custom-ca-bundle spec: ...- 保存并退出编辑器。
- 在签名和验证工件前,等待 RHTAS 操作器重新配置。