7.13. Trustee の値、ポリシー、およびシークレットの設定


Trustee には次の値、ポリシー、およびシークレットを設定できます。

  • オプション: 参照値プロバイダーサービスの参照値。
  • オプション: アテステーションポリシー
  • Intel Trust Domain Extensions (TDX) 用の証明書キャッシュサービスをプロビジョニングします。
  • オプション: Trustee クライアントのカスタムキーのシークレット。
  • オプション: コンテナーイメージの署名検証用のシークレット。
  • コンテナーイメージの署名検証ポリシー。このポリシーは必須です。コンテナーイメージの署名検証を使用しない場合は、署名を検証しないポリシーを作成する必要があります。
  • リソースアクセスポリシー

7.13.1. 参照値の設定

ハードウェアプラットフォームの信頼できるダイジェストを指定することにより、Reference Value Provider Service (RVPS) の参照値を設定できます。

クライアントは、実行中のソフトウェア、Trusted Execution Environment (TEE) のハードウェアとファームウェアから測定値を収集し、請求とともに見積りを Attestation Server に送信します。これらの測定値は、Trustee に登録された信頼できるダイジェストと一致する必要があります。このプロセスにより、Confidential VM (CVM) が期待どおりのソフトウェアスタックを実行し、改ざんがされていないように確認します。

手順

  1. rvps-configmap.yaml マニフェストファイルを作成します。

    Copy to Clipboard Toggle word wrap
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: rvps-reference-values
      namespace: trustee-operator-system
    data:
      reference-values.json: |
        [ 
    1
    
        ]
    1
    必要に応じて、お使いのハードウェアプラットフォームの信頼できるダイジェストを指定します。それ以外の場合は、空のままにします。
  2. 次のコマンドを実行して、RVPS config map を作成します。

    Copy to Clipboard Toggle word wrap
    $ oc apply -f rvps-configmap.yaml

7.13.2. アテステーションポリシーの作成

デフォルトの設定アテステーションポリシーをオーバーライドする設定アテステーションポリシーを作成できます。

手順

  1. 次の例に従って、attestation-policy.yaml マニフェストファイルを作成します。

    Copy to Clipboard Toggle word wrap
    # attestation-policy.yaml
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: attestation-policy
      namespace: trustee-operator-system
    data:
      default.rego: |
        package policy
    
        import rego.v1
    
        # This policy validates multiple TEE platforms
        # The policy is meant to capture the TCB requirements
        # for confidential containers.
    
        # This policy is used to generate an EAR Appraisal.
        # More information can be found at
        # <https://datatracker.ietf.org/doc/draft-ietf-rats-ar4si/>
    
        default executables := 33
    
        default hardware := 97
    
        default configuration := 36
    
        executables := 3 if {
          input.sample.launch_digest in data.reference.launch_digest
        }
    
        hardware := 2 if {
          input.sample.svn in data.reference.svn
        }
    
        executables := 3 if {
          input.snp.measurement in data.reference.snp_launch_measurement
        }
    
        hardware := 2 if {
          input.snp.reported_tcb_bootloader in data.reference.snp_bootloader
          input.snp.reported_tcb_microcode in data.reference.snp_microcode
          input.snp.reported_tcb_snp in data.reference.snp_snp_svn
          input.snp.reported_tcb_tee in data.reference.snp_tee_svn
        }
    
        configuration := 2 if {
          input.snp.policy_debug_allowed == "0"
          input.snp.policy_migrate_ma == "0"
          input.snp.platform_smt_enabled in data.reference.snp_smt_enabled
          input.snp.platform_tsme_enabled in data.reference.snp_tsme_enabled
          input.snp.policy_abi_major in data.reference.snp_guest_abi_major
          input.snp.policy_abi_minor in data.reference.snp_guest_abi_minor
          input.snp.policy_single_socket in data.reference.snp_single_socket
          input.snp.policy_smt_allowed in data.reference.snp_smt_allowed
        }
    
        else := 3 if {
          input.snp.policy_debug_allowed == "0"
          input.snp.policy_migrate_ma == "0"
        }
    
        executables := 3 if {
          input.tdx.quote.body.rtmr_1 in data.reference.rtmr_1
          input.tdx.quote.body.rtmr_2 in data.reference.rtmr_2
        }
    
        hardware := 2 if {
          # Check that this is a TDX quote signed by the Intel SGX Quoting Enclave.
          input.tdx.quote.header.tee_type == "81000000"
          input.tdx.quote.header.vendor_id == "939a7233f79c4ca9940a0db3957f0607"
    
          # Check TDX Module version and its hash. Also check OVMF code hash.
          input.tdx.quote.body.mr_seam in data.reference.mr_seam
          input.tdx.quote.body.tcb_svn in data.reference.tcb_svn
          input.tdx.quote.body.mr_td in data.reference.mr_td
          # Check TCB status
          # input.tdx.tcb_status == "OK"
    
          # Check collateral expiration status
          # input.tdx.collateral_expiration_status == "0"
    
          # Check against allowed advisory ids
          # allowed_advisory_ids := {"INTEL-SA-00837"}
          # attester_advisory_ids := {id | id := input.attester_advisory_ids[_]}
          # object.subset(allowed_advisory_ids, attester_advisory_ids)
    
          # Check against disallowed advisory ids
          # disallowed_advisory_ids := {"INTEL-SA-00837"}
          # attester_advisory_ids := {id | id := input.tdx.advisory_ids[_]} # convert array to set
          # intersection := attester_advisory_ids & disallowed_advisory_ids
          # count(intersection) == 0
        }
    
        configuration := 2 if {
          input.tdx.td_attributes.debug == false
          input.tdx.quote.body.xfam in data.reference.xfam
        }
    
        executables := 3 if {
          input.azsnpvtpm.measurement in data.reference.measurement
          input.azsnpvtpm.tpm.pcr11 in data.reference.snp_pcr11
        }
    
        hardware := 2 if {
          input.azsnpvtpm.reported_tcb_bootloader in data.reference.tcb_bootloader
          input.azsnpvtpm.reported_tcb_microcode in data.reference.tcb_microcode
          input.azsnpvtpm.reported_tcb_snp in data.reference.tcb_snp
          input.azsnpvtpm.reported_tcb_tee in data.reference.tcb_tee
        }
    
        configuration := 2 if {
          input.azsnpvtpm.platform_smt_enabled in data.reference.smt_enabled
          input.azsnpvtpm.platform_tsme_enabled in data.reference.tsme_enabled
          input.azsnpvtpm.policy_abi_major in data.reference.abi_major
          input.azsnpvtpm.policy_abi_minor in data.reference.abi_minor
          input.azsnpvtpm.policy_single_socket in data.reference.single_socket
          input.azsnpvtpm.policy_smt_allowed in data.reference.smt_allowed
        }
    
        ##### Azure vTPM TDX
        executables := 3 if {
          input.aztdxvtpm.tpm.pcr11 in data.reference.tdx_pcr11
        }
    
        hardware := 2 if {
          # Check that the quote is a TDX quote signed by the Intel SGX Quoting Enclave.
          input.aztdxvtpm.quote.header.tee_type == "81000000"
          input.aztdxvtpm.quote.header.vendor_id == "939a7233f79c4ca9940a0db3957f0607"
    
          # Check TDX Module version and its hash. Also check OVMF code hash.
          input.aztdxvtpm.quote.body.mr_seam in data.reference.mr_seam
          input.aztdxvtpm.quote.body.tcb_svn in data.reference.tcb_svn
          input.aztdxvtpm.quote.body.mr_td in data.reference.mr_td
        }
    
        configuration := 2 if {
          input.aztdxvtpm.quote.body.xfam in data.reference.xfam
        }

    アテステーションポリシーは、Open Policy Agent 仕様に準拠します。この例では、アテステーションポリシーは、アテステーションレポートで提供されたクレームを RVPS データベースに登録されている参照値と比較します。すべての値が一致する場合にのみ、アテステーションプロセスは成功します。

  2. 以下のコマンドを実行して、アテステーションポリシー config map を作成します。

    Copy to Clipboard Toggle word wrap
    $ oc apply -f attestation-policy.yaml

7.13.3. TDX 用の PCCS 設定

Intel Trust Domain Extensions (TDX) を使用する場合は、Provisioning Certificate Caching Service (PCCS) を使用するように Trustee を設定する必要があります。

PCCS はプロビジョニング証明書キー (PCK) 証明書を取得し、ローカルデータベースにキャッシュします。

重要

パブリック Intel PCCS サービスを使用しないでください。オンプレミスまたはパブリッククラウド上のローカルキャッシュサービスを使用します。

手順

  1. 次の例に従って、tdx-config.yaml マニフェストファイルを作成します。

    Copy to Clipboard Toggle word wrap
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: tdx-config
      namespace: trustee-operator-system
    data:
      sgx_default_qcnl.conf: | \
          {
            "collateral_service": "https://api.trustedservices.intel.com/sgx/certification/v4/",
            "pccs_url": "<pccs_url>" 
    1
    
          }
    1
    PCCS URL を指定します (例: https://localhost:8081/sgx/certification/v4/)。
  2. 以下のコマンドを実行して TDX config map を作成します。

    Copy to Clipboard Toggle word wrap
    $ oc apply -f tdx-config.yaml

7.13.4. クライアント用のカスタムキーを使用したシークレットの作成

Trustee クライアント用の 1 つ以上のカスタムキーを含むシークレットを作成できます。

この例では、kbsres1 シークレットには 2 つのエントリー (key1key2) があり、クライアントはそれらを取得します。同じ形式を使用して、要件に応じて追加のシークレットを追加できます。

前提条件

  • 1 つ以上のカスタムキーが作成されている。

手順

  • 次の例に従って、カスタムキーのシークレットを作成します。

    Copy to Clipboard Toggle word wrap
    $ oc apply secret generic kbsres1 \
      --from-literal key1=<custom_key1> \ 
    1
    
      --from-literal key2=<custom_key2> \
      -n trustee-operator-system
    1
    カスタムキーを指定します。

    kbsres1 シークレットは、KbsConfig カスタムリソースの spec.kbsSecretResources キーで指定されます。

7.13.5. コンテナーイメージの署名検証用のシークレット作成

コンテナーイメージの署名検証を使用する場合は、公開コンテナーイメージ署名鍵を含むシークレットを作成する必要があります。

Confidential compute attestation Operator はシークレットを使用して署名を検証し、信頼され、認証されたコンテナーイメージのみが環境にデプロイされるようにします。

Red Hat Trusted Artifact Signer またはその他のツールを使用して、コンテナーイメージに署名できます。

手順

  1. 次のコマンドを実行して、コンテナーイメージの署名検証用のシークレットを作成します。

    Copy to Clipboard Toggle word wrap
    $ oc apply secret generic <type> \ 
    1
    
      --from-file=<tag>=./<public_key_file> \ 
    2
    
      -n trustee-operator-system
    1
    KBS シークレットタイプ (例: img-sig) を指定します。
    2
    シークレットタグ (例: pub-key) とパブリックコンテナーイメージ署名鍵を指定します。
  2. <type> の値を記録します。KbsConfig カスタムリソースを作成するときに、この値を spec.kbsSecretResources キーに追加する必要があります。

7.13.6. コンテナーイメージ署名検証ポリシーの作成

署名検証は常に有効になっているため、コンテナーイメージ署名検証ポリシーを作成します。このポリシーがない場合、Pod は起動しません。

コンテナーイメージの署名検証を使用していない場合は、署名検証なしでポリシーを作成します。

詳細は、containers-policy.json 5 を参照してください。

手順

  1. 次の例に従って、security-policy-config.json ファイルを作成します。

    • 署名検証なし:

      Copy to Clipboard Toggle word wrap
      {
        "default": [
        {
          "type": "insecureAcceptAnything"
        }],
        "transports": {}
      }
    • 署名検証あり:

      Copy to Clipboard Toggle word wrap
      {
        "default": [
            {
            "type": "insecureAcceptAnything"
            }
        ],
        "transports": {
            "<transport>": { 
      1
      
                "<registry>/<image>": 
      2
      
                [
                    {
                        "type": "sigstoreSigned",
                        "keyPath": "kbs:///default/<type>/<tag>" 
      3
      
                    }
                ]
            }
        }
      }
      1
      transport のイメージリポジトリーを指定します (例: "docker")。詳細は、containers-transports 5 を参照してください。
      2
      コンテナーレジストリーとイメージを指定します (例: "quay.io/my-image")。
      3
      作成したコンテナーイメージ署名検証シークレットのタイプとタグを指定します (例: img-sig/pub-key)。
  2. 次のコマンドを実行してセキュリティーポリシーを作成します。

    Copy to Clipboard Toggle word wrap
    $ oc apply secret generic security-policy \
      --from-file=osc=./<security-policy-config.json> \
      -n trustee-operator-system

    シークレットタイプ security-policy または osc のキーを変更しないでください。

    security-policy シークレットは、KbsConfig カスタムリソースの spec.kbsSecretResources キーで指定されます。

7.13.7. リソースアクセスポリシーの作成

Trustee ポリシーエンジンのリソースアクセスポリシーを設定します。このポリシーは、Trustee がアクセスできるリソースを決定します。

注記

Trustee ポリシーエンジンは、TEE 証拠の有効性を決定するアテステーション Service ポリシーエンジンとは異なります。

手順

  1. resourcepolicy-configmap.yaml マニフェストファイルを作成します。

    Copy to Clipboard Toggle word wrap
    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: resource-policy
      namespace: trustee-operator-system
    data:
      policy.rego:
        package policy
        default allow = true
        allow {
          input["tee"] != "sample"
        }
    policy.rego
    リソースポリシーの名前 policy.rego は、Trustee config map で定義されたリソースポリシーと一致する必要があります。
    パッケージポリシー
    リソースポリシーは Open Policy Agent 仕様に準拠します。
  2. 次のコマンドを実行して、リソースポリシーの config map を作成します。

    Copy to Clipboard Toggle word wrap
    $ oc apply -f resourcepolicy-configmap.yaml
トップに戻る
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2025 Red Hat, Inc.