镜像签名和验证
本页介绍如何使用 Cosign 验证 Istio 镜像制品的来源。
Cosign 是作为 sigstore 项目的一部分开发的工具。 它简化了已签名的开放容器倡议(OCI)制品(例如容器镜像)的签名和验证。
从 Istio 1.12 开始,我们签署所有正式发布的容器镜像作为我们发布过程的一部分。 然后,最终用户可以使用下面描述的过程来验证这些镜像。
此过程适用于手动执行或与构建/部署管道集成,以自动验证镜像制品。
先决条件
在开始之前,请执行以下操作:
为您的架构下载最新的 Cosign 构建及其签名。
验证
cosign二进制签名:$ openssl dgst -sha256 \ -verify <(curl -ssL https://raw.githubusercontent.com/sigstore/cosign/main/release/release-cosign.pub) \ -signature <(cat /path/to/cosign.sig | base64 -d) \ /path/to/cosign-binary使二进制文件可执行(
chmod +x),并移动到PATH上的一个位置。
验证镜像
版本 1.31.1+ 使用 https://istio.io/misc/istio-key-v2.pub 公钥进行签名。
对于旧版本,请使用 https://istio.io/misc/istio-key.pub。
要验证容器镜像,请执行以下操作:
$ ./cosign-binary verify --key <public key url> docker.io/istio/pilot:1.31.0-rc.1此过程适用于使用 Istio 构建基础设施构建的任何已发布镜像或待发布镜像。
输出示例:
$ cosign verify --key "https://istio.io/misc/istio-key-v2.pub" docker.io/istio/pilot:1.31.1
Verification for docker.io/istio/pilot:1.31.1 --
The following checks were performed on each of these signatures:
- The cosign claims were validated
- The signatures were verified against the specified public key
- Any certificates were verified against the Fulcio roots.
[{"critical":{"identity":{"docker-reference":"docker.io/istio/pilot"},"image":{"docker-manifest-digest":"sha256:c37fd83f6435ca0966d653dc6ac42c9fe5ac11d0d5d719dfe97de84acbf7a32d"},"type":"cosign container image signature"},"optional":null}]