搜索

8.8. 配置 Keylime 租户

download PDF

Keylime 对许多功能使用 keylime_tenant 工具,包括在目标系统上置备代理。您可以在任何系统上安装 keylime_tenant,包括运行其他 Keylime 组件的系统,或者根据要求在单独的系统上安装。

前提条件

流程

  1. 安装 Keylime 租户:

    # dnf install keylime-tenant
  2. 通过编辑 /etc/keylime/tenant.conf.d/00-verifier-ip.conf 文件将租户的连接定义到 Keylime 验证器的连接:

    [tenant]
    verifier_ip = <verifier_ip>
    • <verifier_ip> 替换为验证器系统的 IP 地址。
    • 如果验证器使用与默认值 8881 不同的端口,请添加 verifier_port = <verifier_port> 设置。
  3. 通过编辑 /etc/keylime/tenant.conf.d/00-registrar-ip.conf 文件将租户的连接定义到 Keylime 注册器的连接:

    [tenant]
    registrar_ip = <registrar_ip>
    • <registrar_ip> 替换为注册器系统的 IP 地址。
    • 如果注册器使用与默认值 8891 不同的端口,请添加 registrar_port = <registrar_port> 设置。
  4. 在租户中添加证书和密钥:

    1. 您可以使用默认配置,并将密钥和证书加载到 /var/lib/keylime/cv_ca 目录。
    2. 或者,您可以在配置中定义密钥和证书的位置。在 /etc/keylime/tenant.conf.d/ 目录中创建一个新的 .conf 文件,例如:/etc/keylime/tenant.conf.d/00-keys-and-certs.conf,其内容如下:

      [tenant]
      tls_dir = /var/lib/keylime/cv_ca
      client_key = tenant-key.pem
      client_key_password = <passphrase1>
      client_cert = tenant-cert.pem
      trusted_server_ca = ['</path/to/ca/cert>']

      trusted_server_ca 参数接受到验证器和注册器服务器 CA 证书的路径。您可以提供多个以逗号分隔的路径,例如,验证器和注册器使用不同的 CA。

      注意

      使用绝对路径定义密钥和证书位置。或者,您可以在 tls_dir 选项中定义目录,并使用相对于该目录的路径。

  5. 可选:如果无法使用 /var/lib/keylime/tpm_cert_store 目录中的证书验证可信平台模块(TPM)签署密钥(EK),请将证书添加到该目录。这在使用具有模拟 TPM 的虚拟机时会出现这种情况。

验证

  1. 检查 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.

    如果正确设置了,且没有配置代理,验证器会响应它无法识别的默认代理 UUID。

  2. 检查 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": {}}

    如果正确设置了,且没有配置代理,注册器会响应它无法识别的默认代理 UUID。

其他资源

  • 对于 keylime_tenant 工具程序的额外高级选项,请输入 keylime_tenant -h 命令。
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.