14.3.2. 管理用户(管理员、代理和审核员)

每个子系统的用户会单独维护。仅仅因为一个子系统中的管理员并不知道对另一个子系统具有任何权利(甚至是用户条目)。可以为子系统配置用户,并使用其用户证书、信任的代理、管理员或审核员来配置。

14.3.2.1. 创建用户

安装证书系统后,只有在设置期间创建的用户就存在。这部分论述了如何创建其他用户。
注意
出于安全考虑,为证书系统用户创建单独的帐户。
14.3.2.1.1. 使用命令行创建用户
使用命令行创建用户:
  1. 添加用户帐户。例如,将 示例 用户添加到 CA:
    # pki -d ~/.dogtag/pki-instance_name/ca/alias/ -c password -n caadmin \
         ca-user-add example --fullName "Example User"
    ---------------------
    Added user "example"
    ---------------------
      User ID: example
      Full name: Example User
    此命令使用 caadmin 用户添加新帐户。
  2. (可选)将用户添加到组中。例如,将 示例 用户添加到 证书管理器代理 组中:
    # pki -d ~/.dogtag/pki-instance_name/ -p password -n "caadmin" \
         user-add-membership example Certificate Manager Agents
  3. 创建证书请求:
    • 如果您的证书系统环境中存在密钥恢复授权(KRA):
      # CRMFPopClient -d ~/.dogtag/pki-instance_name/ -p password \
           -n "user_name" -q POP_SUCCESS -b kra.transport -w "AES/CBC/PKCS5Padding" \
           -v -o ~/user_name.req
      此命令在 ~/user_name.req 文件中以 CRMF 格式存储证书签名请求(CSR)。
    • 如果您的证书系统环境中不存在密钥恢复授权(KRA):
      # PKCS10Client -d ~/.dogtag/pki-instance_name/ -p password \
           -n "user_name" -o ~/user_name.req
      此命令将 CSR 以 pkcs10 格式存储在 ~/user_name.req 文件中。
  4. 创建注册请求:
    1. 使用以下内容创建 ~/cmc.role_crmf.cfg 文件:
      #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 space.
      input=~/user_name.req
      
      #output: full path for the CMC request in binary format
      output=~/cmc.role_crmf.req
      
      #tokenname: name of token where agent signing cert can be found (default is internal)
      tokenname=internal
      
      #nickname: nickname for agent certificate which will be used
      #to sign the CMC full request.
      nickname=PKI Administrator for Example.com
      
      #dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=~/.dogtag/pki-instance_name/
      
      #password: password for cert8.db which stores the agent
      #certificate
      password=password
      
      #format: request format, either pkcs10 or crmf
      format=crmf
      根据您的环境和上一步中使用的 CSR 格式设置参数。
    2. 将之前创建的配置文件传递给 CMCRequest 工具,以创建 CMC 请求:
      # CMCRequest ~/cmc.role_crmf.cfg
  5. 通过 CMS 提交证书管理(CMC)请求:
    1. 使用以下内容创建 ~/HttpClient_role_crmf.cfg 文件:
      # #host: host name for the http server
      host=server.example.com
      
      #port: port number
      port=8443
      
      #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=~/cmc.role_crmf.req
      
      #output: full path for the response in binary format
      output=~/cmc.role_crmf.resp
      
      #tokenname: name of token where 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=~/.dogtag/pki-instance_name/
      
      #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=password
      
      #nickname: nickname for client certificate
      #This parameter will be ignored if clientmode=false
      nickname=PKI Administrator for Example.com
      
      #servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull
      
      根据您的环境设置参数。
    2. 将请求提交到 CA:
      # HttpClient ~/HttpClient_role_crmf.cfg
      Total number of bytes read = 3776
      after SSLSocket created, thread token is Internal Key Storage Token
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 2523
      MIIJ1wYJKoZIhvcNAQcCoIIJyDCCCcQCAQMxDzANBglghkgBZQMEAgEFADAxBggr
      ...
      The response in data format is stored in ~/cmc.role_crmf.resp
    3. 验证结果:
      # CMCResponse ~/cmc.role_crmf.resp
      Certificates:
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0xE
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=pki-instance_name Security Domain
                  Validity:
                      Not Before: Friday, July 21, 2017 12:06:50 PM PDT America/Los_Angeles
                      Not  After: Wednesday, January 17, 2018 12:06:50 PM PST America/Los_Angeles
                  Subject: CN=user_name
      ...
      Number of controls is 1
      Control #0: CMCStatusInfoV2
         OID: {1 3 6 1 5 5 7 7 25}
         BodyList: 1
         Status: SUCCESS
  6. (可选)将证书作为用户导入到自己的 ~/.dogtag/pki-instance_name/ 数据库:
    # certutil -d ~/.dogtag/pki-instance_name/ -A -t "u,u,u" -n "user_name certificate" -i ~/cmc.role_crmf.resp
  7. 在用户记录中添加证书:
    1. 列出用户发布的证书,以发现证书的序列号。例如,列出在证书主体中包含 示例 用户名的证书:
      pki -d ~/.dogtag/pki-instance_name/ -c password -n caadmin ca-user-cert-find example
      -----------------
      1 entries matched
      -----------------
        Cert ID: 2;6;CN=CA Signing Certificate,O=EXAMPLE;CN=PKI Administrator,E=example@example.com,O=EXAMPLE
        Version: 2
        Serial Number: 0x6
        Issuer: CN=CA Signing Certificate,O=EXAMPLE
        Subject: CN=PKI Administrator,E=example@example.com,O=EXAMPLE
      ----------------------------
      Number of entries returned 1
      下一步中需要证书的序列号。
    2. 使用证书仓库中的序列号将证书添加到证书系统数据库中的用户帐户。例如,对于 CA 用户:
      pki -c password -n caadmin ca-user-cert-add example --serial 0x6
14.3.2.1.2. 使用控制台创建用户
使用 PKI 控制台创建用户:
  1. 登录到管理控制台。
    pkiconsole https://server.example.com:8443/subsystem_type
  2. Configuration 选项卡中,选择" 用户和组 "。点 Add
  3. 在编辑用户信息对话框中填写信息
    大多数信息都是标准用户信息,如用户名、电子邮件地址和密码。此窗口还包含一个名为 User State 的字段,它可以包含任何字符串,用于添加关于用户的附加信息;最重要的是,此字段可以显示为活动用户。
  4. 选择用户所属的组。用户的组成员资格决定了用户具有什么权限。将代理、管理员和审核员分配到适当的子系统组。
  5. 存储用户的证书。
    1. 通过 CA 最终用户服务页面请求用户证书。
    2. 如果没有为用户配置集配置自动注册,则批准证书请求。
    3. 使用通知电子邮件中提供的 URL 检索证书,并将 base-64 编码证书复制到本地文件或剪贴板。
    4. 选择新用户条目,然后单击 证书
    5. 单击 Import,并粘贴到 base-64 编码证书中。