8.2. Keylim verifier と registrar の設定

verifier と registrar は、エージェントの監視に必要な 2 つのコンポーネントです。要件に応じて、単一のシステムまたは 2 つの別個のシステムにインストールできます。verifier と registrar を別々のシステムで実行すると、パフォーマンスが向上します。

重要

信頼の連鎖を維持するには、verifier と registrar を実行するシステムを安全に管理してください。

  • verifier は、Keylime で最も重要なコンポーネントです。システム整合性の初期および定期的なチェックを行い、エージェントを使用して暗号化キーを安全にブートストラップすることをサポートします。verifier は、その制御インターフェイスに相互 Transport Layer Security (TLS) を使用します。
  • registrar は、TPM (trusted platform module) の公開キーを受け入れる HTTPS サービスです。次に、引用符をチェックするためにこれらの公開鍵を取得するためのインターフェイスを提示します。
注記

設定ファイルをドロップインディレクトリー内に整理するには、/etc/keylime/verifier.conf.d/00-registrar-ip.conf のように、2 桁の数字の接頭辞を付けたファイル名を使用します。設定処理は、ドロップインディレクトリー内のファイルを辞書順で読み取り、各オプションを最後に読み取った値に設定します。

前提条件

  • Keylim コンポーネントをインストールするシステムに対する管理者権限
  • システム間のネットワーク接続
  • Keylime が registrar と verifier からのデータを保存する 2 つのデータベースへのアクセス

    次のデータベースのいずれかを使用できます。

    • SQLite (デフォルト)
    • PostgreSQL
    • MySQL / MariaDB
  • 認証局からの有効な鍵と証明書。

手順

  1. 必要な Keylim コンポーネントをインストールします。verifier と registrar は、要件に応じて、1 つのシステムまたは 2 つの別個のシステムにインストールできます。

    • Keylime のすべてのコンポーネントをインストールするには、以下を実行します。

      # dnf install keylime
    • Keylime 検証ツールのみをインストールするには、以下を実行します。

      # dnf install keylime-verifier
    • Keylime レジストラのみをインストールするには、以下を実行します。

      # dnf install keylime-registrar
  2. verifier と registrar を別々のシステムにインストールする場合は、verifier 設定で registrar の IP アドレスとポートを定義します。verifier がインストールされているシステムで、/etc/keylime/verifier.conf.d/ ディレクトリーに新しい .conf ファイルを作成します (例: /etc/keylime/verifier.conf.d/00-registrar-ip.conf の内容は次のとおりです)。

    [verifier]
    
    registrar_ip = <registrar_IP_address>
    • <registrar_IP_address> を registrar の IP アドレスに置き換えます。
    • オプションで、registrar_port = <registrar_port> オプションを使用して、registrar のポートをデフォルト値の 8891 から変更することもできます。
  3. オプション:エージェントのリスト用に verifier のデータベースを設定します。デフォルトの設定では、verifier の /var/lib/keylime/cv_data.sqlite ディレクトリーにある SQLite データベースを使用します。/etc/keylime/verifier.conf.d/ ディレクトリーに新しい .conf ファイルを作成することで、別のデータベースを定義できます (例: /etc/keylime/verifier.conf.d/00-db-ip.conf の内容は次のとおりです)。

    [verifier]
    # Database URL Configuration
    database_url = <database_url>

    <database_url> をデータベースの URL に置き換えます。

  4. verifier に証明書とキーを追加します。verifier には、次のキーと証明書が必要です。

    • server_key
    • server_cert
    • client_key
    • client_cert
    • trusted_client_ca

      • テナントクライアント CA 証明書へのパス
    • trusted_server_ca

      • registrar サーバー CA 証明書へのパス
    1. デフォルトの設定を使用して、キーと証明書を /var/lib/keylime/cv_ca ディレクトリーにロードできます。
    2. または、設定でキーと証明書の場所を定義することもできます。/etc/keylime/verifier.conf.d/ ディレクトリーに新しい .conf ファイルを作成します。たとえば、/etc/keylime/verifier.conf.d/00-keys-and-certs.conf のように、次の内容で作成します。

      [verifier]
      tls_dir = default
      server_key = </path/to/server_key>
      server_key_password = <passphrase1>
      server_cert = </path/to/server_cert>
      trusted_client_ca = ['</path/to/ca/cert1>', '</path/to/ca/cert2>']
      client_key = </path/to/client_key>
      client_key_password = <passphrase2>
      client_cert = </path/to/client_cert>
      trusted_server_ca = ['</path/to/ca/cert3>', '</path/to/ca/cert4>']
      注記

      絶対パスを使用して、キーと証明書の場所を定義します。または、tls_dir オプションでディレクトリーを定義し、そのディレクトリーからの相対パスを使用することもできます。

  5. オプション:エージェントのリスト用に registrar のデータベースを設定します。デフォルト設定では、registrar の /var/lib/keylime/reg_data.sqlite ディレクトリーにある SQLite データベースを使用します。/etc/keylime/registrar.conf.d/ ディレクトリーに新しい .conf ファイルを作成できます (例: /etc/keylime/registrar.conf.d/00-db-ip.conf の内容は次のとおりです)。

    [registrar]
    # Database URL Configuration
    database_url = <database_url>

    <database_url> をデータベースの URL に置き換えます。

  6. registrar に証明書とキーを追加します。registrar には、次のキーと証明書が必要です。

    • server_key
    • server_cert
    • trusted_client_ca

      • verifier クライアント CA 証明書へのパス
      • テナントクライアント CA 証明書へのパス
    1. デフォルトの設定を使用して、キーと証明書を /var/lib/keylime/reg_ca ディレクトリーにロードできます。
    2. または、設定でキーと証明書の場所を定義することもできます。/etc/keylime/registrar.conf.d/ ディレクトリーに新しい .conf ファイルを作成します (例: /etc/keylime/registrar.conf.d/00-keys-and-certs.conf の内容は次のとおりです)。

      [registrar]
      tls_dir = default
      server_key = </path/to/server_key>
      server_key_password = <passphrase1>
      server_cert = </path/to/server_cert>
      trusted_client_ca = ['</path/to/ca/cert1>', '</path/to/ca/cert2>']
      注記

      絶対パスを使用して、キーと証明書の場所を定義します。または、tls_dir オプションでディレクトリーを定義し、そのディレクトリーからの相対パスを使用することもできます。

  7. verifier サービスを開始します。

    注記

    設定ファイルを正しい順序でロードできるように、registrar を開始する前に verifier を開始します。Keylime を停止する必要がある場合は、逆の順序でサービスを停止します。

    $ systemctl start keylime_verifier
  8. registrar サービスを開始します。

    $ systemctl start keylime_registrar

検証

  1. Keylime サービスのステータスを確認します。

    $ systemctl status keylime_verifier
    ● keylime_verifier.service - The Keylime verifier
         Loaded: loaded (/usr/lib/systemd/system/keylime_verifier.service; disabled; vendor preset: disabled)
         Active: active (running) since Wed 2022-11-09 10:10:08 EST; 1min 45s ago
    ...
    $ systemctl status keylime_registrar
    ● keylime_registrar.service - The Keylime registrar service
         Loaded: loaded (/usr/lib/systemd/system/keylime_registrar.service; disabled; vendor preset: disabled)
         Active: active (running) since Wed 2022-11-09 10:10:17 EST; 1min 42s ago
    ...
  2. verifier のステータスを確認します。

    $ keylime_tenant -c cvstatus
    Reading configuration from ['/etc/keylime/logging.conf']
    2022-10-14 12:56:08.155 - keylime.tpm - INFO - TPM2-TOOLS Version: 5.2
    Reading configuration from ['/etc/keylime/tenant.conf']
    2022-10-14 12:56:08.157 - keylime.tenant - INFO - Setting up client TLS...
    2022-10-14 12:56:08.158 - keylime.tenant - INFO - Using default client_cert option for tenant
    2022-10-14 12:56:08.158 - keylime.tenant - INFO - Using default client_key option for tenant
    2022-10-14 12:56:08.178 - keylime.tenant - INFO - TLS is enabled.
    2022-10-14 12:56:08.178 - keylime.tenant - WARNING - Using default UUID d432fbb3-d2f1-4a97-9ef7-75bd81c00000
    2022-10-14 12:56:08.221 - keylime.tenant - INFO - Verifier at 127.0.0.1 with Port 8881 does not have agent d432fbb3-d2f1-4a97-9ef7-75bd81c00000.

    正しくセットアップされていて、エージェントが設定されていない場合、verifier はエージェント UUID を認識しません。

  3. registrar のステータスを確認します。

    $ keylime_tenant -c regstatus
    Reading configuration from ['/etc/keylime/logging.conf']
    2022-10-14 12:56:02.114 - keylime.tpm - INFO - TPM2-TOOLS Version: 5.2
    Reading configuration from ['/etc/keylime/tenant.conf']
    2022-10-14 12:56:02.116 - keylime.tenant - INFO - Setting up client TLS...
    2022-10-14 12:56:02.116 - keylime.tenant - INFO - Using default client_cert option for tenant
    2022-10-14 12:56:02.116 - keylime.tenant - INFO - Using default client_key option for tenant
    2022-10-14 12:56:02.137 - keylime.tenant - INFO - TLS is enabled.
    2022-10-14 12:56:02.137 - keylime.tenant - WARNING - Using default UUID d432fbb3-d2f1-4a97-9ef7-75bd81c00000
    2022-10-14 12:56:02.171 - keylime.registrar_client - CRITICAL - Error: could not get agent d432fbb3-d2f1-4a97-9ef7-75bd81c00000 data from Registrar Server: 404
    2022-10-14 12:56:02.172 - keylime.registrar_client - CRITICAL - Response code 404: agent d432fbb3-d2f1-4a97-9ef7-75bd81c00000 not found
    2022-10-14 12:56:02.172 - keylime.tenant - INFO - Agent d432fbb3-d2f1-4a97-9ef7-75bd81c00000 does not exist on the registrar. Please register the agent with the registrar.
    2022-10-14 12:56:02.172 - keylime.tenant - INFO - {"code": 404, "status": "Agent d432fbb3-d2f1-4a97-9ef7-75bd81c00000 does not exist on registrar 127.0.0.1 port 8891.", "results": {}}

    正しくセットアップされていて、エージェントが設定されていない場合、registrar はエージェント UUID を認識しません。

次のステップ

Keylime verifier と registrar を設定して実行したら、監視対象システムに Keylime エージェントをデプロイして、次の機能のいずれかまたは両方を実行できます。