次の方法で共有


イメージの署名を検証する

Azure IoT Operations は、Docker イメージと Helm イメージに署名して、ユーザーが使用するイメージの整合性と配信元を確認できるようにします。 署名では、公開キーと秘密キーのペアを使用して、デジタル署名を作成してイメージに追加することで、Microsoft がコンテナー イメージを構築したことを証明します。 この記事では、イメージが Microsoft によって署名されたことを確認する手順について説明します。

  1. Notation をダウンロードします。

    export NOTATION_VERSION=1.1.0
    curl -LO https://github.com/notaryproject/notation/releases/download/v$NOTATION_VERSION/notation_$NOTATION_VERSION\_linux_amd64.tar.gz
    sudo tar xvzf notation_1.1.0_linux_amd64.tar.gz -C /usr/bin/ notation
    
  2. Microsoft 署名パブリック証明書をダウンロードします: https://www.microsoft.com/pkiops/certs/Microsoft%20Supply%20Chain%20RSA%20Root%20CA%202022.crt

    それが msft_signing_cert.crt として保存されていることを確認します。

  3. Notation CLI に証明書を追加します。

    notation cert add --type ca --store supplychain msft_signing_cert.crt
    
  4. Notation の証明書を確認します。

    notation cert ls
    

    コマンドの出力は次の例のようになります。

    STORE TYPE  STORE NAME  CERTIFICATE 
    ca          supplychain msft_signing_cert.crt
    
  5. イメージ スコープを使用して trustpolicy ファイルを作成します。

    {
        "version": "1.0",
        "trustPolicies": [
            {
                "name": "supplychain",
                "registryScopes": [ "*" ],
                "signatureVerification": {
                    "level" : "strict" 
                },
                "trustStores": [ "ca:supplychain" ],
                "trustedIdentities": [
                    "x509.subject: CN=Azure IoT Operations,O=Microsoft Corporation,L=Redmond,ST=Washington,C=US",
                    "x509.subject: CN=Microsoft SCD Products RSA Signing,O=Microsoft Corporation,L=Redmond,ST=Washington,C=US"
                ]
            }
        ]
    }
    
    • すべての registryScopes で、Azure IoT Operations にバンドルされているすべてのイメージの一覧表示を回避し、今後の変更を回避できます。
    • CN=Azure IoT Operations はすべての Azure IoT Operations イメージに対応します。 ただし、他の Microsoft イメージには CN=Microsoft SCD Products RSA Signing が必要です。
  6. Notation を使用して、ダウンロードしたイメージを trustpolicy に照らして検証します。

    バージョン プレースホルダーを、確認するイメージのバージョン番号に置き換えます。 Azure IoT Operations の既存のインスタンスのバージョン番号については、Azure portal のインスタンスの概要ページ、または az iot ops show を実行して確認できます。 使用可能なバージョンの詳細な一覧については、「azure-iot-operations のリリース」を参照してください。

    notation policy import <TRUSTPOLICY_FILE>.json
    export NOTATION_EXPERIMENTAL=1
    notation verify --allow-referrers-api mcr.microsoft.com/azureiotoperations/aio-operator:<AZURE_IOT_OPERATIONS_VERSION>
    

    コマンドの出力は次の例のようになります。

    Successfully verified signature for mcr.microsoft.com/azureiotoperations/aio-operator@sha256:09cbca56a2149d624cdc4ec952abe9a92ee88c347790c6657e3dd2a0fcc12d10