7.12. 创建 PKI 角色用户


这部分论述了子系统安装后发生的用户配置。

重要

上一章中的一些示例假定已经创建了一些非OS-root pki 角色用户(如 PKI 代理 jsmith)示例,并准备使用其 pki 角色特权来执行自己的职责。因此,建议用户用于处理证书请求等操作。

但是,PKI bootstrap admin 证书被授予了所有 PKI 角色的特权,可用于评估/测试目的。在这种情况下,可以简单地使用 bootstrap 用户的证书数据库目录为单角色用户证书以 root 用户身份生成 CSR (并在发布时导入证书)。

对于真实操作,强烈建议您按照当前章节中的说明进行操作,在完成安装后创建具有受限特权的角色,以便完成安装后。创建并测试实际角色用户以正常工作后,您可以删除/禁用 bootstrap 证书,如 第 7.12.6 节 “从身份验证数据库中删除 bootstrap admin 用户(可选)” 所述。

设置过程仅创建一些用于演示目的的角色用户帐户(特别是,为 SubCA 角色用户设置)。为了在实际生命周期中管理 PKI 环境,通常在设置实例后创建更多管理员、代理和审核员。

根据测试相关 RHCS 子系统(包括 CA、OCSP 和 KRA)创建 Admin、broker 和 Audit 用户。如果 TMS 值得关注,请为 TKS 和 TPS 创建 Admin 和 Audit 用户,并为 TPS 创建 Operator 用户。

注意

以下流程只演示了如何设置 PKI 角色用户(用户 jgeniejsmith,以及在 第 7.1.1 节 “创建操作系统用户和组” 中为从属 CA 创建)的 aguru。在这些示例中,证书请求(CSR)使用 SubCA 的 bootstrap admin 证书获得批准。

7.12.1. 先决条件

在执行推荐的步骤发布任何证书前,请确保您的 SubCA bootstrap admin certificate/key 已准备好执行任务。

  1. 以 root 用户身份登录 rhcs10.example.com
  2. 检查 nssdb 中的 admin/agent 证书是否存在(本例中为 SubCA 的 bootstrap admin 证书)(这在 第 7.8.1 节 “发出非引导代理用户证书” 中设置):

    # certutil -d /root/.dogtag/pki_rsa_bootstrap/certs_db -L
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    PKI Bootstrap Administrator for RSA-SubCA       u,u,u
    CA Signing Cert - rhcs10-RSA-RootCA             CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA              CT,C,C
    PKI Bootstrap Administrator for RSA-RootCA      u,u,u
    Copy to Clipboard Toggle word wrap

7.12.2. 管理员用户

  • adminV (此用户在整个 测试过程中会有一个 valid 证书)
  • adminR (此用户将具有 revoked 证书)
  • adminE (此用户将具有 expired 证书)
  • adminTCA (此用户的证书将由 tRusted CA签名)
  • adminC (初始为此用户将分配给管理员组;在测试过程中,此用户将分配给其他组)
  • adminUTCA (此用户的证书将由 untRusted CA发布)

    注意

    最后一个 CA 需要第二个 CA 设置!

7.12.2.1. 为 pki 管理员设置证书和私钥

以下示例将为 OS 用户 jgenie 创建 CMC 签名证书 rsa_SubCA_AdminV。此 CMC 请求将在下一节中使用 SubCA bootstrap 管理员证书进行签名。

7.12.2.1.1. 为 pki 管理员生成 CSR

此过程由 would-be pki 管理员(如 Jane Genie、jgenie)执行,旨在为此管理员用户创建 CSR。

  1. 以"Administrator" (非 root 用户)登录到 rhcs10.example.com,本例中为 jgenie
  2. 如果客户端 nssdb 不存在,请创建它:

    $ pki -d /home/jgenie/certs_db -c SECret.123 client-init
    Copy to Clipboard Toggle word wrap
  3. 使用 PKCS10Client 工具生成 PKCS #10 证书请求:

    注意

    根据每个子系统更改 subjectDN 和 .req 文件名,例如: OCSP_AdminV、KRA_AdminV 等。

    $ PKCS10Client -d /home/jgenie/certs_db -p SECret.123 -n "cn=rsa_SubCA_AdminV, uid=rsa_SubCA_AdminV" -o /home/jgenie/certs_db/rsa_SubCA_AdminV.req
    
    PKCS10Client: Certificate request written into /home/jgenie/certs_db/rsa_SubCA_AdminV.req
    PKCS10Client: PKCS#10 request key id written into /home/jgenie/certs_db/rsa_SubCA_AdminV.req.keyId
    Copy to Clipboard Toggle word wrap

    jgenie 用户应该向包含 SubCA 的 bootstrap 管理证书证书的用户(如 root 用户) /home/jgenie/certs_db/rsa_SubCA_AdminV.req 发送证书请求(CSR)/home/jgenie/certs_db/rsa_SubCA_AdminV.req。

7.12.2.1.2. 批准 pki 管理员用户的 CSR

本节描述了由保存 SubCA 的 bootstrap admin 证书的用户执行的步骤,如 root 用户。它演示了如何处理由 jgenie)处理在上一节中创建的 CSR (例如,jgenie )发出 pki admin 证书。

先决条件

  • 以 root 用户身份登录 RHCS 机器。
  • nssdb 中存在 admin/agent 证书(本例中为 SubCA bootstrap 证书)。

通过 CMC 发布证书

保存 bootstrap admin 证书/密钥的用户现在可以处理从 jgenie 发送的 CSR,如下所示:

  1. 将从 jgenie 收到的 CSR 文件(rsa_SubCA_AdminV.req)放置到 /root/.dogtag/pki_rsa_bootstrap/certs_db 目录。
  2. 生成 CMC 请求:

    1. 创建 CMCRequest 配置文件。例如:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AdminV.cfg
      Copy to Clipboard Toggle word wrap
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV.req
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.req
      
      ### tokenname: name of the token where the user signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the user cert that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for the cert8.db that stores the user signing cert and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=false
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      request.privKeyId= _<private key id>_
      Copy to Clipboard Toggle word wrap
      注意

      对于 request.privKeyId= < private key id> : 要使用的私钥 ID 是上一步中生成的私钥 ID。查看输出信息:

      PKCS10Client: PKCS#10 request key id written into /home/jgenie/certs_db/rsa_SubCA_AdminV.req.keyId
      Copy to Clipboard Toggle word wrap

      执行此操作的快速方法是: key_id=cat /home/jgenie/certs_db/rsa_SubCA_AdminV.req.keyId;sed -i 's/request.privKeyId= < private key id> /request.privKeyId='$key_id'/g' /root/.dogtag/pki_rsa_bootstrap/certs_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_Admin_cfg.

    2. 使用 CMCRequest 命令生成请求:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AdminV.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/cmc.rsa_SubCA_AdminV_pkcs10.req
      Copy to Clipboard Toggle word wrap
  3. 提交 CMC 请求:

    1. 创建 HttpClient 配置文件。例如:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AdminV_signed.cfg
      Copy to Clipboard Toggle word wrap
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
      Copy to Clipboard Toggle word wrap
    2. 使用 HttpClient 命令提交请求:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AdminV_signed.cfg
      
      Total number of bytes read = 3455
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 2592
      MIIKHAYJKoZIhvcNAQcCoIIKDTCCCgkCAQMxDzANBglghkgBZQMEAgMFADAxBggr
      
      . . . Output omitted . . .
      
      The response in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.resp
      Copy to Clipboard Toggle word wrap
  4. 使用 CMCResponse 处理响应,以 PEM 格式单独以链的形式显示所有证书:

    # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AdminV_pkcs10.resp -o /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_pkcs7.crt
    
    Cert:0
    ...
    ===
    Cert:1
    ...
    ===
    Cert:2
    ...
    ===
    Certificates:
        Certificate:
           Data:
               Version:  v3
               Serial Number: 0xF64CE29
               Signature Algorithm: SHA512withRSA - 1.2.840.113549.1.1.13
               Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
               Validity:
                   Not Before: Friday, January 5, 2018 8:09:48 PM EST America/New_York
                   Not  After: Wednesday, July 4, 2018 8:09:48 PM EDT America/New_York
               Subject: CN=rsa_SubCA_AdminV,UID=rsa_SubCA_AdminV
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
    Copy to Clipboard Toggle word wrap
  5. 将代理证书复制到 /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_b64.crt

    # pki -p 31443 ca-cert-export <rsa_SubCA_AdminV_serial_number> --output-file /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_b64.crt
    Copy to Clipboard Toggle word wrap
7.12.2.1.3. 创建 pki admin 用户并关联新证书

此流程由现有的 pki admin 用户执行,本例中为保存 SubCA bootstrap 证书的 root 用户。

要创建 pki 管理员用户,并将新证书与此用户关联:

  1. 创建一个用户,在本例中为 rsa_SubCA_AdminV

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-add --fullName="rsa_SubCA_AdminV" rsa_SubCA_AdminV
    ---------------------
    Added user "rsa_SubCA_AdminV"
    ---------------------
     User ID: rsa_SubCA_AdminV
     Full name: rsa_SubCA_AdminV
    Copy to Clipboard Toggle word wrap

    同样:

    • 对于 KRA,使用 kra-user-add 命令和 KRA 的 admin nick、主机名和端口来创建新用户,如 KRA_AdminV
    • 对于 OCSP,使用带有 OCSP 的 admin nick、主机名和端口的 ocsp-user-add 命令创建新用户,如 OCSP_AdminV

    如果 TMS 值得关注:

    • 对于 TKS,使用 tks-user-add 命令和 TKS 的 admin nick、主机名和端口来创建新用户,如 TKS_AdminV
    • 对于 TPS,使用 tps-user-add 命令和 TPS 的 admin nick、主机名和端口来创建新用户,如 TPS_AdminV
  2. 将新用户添加到 Administrators 组中:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-add Administrators rsa_SubCA_AdminV
    -----------------------------
    Added group member "rsa_SubCA_AdminV"
    -----------------------------
     User: rsa_SubCA_AdminV
    Copy to Clipboard Toggle word wrap

    同样:

    • 要将新创建的用户(如 KRA_AdminV)添加到 KRA 的管理员组中,请使用 kra-group-member-add 命令以及 KRA 的 admin nick、主机名和端口。
    • 要将新创建的用户(如 OCSP_AdminV)添加到 OCSP 的管理员组中,请使用带有 OCSP 的 admin nick、hostname 和 port 的 ocsp-group-member-add 命令。

    如果 TMS 值得关注:

    • 要将新创建的用户(如 TKS_AdminV)添加到 TKS 的管理员组中,请使用 tks-group-member-add 命令以及 TK 的 admin nick、主机名和端口。
    • 要将新创建的用户(如 TPS_AdminV)添加到 TPS 的管理员组中,请使用带有 TPS 的 admin nick、hostname 和 port 的 tps-group-member-add 命令。
  3. 验证用户是否已添加到 Administrators 组中:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-find Administrators
    -----------------
    2 entries matched
    -----------------
     User: caadmin
    
     User: rsa_SubCA_AdminV
    ----------------------------
    Number of entries returned 2
    ----------------------------
    Copy to Clipboard Toggle word wrap

    同样:

    • 要验证 KRA 管理员组中的成员资格,请使用带有 KRA 主机名和端口的 kra-group-member-find 命令。
    • 要验证 OCSP 管理员组中的成员资格,请使用带有 OCSP 主机名和端口的 ocsp-group-member-find 命令。

    如果 TMS 值得关注:

    • 要验证 TKS 管理员组中的成员资格,请使用 tks-group-member-find 命令以及 TKS 的主机名和端口。
    • 要验证 TPS 管理员组中的成员资格,请使用带有 TPS 主机名和端口的 tps-group-member-find 命令。
  4. rsa_SubCA_AdminV 证书添加到 pki 角色用户:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-add rsa_SubCA_AdminV --input /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_b64.crt
    
    -------------------------------------------------------------------------------------------------------------------------------------
    Added certificate "2;258264617;CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA;CN=rsa_SubCA_AdminV,UID=rsa_SubCA_AdminV"
    Copy to Clipboard Toggle word wrap

    同样:

    • 要将证书添加到 KRA 和 OCSP 中的用户,请分别使用 kra-user-cert-addocsp-user-cert-add 命令以及相应的子系统的主机名和端口。

    如果 TMS 值得关注:

    • 要将证书添加到 TKS 和 TPS 中的用户,请分别使用 tks-user-cert-addtps-user-cert-add 命令以及相应的子系统的主机名和端口。
  5. 将证书文件 /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AdminV_pkcs7.crt 发送到用户(如 jgenie)。然后,可以将文件复制到用户位置 /home/jgenie/certs_db/rsa_SubCA_AdminV_pkcs7.crt 以在以后的步骤中导入。
7.12.2.1.4. 将 pki admin 证书导入到客户端 nssdb

这个过程由之前收到新发布的证书文件(例如 /home/ jgenie/certs_db/rsa_SubCA_AdminV_pkcs7.crt)中的新 pki admin 用户(例如,root 用户)执行。

  1. 以 pki 管理员身份登录 rhcs10.example.com,其证书是在上一节中发布的,例如 jgenie
  2. 安装证书,如 rsa_SubCA_AdminV

    $ pki -d /home/jgenie/certs_db -c SECret.123 pkcs7-import "rsa_SubCA_AdminV" --pkcs7 /home/jgenie/certs_db/rsa_SubCA_AdminV_pkcs7.crt
    Copy to Clipboard Toggle word wrap
    $ certutil -d /home/jgenie/certs_db -L
    
    Certificate Nickname                Trust Attributes
                                        SSL,S/MIME,JAR/XPI
    
    . . . Output omitted . . .
    
    rsa_SubCA_AdminV                    u,u,u
    Copy to Clipboard Toggle word wrap
  3. 通过创建一个 .p12 文件来备份角色用户 rsa_SubCA_AdminV 证书,例如,使用密码 SECret.123

    $ pki -d /home/jgenie/certs_db -c SECret.123 client-cert-show "rsa_SubCA_AdminV" --pkcs12 /home/jgenie/certs_db/rsa_SubCA_AdminV.p12 --pkcs12-password SECret.123
    Copy to Clipboard Toggle word wrap
    注意

    您可以稍后将 .p12 文件用于 admin 测试,例如:通过将文件导入到 ~/.redhat-idm-console 用于控制台客户端身份验证。

验证:

  • 测试 admin 操作:

    $ pki -v -d /home/jgenie/certs_db -c SECret.123 -n "rsa_SubCA_AdminV" -p 31443 ca-user-find
    Copy to Clipboard Toggle word wrap

7.12.3. 代理用户

  • agentV (此用户在整个 测试过程中会有一个 valid 证书)
  • agentR (此用户将具有 revoked 证书)
  • agentE (此用户将有 expired 证书)
  • agentTCA (此用户的证书将由 tRusted CA签名)
  • agentUTCA (此用户的证书将由 untrusted CA发布)

    注意

    最后一个 CA 需要第二个 CA 设置!

7.12.3.1. 为 pki 代理设置证书和密钥角色

以下示例将为用户代理 jsmith 创建 CMC 签名的证书 rsa_SubCA_AgentV。此 CMC 请求将在下一节中使用 SubCA bootstrap 管理员证书进行签名。

7.12.3.1.1. 为 pki 代理生成 CSR

本节由 pki 代理(如 jsmith)执行,旨在为此用户创建 CSR。

  • 以 'Agent' 身份登录 rhcs10.example.com (一个非 root 用户,如 John Smith、jsmith)。

    1. 如果客户端 nssdb 不存在,请创建一个:

      $ pki -d /home/jsmith/certs_db -c SECret.123 client-init
      Copy to Clipboard Toggle word wrap
    2. 使用 PKCS10Client 工具生成 PKCS#10 证书请求:

      注意

      根据每个子系统更改 subjectDN 和 .req 文件名,例如: OCSP_AgentV、KRA_AgentV 等。

      $ PKCS10Client -d /home/jsmith/certs_db -p SECret.123 -n "cn=rsa_SubCA_AgentV, uid=rsa_SubCA_AgentV" -o /home/jsmith/certs_db/rsa_SubCA_AgentV.req
      
      PKCS10Client: Certificate request written into /home/jsmith/certs_db/rsa_SubCA_AgentV.req
      PKCS10Client: PKCS#10 request key id written into /home/jsmith/certs_db/rsa_SubCA_AgentV.req.keyId
      Copy to Clipboard Toggle word wrap

      jsmith 用户应该向包含 SubCA 的 bootstrap 管理证书证书的用户(如 root 用户) /home/jsmith/certs_db/rsa_SubCA_AgentV.req 发送证书请求(CSR)/home/jsmith/certs_db/rsa_SubCA_AgentV.req。

7.12.3.1.2. 批准 pki 代理用户的 CSR

本节描述了由保存 SubCA 的 bootstrap admin 证书的用户执行的步骤,如 root 用户。它演示了如何处理 CSR (上一节中的 jsmith 创建)来发布 pki 代理证书。

先决条件

  • 以 root 用户身份登录 RHCS 机器。
  • nssdb 中存在 admin/agent 证书(本例中为 SubCA bootstrap 证书)。

通过 CMC 发布证书

保存 bootstrap admin 证书/密钥的用户现在可以处理从 jsmith 发送的 CSR,如下所示:

  1. 将从 jsmith 接收的 CSR 文件(rsa_SubCA_AgentV.req)放置到 /root/.dogtag/pki_rsa_bootstrap/certs_db 目录。
  2. 生成 CMC 请求:

    1. 创建 CMCRequest 配置文件。例如:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AgentV.cfg
      Copy to Clipboard Toggle word wrap
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV.req
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.req
      
      ### tokenname: name of the token where the user signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the user cert that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for the cert8.db that stores the user signing cert and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=false
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      request.privKeyId= _<private key id>_
      Copy to Clipboard Toggle word wrap
    2. 使用 CMCRequest 命令生成请求:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AgentV.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/cmc.rsa_SubCA_AgentV_pkcs10.req
      Copy to Clipboard Toggle word wrap
  3. 提交 CMC 请求:

    1. 创建 HttpClient 配置文件。例如:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AgentV_signed.cfg
      Copy to Clipboard Toggle word wrap
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
      Copy to Clipboard Toggle word wrap
    2. 使用 HttpClient 命令提交请求:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AgentV_signed.cfg
      
      Total number of bytes read = 3455
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 2592
      
      . . . Output omitted . . .
      
      The response in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.resp
      Copy to Clipboard Toggle word wrap
  4. 使用 CMCResponse 处理响应:

    重要

    使用 "-v" 选项运行 CMCResponse 将链中每个证书的 PEM 返回为 Cert:0, Cert:1 等。在所有 PEM 下,输出也会以用户打印格式显示链中的每个证书。由于证书没有以固定顺序显示,因此为了确定其在链中的位置,您必须检查每个 "Certificate" 下的"Subject: "。对应的 PEM 显示在上面的同一位置。

    # CMCResponse -v -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AgentV_pkcs10.resp -o /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_pkcs7.crt
    
    Cert:0
    ...
    ===
    Cert:1
    ...
    ===
    Cert:2
    ...
    ===
    Certificates:
        Certificate:
           Data:
               Version:  v3
               Serial Number: 0xE1E0F54
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
    Copy to Clipboard Toggle word wrap
  5. 将代理证书复制到 /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_b64.crt

    # pki -p 31443 ca-cert-export <rsa_SubCA_AgentV_serial_number> --output-file /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_b64.crt
    Copy to Clipboard Toggle word wrap
7.12.3.1.3. 创建 pki 代理用户并关联新证书
  1. 创建 rsa_SubCA_AgentV 用户:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-add --fullName="rsa_SubCA_AgentV" rsa_SubCA_AgentV
    ---------------------
    Added user "rsa_SubCA_AgentV"
    ---------------------
     User ID: rsa_SubCA_AgentV
     Full name: rsa_SubCA_AgentV
    Copy to Clipboard Toggle word wrap

    同样:

    • 对于 KRA,使用 kra-user-add 命令和 KRA 的 admin nick、主机名和端口来创建新用户,如 KRA_AgentV
    • 对于 OCSP,使用带有 OCSP 的 admin nick、主机名和端口的 ocsp-user-add 命令创建新用户,如 OCSP_AgentV

    如果 TMS 值得关注,

    • 对于 TKS,使用 tks-user-add 命令和 TKS 的 admin nick、主机名和端口来创建新用户,如 TKS_AgentV
    • 对于 TPS,使用 tps-user-add 命令和 TPS 的 admin nick、主机名和端口来创建新用户,如 TPS_AgentV
  2. rsa_SubCA_AgentV 添加到 Certificate Manager Agents 组中:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-add "Certificate Manager Agents" rsa_SubCA_AgentV
    -----------------------------
    Added group member "rsa_SubCA_AgentV"
    -----------------------------
     User: rsa_SubCA_AgentV
    Copy to Clipboard Toggle word wrap

    同样:

    • 要将新创建的用户(如 KRA_AgentV)添加到 KRA 的代理组,请使用 kra-group-member-add 命令以及 KRA 的 admin nick、hostname、port 和组 "Data Recovery Manager Agents"。
    • 要将新创建的用户(如 OCSP_AgentV)添加到 OCSP 的代理组中,请使用 ocsp-group-member-add 命令以及 OCSP 的 admin nick、hostname、port 和组 "Online Certificate Status Manager Agents"。

    如果 TMS 值得关注:

    • 要将新创建的用户(如 TKS_AgentV)添加到 TKS 的代理组中,请使用 tks-group-member-add 命令以及 TKS 的 admin nick、hostname、port 和组 "Token Key Service Manager Agents"。
    • 要将新创建的用户(如 TPS_AgentV)添加到 TPS 的代理组,请使用带有 TPS 的 admin nick、hostname、port 和组 "TPS Agents" 的 tps-group-member-add 命令。
  3. 验证用户 rsa_SubCA_AgentV 是否已添加到 Certificate Manager Agents 组中。

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-find "Certificate Manager Agents"
    -----------------
    3 entries matched
    -----------------
     User: caadmin
    
     User: pkidbuser
    
     User: rsa_SubCA_AgentV
    ----------------------------
    Number of entries returned 3
    ----------------------------
    Copy to Clipboard Toggle word wrap

    同样:

    • 要验证 KRA 的代理组中的成员资格,请使用带有 KRA 主机名、port 和组"Data Recovery Manager Agents" 的 kra-group-member-find 命令。
    • 要验证 OCSP 代理组中的成员资格,请使用带有 OCSP 主机名、端口以及组"在线证书状态管理器代理"的 ocsp-group-member-find 命令。

    如果 TMS 值得关注:

    • 要验证 TKS 代理组中的成员资格,请使用 tks-group-member-find 命令及 KRA 的主机名和端口,以及组 "Token Key Service Manager Agents"。
    • 要验证 TPS 代理组中的成员资格,请使用带有 TPS 主机名和端口的 tps-group-member-find 命令,以及组 "TPS Agents"。
  4. rsa_SubCA_AgentV 证书添加到 pki 角色用户:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-add rsa_SubCA_AgentV --input /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_b64.crt
    
    -------------------------------------------------------------------------------------------------------------------------------------
    Added certificate "2;236851028;CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA;CN=rsa_SubCA_AgentV,UID=rsa_SubCA_AgentV"
    Copy to Clipboard Toggle word wrap

    同样:

    • 要将证书添加到 KRA 和 OCSP 中的用户,请分别使用 kra-user-cert-addocsp-user-cert-add 命令以及相应的子系统的主机名和端口。

    如果 TMS 值得关注:

    • 要将证书添加到 TKS 和 TPS 中的用户,请分别使用 tks-user-cert-addtps-user-cert-add 命令以及相应的子系统的主机名和端口。
  5. 将证书文件 /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AgentV_pkcs7.crt 发送到用户(例如 jsmith)。然后,可以将文件复制到用户位置 /home/jsmith/certs_db/rsa_SubCA_AgentV_pkcs7.crt 以在以后的步骤中导入。
7.12.3.1.4. 将 pki 代理证书导入到客户端 nssdb

这个过程由新的 pki 代理用户(如 jsmith)执行,后者从 bootstrap 用户接收新发布的证书文件(如 /home/jsmith/certs_db/rsa_SubCA_AgentV_pkcs7.crt)从 bootstrap 用户(本例中为 root 用户)。

  1. 以 'Agent' 身份登录 rhcs10.example.com (一个非 root 用户,如 jsmith)。
  2. 安装 rsa_SubCA_AgentV 证书:

    $ pki -d /home/jsmith/certs_db -c SECret.123 pkcs7-import "rsa_SubCA_AgentV" --pkcs7 /home/jsmith/certs_db/rsa_SubCA_AgentV_pkcs7.crt
    Copy to Clipboard Toggle word wrap
    $ certutil -d /home/jsmith/certs_db -L
    
    Certificate Nickname              Trust Attributes
                                      SSL,S/MIME,JAR/XPI
    
    . . . Output omitted . . .
    
    rsa_SubCA_AgentV                  u,u,u
    Copy to Clipboard Toggle word wrap
  3. 通过创建一个 .p12 文件来备份角色用户 rsa_SubCA_AgentV 证书,例如,使用密码 SECret.123

    $ pki -d /home/jsmith/certs_db -c SECret.123 client-cert-show "rsa_SubCA_AgentV" --pkcs12 /home/jsmith/certs_db/rsa_SubCA_AgentV.p12 --pkcs12-password SECret.123
    Copy to Clipboard Toggle word wrap

请参阅管理指南中的参考第 2.4.1"Browser Initialization"部分,以导入 PKCSmtc 文件,以初始化 Firefox 浏览器以进行 TLS mutual 身份验证。

7.12.4. Audit 用户

  • auditV (此用户在整个 测试过程中会有一个 valid 证书)

7.12.4.1. 为 pki auditor 设置证书和角色

以下示例将为 auditor 用户 aguru 创建 CMC 签名的证书 rsa_SubCA_AuditV。此 CMC 请求将在下一节中使用 SubCA bootstrap 管理员证书进行签名。

7.12.4.1.1. 为 pki auditor 生成 CSR

此过程由 pki auditor (例如,Astrid Guru、auguru)执行,旨在为此用户创建 CSR。

  • 以"Auditor"身份(一个非 root 用户,如 aguru)登录到 rhcs10.example.com

    1. 如果客户端 nssdb 不存在,请创建一个:

      $ pki -d /home/aguru/certs_db -c SECret.123 client-init
      Copy to Clipboard Toggle word wrap
    2. 使用 PKCS10Client 工具生成 PKCS#10 证书请求:

      注意

      根据每个子系统更改 subjectDN 和 .req 文件名,例如: OCSP_AuditV、KRA_AuditV 等。

      $ PKCS10Client -d /home/aguru/certs_db -p SECret.123 -n "cn=rsa_SubCA_AuditV, uid=rsa_SubCA_AuditV" -o /home/aguru/certs_db/rsa_SubCA_AuditV.req
      
      PKCS10Client: Certificate request written into /home/aguru/certs_db/rsa_SubCA_AuditV.req
      PKCS10Client: PKCS#10 request key id written into /home/aguru/certs_db/rsa_SubCA_AuditV.req.keyId
      Copy to Clipboard Toggle word wrap

      aguru 用户应该向 pki 代理用户向 pki 代理用户向 pki 代理用户发送证书请求(CSR) /home/aguru/certs_db/rsa_SubCA_AuditV.req 到 pki 代理用户。您可以使用新 appointed 示例 pki agent jsmith 或包含 bootstrap 证书/密钥的 root 用户;在本例中,我们只使用 root 用户。

7.12.4.1.2. 批准 pki 审计用户的 CSR

本节描述了由保存 SubCA 的 bootstrap admin 证书的用户执行的步骤,如 root 用户。它演示了如何处理 CSR (上一节中的 aguru 创建)来发布 pki auditor 证书。

先决条件

  • 以 root 用户身份登录 RHCS 机器。
  • nssdb 中存在 admin/agent 证书(本例中为 SubCA bootstrap 证书)。

通过 CMC 发布证书

  1. 将从 aguru 接收的 CSR 文件(rsa_SubCA_AuditV.req)放置到 /root/.dogtag/pki_rsa_bootstrap/certs_db 目录。
  2. 生成 CMC 请求:

    1. 创建 CMCRequest 配置文件。例如:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AuditV.cfg
      Copy to Clipboard Toggle word wrap
      ### numRequests: Total number of PKCS10 requests or CRMF requests.
      numRequests=1
      
      ### input: full path for the PKCS10 request or CRMF request,
      ### The content must be in Base-64 encoded format.
      ### Multiple files are supported. They must be separated by a space.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV.req
      
      ### output: full path for the CMC request in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.req
      
      ### tokenname: name of the token where the user signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the user cert that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for the cert8.db that stores the user signing cert and keys
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=false
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      request.privKeyId= _<private key id>_
      Copy to Clipboard Toggle word wrap
    2. 使用 CMCRequest 命令生成请求:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmcRequest_p10_rsa_SubCA_AuditV.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      useSharedSecret is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      createSignedData: building cert chain
      signData: signed request generated.
      getCMCBlob: begins
      getCMCBlob: generating signed data
      
      The CMC enrollment request in base-64 encoded format:
      
      . . . Output omitted . . .
      
      The CMC enrollment request in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/cmc.rsa_SubCA_AuditV_pkcs10.req
      Copy to Clipboard Toggle word wrap
  3. 提交 CMC 请求:

    1. 创建 HttpClient 配置文件。例如:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AuditV_signed.cfg
      Copy to Clipboard Toggle word wrap
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### secure: true for secure connection, false for nonsecure connection
      secure=true
      
      ### input: full path for the enrollment request, the content must be in binary format
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
      Copy to Clipboard Toggle word wrap
    2. 使用 HttpClient 命令提交请求:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_cmc_p10_rsa_SubCA_AuditV_signed.cfg
      
      Total number of bytes read = 3459
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 2596
      
      . . . Output omitted . . .
      
      The response in binary format is stored in /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.resp
      Copy to Clipboard Toggle word wrap
  4. 使用 CMCResponse 处理响应,以 PEM 格式单独以链的形式显示所有证书:

    重要

    使用 "-v" 选项运行 CMCResponse 将链中每个证书的 PEM 返回为 Cert:0, Cert:1 等。在所有 PEM 下,输出也会以用户打印格式显示链中的每个证书。由于证书没有以固定顺序显示,因此为了确定其在链中的位置,您必须检查每个 "Certificate" 下的"Subject: "。对应的 PEM 显示在上面的同一位置。

    # CMCResponse -v -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.rsa_SubCA_AuditV_pkcs10.resp -o /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_pkcs7.crt
    
    Certificates:
        Certificate:
           Data:
               Version:  v3
               Serial Number: 0xD107903
               Signature Algorithm: SHA512withRSA - 1.2.840.113549.1.1.13
               Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
               Validity:
                   Not Before: Sunday, January 7, 2018 1:12:52 PM EST America/New_York
                   Not  After: Friday, July 6, 2018 1:12:52 PM EDT America/New_York
               Subject: CN=rsa_SubCA_AuditV,UID=rsa_SubCA_AuditV
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
      OID: {1 3 6 1 5 5 7 7 25}
      BodyList: 1
      Status: SUCCESS
    Copy to Clipboard Toggle word wrap
  5. 将审核员证书复制到 /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_b64.crt

    # pki -p 31443 ca-cert-export <rsa_SubCA_AuditV_serial_number> --output-file /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_b64.crt
    Copy to Clipboard Toggle word wrap
7.12.4.1.3. 创建 pki auditor 用户并关联新证书

此流程由现有的 pki admin 用户执行,本例中为保存 SubCA bootstrap 证书的 root 用户。

  1. 创建 rsa_SubCA_AuditV 用户:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-add --fullName="rsa_SubCA_AuditV" rsa_SubCA_AuditV
    ---------------------
    Added user "rsa_SubCA_AuditV"
    ---------------------
     User ID: rsa_SubCA_AuditV
     Full name: rsa_SubCA_AuditV
    Copy to Clipboard Toggle word wrap

    同样:

    • 对于 KRA,使用 kra-user-add 命令和 KRA 的 admin nick、主机名和端口来创建新用户,如 KRA_AuditV
    • 对于 OCSP,使用带有 OCSP 的 admin nick、主机名和端口的 ocsp-user-add 命令创建新用户,如 OCSP_AuditV

    如果 TMS 值得关注:

    • 对于 TKS,使用 tks-user-add 命令和 TKS 的 admin nick、主机名和端口来创建新用户,如 TKS_AuditV
    • 对于 TPS,使用 tps-user-add 命令和 TPS 的 admin nick、主机名和端口来创建新用户,如 TPS_AuditV
  2. rsa_SubCA_AuditV 添加到 Auditors 组中:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-add "Auditors" rsa_SubCA_AuditV
    -----------------------------
    Added group member "rsa_SubCA_AuditV"
    -----------------------------
     User: rsa_SubCA_AuditV
    Copy to Clipboard Toggle word wrap

    同样:

    • 要将新创建的用户(如 KRA_AuditV)添加到 KRA 的 auditors 组,请使用 kra-group-member-add 命令以及 KRA 的 admin nick、hostname 和 port。
    • 要将新创建的用户(如 OCSP_AuditV)添加到 OCSP 的 auditors 组中,请使用 ocsp-group-member-add 命令以及 OCSP 的 admin nick、主机名和端口。

    如果 TMS 值得关注:

    • 要将新创建的用户(如 TKS_AuditV)添加到 TKS 的 auditors 组中,请使用 tks-group-member-add 命令以及 TKS 的 admin nick、主机名和端口。
    • 要将新创建的用户(如 TPS_AuditV)添加到 TPS 的 auditors 组,请使用 TPS 的 admin nick、hostname 和 port 的 tps-group-member-add 命令。
  3. 验证用户 rsa_SubCA_AuditV 是否已添加到 Auditors 组中。

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-group-member-find "Auditors"
    -----------------
    1 entries matched
    -----------------
     User: rsa_SubCA_AuditV
    ----------------------------
    Number of entries returned 1
    ----------------------------
    Copy to Clipboard Toggle word wrap

    同样:

    • 要验证 KRA 的 auditors 组中的成员资格,请使用带有 KRA 主机名和端口的 kra-group-member-find 命令。
    • 要验证 OCSP 审核员组中的成员资格,请使用带有 OCSP 主机名和端口的 ocsp-group-member-find 命令。

    如果 TMS 值得关注:

    • 要验证 TKS 的 auditors 组中的成员资格,请使用带有 TKS 主机名和端口的 tks-group-member-find 命令。
    • 要验证 TPS 的 auditors 组中的成员资格,请使用带有 TPS 主机名和端口的 tps-group-member-find 命令。
  4. rsa_SubCA_AuditV 证书添加到 pki 角色用户:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-add rsa_SubCA_AuditV --input /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_b64.crt
    
    -------------------------------------------------------------------------------------------------------------------------------------
    Added certificate "2;236851028;CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA;CN=rsa_SubCA_AuditV,UID=rsa_SubCA_AuditV"
    Copy to Clipboard Toggle word wrap

    同样:

    • 要将证书添加到 KRA 和 OCSP 中的用户,请分别使用 kra-user-cert-addocsp-user-cert-add 命令以及相应的子系统的主机名和端口。

    如果 TMS 值得关注:

    • 要将证书添加到 TKS 和 TPS 中的用户,请分别使用 tks-user-cert-addtps-user-cert-add 命令以及相应的子系统的主机名和端口。
  5. 将证书文件 /root/.dogtag/pki_rsa_bootstrap/certs_db/rsa_SubCA_AuditV_pkcs7.crt 发送到用户(如 aguru)。然后,可以将文件复制到用户位置 /home/aguru/certs_db/rsa_SubCA_AuditV_pkcs7.crt 以在以后的步骤中导入。
7.12.4.1.4. 将 pki audit 证书导入到客户端 nssdb

本节由新的 pki auditor 用户(如 aguru)执行,该用户收到了新发布的证书文件(例如 /home/aguru/certs_db/rsa_SubCA_AuditV_pkcs7.crt),在本例中为 root 用户。

  1. 以"Auditor"身份(一个非 root 用户,如 aguru)登录到 rhcs10.example.com
  2. 安装 rsa_SubCA_AuditV 证书:

    $ pki -d /home/aguru/certs_db -c SECret.123 pkcs7-import "rsa_SubCA_AuditV" --pkcs7 /home/aguru/certs_db/rsa_SubCA_AuditV_pkcs7.crt
    Copy to Clipboard Toggle word wrap
    $ certutil -d /home/aguru/certs_db -L
    
    Certificate Nickname              Trust Attributes
                                      SSL,S/MIME,JAR/XPI
    
    . . . Output omitted . . .
    
    rsa_SubCA_AuditV                  u,u,u
    Copy to Clipboard Toggle word wrap
  3. 通过创建 .p12 文件来备份角色用户 rsa_SubCA_AuditV 证书,例如,使用密码 SECret.123

    $ pki -d /home/aguru/certs_db -c SECret.123 client-cert-show "rsa_SubCA_AuditV" --pkcs12 /home/aguru/certs_db/rsa_SubCA_AuditV.p12 --pkcs12-password SECret.123
    Copy to Clipboard Toggle word wrap

7.12.5. TPS 运算符

TPS 运算符的流程与审核员的进程类似。

注意

只有在您确定为每个 RHCS 子系统确定时,才按照本节中的说明操作,至少已创建并成功测试了一个 admin 用户才能执行管理员功能。

  1. 列出身份验证 nssdb 中的证书,以确定 SubCA、KRA 和 OCSP 安装的 bootstrap admin 证书。例如:

    # certutil -d /root/.dogtag/pki_rsa_bootstrap/certs_db -L
    
    Certificate Nickname                             Trust Attributes
                                                     SSL,S/MIME,JAR/XPI
    
    PKI Bootstrap Administrator for RSA-RootCA       u,u,u
    PKI Bootstrap Administrator for RSA-SubCA        u,u,u
    PKI Bootstrap Administrator for RSA-OCSP-rootca  u,u,u
    PKI Bootstrap Administrator for RSA-OCSP-subca   u,u,u
    PKI Bootstrap Administrator for RSA-KRA          u,u,u
    Copy to Clipboard Toggle word wrap
  2. 删除 SubCA、OCSP 和 KRA bootstrap admin 用户证书:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-SubCA"
    Copy to Clipboard Toggle word wrap
    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-OCSP-rootca"
    Copy to Clipboard Toggle word wrap
    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-OCSP-subca"
    Copy to Clipboard Toggle word wrap
    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-KRA"
    Copy to Clipboard Toggle word wrap
  3. 可选 :如果 TMS 值得关注,您可以以同样的方式删除 TKS 和 TPS bootstrap 管理员用户。

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-TKS"
    Copy to Clipboard Toggle word wrap
    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -c SECret.123 client-cert-del "PKI Bootstrap Administrator for RSA-TPS"
    Copy to Clipboard Toggle word wrap

禁用多角色支持

bootstrap 用户有多个角色(admin、agent 和 auditor)。现在,您已将 bootstrap 用户替换为单角色特权用户,您可以按照 第 15.1 节 “禁用多角色支持” 安全地禁用多角色功能。

返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

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

让开源更具包容性

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

關於紅帽

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

Theme

© 2025 Red Hat