映像簽署與驗證

本頁說明如何使用 Cosign 來驗證 Istio 映像構件的來源。

Cosign 是作為 sigstore 專案一部分開發的工具,可簡化簽署和驗證簽署的開放容器倡議 (OCI) 構件 (例如容器映像)。

從 Istio 1.12 開始,我們在發布流程中簽署所有官方發布的容器映像。然後,終端使用者可以使用以下描述的流程來驗證這些映像。

此流程適用於手動執行或與建置或部署管道整合,以自動驗證構件。

先決條件

開始之前,請執行下列動作

  1. 為您的架構下載最新的 Cosign 建置及其簽章。

  2. 驗證 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
    
  3. 將二進制檔設為可執行 (chmod +x) 並移動到 PATH 上的位置

驗證映像

若要驗證容器映像,請執行下列動作

$ ./cosign-binary verify --key "https://istio.dev.org.tw/misc/istio-key.pub" gcr.io/istio-release/pilot:1.24.0

此流程適用於使用 Istio 建置基礎架構建置的任何已發布映像或候選發布版本。

帶有輸出的範例

$ cosign verify --key "https://istio.dev.org.tw/misc/istio-key.pub" gcr.io/istio-release/pilot:1.12.0


Verification for gcr.io/istio-release/pilot:1.12.0 --
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":"gcr.io/istio-release/pilot"},"image":{"docker-manifest-digest":"sha256:c37fd83f6435ca0966d653dc6ac42c9fe5ac11d0d5d719dfe97de84acbf7a32d"},"type":"cosign container image signature"},"optional":null}]
此資訊是否有幫助?
您是否有任何改進建議?

感謝您的回饋!