Red Hat Training

A Red Hat training course is available for RHEL 8

76.3. 为 Web 服务器和客户端身份验证创建 CA ACL

证书颁发机构访问控制列表(CA ACL)规则定义哪些配置文件可用于向哪些用户、服务或主机发布证书。通过关联配置文件、主体和组,CA ACL 允许主体或组使用特定配置集请求证书。

例如,利用 CA ACL,管理员可以将适用于从伦敦办事处工作的员工的配置文件的使用限制为属于伦敦办事处相关组的成员的用户。

76.3.1. 在 IdM CLI 中查看 CA ACL

按照以下流程查看 IdM 部署中提供的证书颁发机构访问控制列表(CA ACL)以及特定 CA ACL 的详情。

流程

  1. 要查看 IdM 环境中的所有 CA ACL,请输入 ipa caacl-find 命令:

    $ ipa caacl-find
    -----------------
    1 CA ACL matched
    -----------------
      ACL name: hosts_services_caIPAserviceCert
      Enabled: TRUE
  2. 要查看 CA ACL 的详细信息,请输入 ipa caacl-show 命令并指定 CA ACL 名称。例如,要查看 hosts_services_caIPAserviceCert CA ACL 的详情,请输入:

    $ ipa caacl-show hosts_services_caIPAserviceCert
      ACL name: hosts_services_caIPAserviceCert
      Enabled: TRUE
      Host category: all
      Service category: all
      CAs: ipa
      Profiles: caIPAserviceCert
      Users: admin

76.3.2. 为使用 webserver-ca 发布的证书向 Web 客户端进行身份验证的 Web 服务器创建 CA ACL

按照以下流程,在为 HTTP/my_company.idm.example.com@IDM.EXAMPLE.COM 服务请求证书时,创建一个需要系统管理员使用 webserver-ca 子 CA 和 caIPAserviceCert 配置文件的 CA ACL。如果用户从其他子 CA 或不同配置集请求证书,则请求会失败。唯一的例外是在启用了另一个匹配的 CA ACL 时。要查看可用的 CA ACL,请参阅在 IdM CLI 中查看 CA ACL

先决条件

  • 确保 HTTP/my_company.idm.example.com@IDM.EXAMPLE.COM 服务是 IdM 的一部分。
  • 确保您已获取 IdM 管理员的凭据。

流程

  1. 使用 ipa caacl 命令创建 CA ACL,并指定其名称:

    $ ipa caacl-add TLS_web_server_authentication
    --------------------------------------------
    Added CA ACL "TLS_web_server_authentication"
    --------------------------------------------
      ACL name: TLS_web_server_authentication
      Enabled: TRUE
  2. 使用 ipa caacl-mod 命令修改 CA ACL 以指定 CA ACL 的说明:

    $ ipa caacl-mod TLS_web_server_authentication --desc="CAACL for web servers authenticating to web clients using certificates issued by webserver-ca"
    -----------------------------------------------
    Modified CA ACL "TLS_web_server_authentication"
    -----------------------------------------------
      ACL name: TLS_web_server_authentication
      Description: CAACL for web servers authenticating to web clients using certificates issued by webserver-ca
      Enabled: TRUE
  3. webserver-ca 子 CA 添加到 CA ACL 中:

    $ ipa caacl-add-ca TLS_web_server_authentication --ca=webserver-ca
      ACL name: TLS_web_server_authentication
      Description: CAACL for web servers authenticating to web clients using certificates issued by webserver-ca
      Enabled: TRUE
      CAs: webserver-ca
    -------------------------
    Number of members added 1
    -------------------------
  4. 使用 ipa caacl-add-service 指定主体可以请求证书的服务:

    $ ipa caacl-add-service TLS_web_server_authentication --service=HTTP/my_company.idm.example.com@IDM.EXAMPLE.COM
      ACL name: TLS_web_server_authentication
      Description: CAACL for web servers authenticating to web clients using certificates issued by webserver-ca
      Enabled: TRUE
      CAs: webserver-ca
      Services: HTTP/my_company.idm.example.com@IDM.EXAMPLE.COM
    -------------------------
    Number of members added 1
    -------------------------
  5. 使用 ipa caacl-add-profile 命令为请求的证书指定证书配置集:

    $ ipa caacl-add-profile TLS_web_server_authentication --certprofiles=caIPAserviceCert
      ACL name: TLS_web_server_authentication
      Description: CAACL for web servers authenticating to web clients using certificates issued by webserver-ca
      Enabled: TRUE
      CAs: webserver-ca
      Profiles: caIPAserviceCert
      Services: HTTP/my_company.idm.example.com@IDM.EXAMPLE.COM
    -------------------------
    Number of members added 1
    -------------------------

    您可以直接使用新创建的 CA ACL。它在创建后默认启用。

注意

CA ACL 的重点是指定允许哪些 CA 和配置文件组合用于来自特定主体或组的请求。CA ACL 不会影响证书验证或信任。它们不会影响签发的证书的使用方式。

76.3.3. 为用户 Web 浏览器创建 CA ACL,使用 webclient-ca 发布的证书向 Web 服务器进行身份验证

按照以下流程,在请求证书时,创建一个需要系统管理员使用 webclient-ca 子 CA 和 IECUserRoles 配置文件的 CA ACL。如果用户从其他子 CA 或不同配置集请求证书,则请求会失败。唯一的例外是在启用了另一个匹配的 CA ACL 时。要查看可用的 CA ACL,请参阅在 IdM CLI 中查看 CA ACL

先决条件

  • 确保您已获取 IdM 管理员的凭据。

流程

  1. 使用 ipa caacl 命令创建 CA ACL 并指定其名称:

    $ ipa caacl-add TLS_web_client_authentication
    --------------------------------------------
    Added CA ACL "TLS_web_client_authentication"
    --------------------------------------------
      ACL name: TLS_web_client_authentication
      Enabled: TRUE
  2. 使用 ipa caacl-mod 命令修改 CA ACL 以指定 CA ACL 的说明:

    $ ipa caacl-mod TLS_web_client_authentication --desc="CAACL for user web browsers authenticating to web servers using certificates issued by webclient-ca"
    -----------------------------------------------
    Modified CA ACL "TLS_web_client_authentication"
    -----------------------------------------------
      ACL name: TLS_web_client_authentication
      Description: CAACL for user web browsers authenticating to web servers using certificates issued by webclient-ca
      Enabled: TRUE
  3. webclient-ca 子 CA 添加到 CA ACL 中:

    $ ipa caacl-add-ca TLS_web_client_authentication --ca=webclient-ca
      ACL name: TLS_web_client_authentication
      Description: CAACL for user web browsers authenticating to web servers using certificates issued by webclient-ca
      Enabled: TRUE
      CAs: webclient-ca
    -------------------------
    Number of members added 1
    -------------------------
  4. 使用 ipa caacl-add-profile 命令为请求的证书指定证书配置集:

    $ ipa caacl-add-profile TLS_web_client_authentication --certprofiles=IECUserRoles
      ACL name: TLS_web_client_authentication
      Description: CAACL for user web browsers authenticating to web servers using certificates issued by webclient-ca
      Enabled: TRUE
      CAs: webclient-ca
      Profiles: IECUserRoles
    -------------------------
    Number of members added 1
    -------------------------
  5. 使用 ipa caacl-mod 命令修改 CA ACL,以指定 CA ACL 适用于所有 IdM 用户:

    $ ipa caacl-mod TLS_web_client_authentication --usercat=all
    -----------------------------------------------
    Modified CA ACL "TLS_web_client_authentication"
    -----------------------------------------------
      ACL name: TLS_web_client_authentication
      Description: CAACL for user web browsers authenticating to web servers using certificates issued by webclient-ca
      Enabled: TRUE
      User category: all
      CAs: webclient-ca
      Profiles: IECUserRoles

    您可以直接使用新创建的 CA ACL。它在创建后默认启用。

注意

CA ACL 的重点是指定允许哪些 CA 和配置文件组合用于来自特定主体或组的请求。CA ACL 不会影响证书验证或信任。它们不会影响签发的证书的使用方式。