kmipcfg - 配置 PKCS#11 KMIP 提供者
kmipcfg create [-i] -o property=value ... server_group
kmipcfg destroy [-f] [server_group]
kmipcfg disable [-f] [server_group]
kmipcfg enable [-f] [server_group]
kmipcfg extract [-p filename] [-s][-t all|pkcs11|libkmip] server_group
kmipcfg extract [-p filename] [-s] [-i] [-t all|pkcs11|libkmip] [{-S service_instance_fmri [-N property_group_name] [-T property_group_type] [-o cred_source_type=raw|path] [{-o private_key=path -o cert=path [-o ca_cert=path]} | {-o p12_bundle=path -o p12_bundle_pass=locator}] [-o property=value] ...}]
kmipcfg help [subcommand]
kmipcfg info [-n] [-H [-v]] [-o property[,property,...]] [server_group]
kmipcfg list [-c] [-s] [-H [-v]] [-o property[,property,...]] [server_group]
kmipcfg set [-f] -o property=value ... server_group
kmipcfg 命令用于在 Solaris 加密框架 (Solaris Cryptographic Framework, SCF) 中初始化和管理 PKCS#11 密钥管理互操作性协议 (Key Management Interoperability Protocol, KMIP) 提供者的状态。
The KMIP provider, pkcs11_kmip(7), provides the system with access to remote KMIP servers.客户机与服务器之间的通信由 TLS 来提供保护。多个远程 KMIP 系统可以组成服务器组。假定使用相同凭证的 KMIP 客户机能够与服务器组中的任意服务器进行通信。服务器组中的所有服务器都必须支持相同的 KMIP 协议版本。与任意 KMIP 服务器组成员之间的通信可提供其他任意服务器组成员的相关受支持 KMIP 协议版本信息。
在 PKCS#11 框架中,KMIP 提供者充当一个槽,每个 KMIP 服务器组充当一个令牌。系统管理员可使用 cryptoadm(8) 启用 KMIP 提供者,以及使用 kmipcfg 命令配置 KMIP 令牌。pktool(1) 命令可用于从 PKCS#11 角度查看令牌的状态。
用户特定(专用)KMIP 配置基于文件。各个 Solaris KMIP 客户机组件的配置文件存储在用户特定目录中。对配置的访问权限取决于具有配置存储的相应目标文件系统的访问控制机制。
KMIPTOKEN_DIR 环境变量指向带有 KMIP 令牌的基目录。KMIP 令牌由 KMIPTOKEN_DIR 环境变量中的子目录表示。配置后,每个令牌目录均包含与 KMIP 服务器通信时所需的 KMIP 配置和凭证。
KMIPTOKEN_DIR 环境变量缺省值为 /var/user/$USERNAME/kmip。USERNAME 环境变量是与所执行 kmipcfg 命令的 RUID 关联的各自的用户名。
与用户无关(共享)的 KMIP 客户机配置存储在表示 Solaris KMIP 客户机组件的 smf 服务实例中。只有授权用户能够访问这些实例中的信息。使用的授权模型符合 smf_security(7) 手册页中所述的 rbac 实现。有关更多信息,请参见 smf(7) 和 rbac(7) 手册页。
有权访问共享 KMIP 配置的用户可以在 kmipcfg list 输出中查找 Default KMIP token(缺省 KMIP 令牌)服务器组。同名令牌也会列出在 pktool tokens 命令的输出中。
支持以下子命令:
创建新的 server_group(KMIP 令牌)。A directory in the path KMIPTOKEN_DIR/<server_group> is created and populated with the KMIP client configuration and credentials.
服务器组名限制为任意字母数字、短划线和下划线字符。服务器组名的最大长度为 32 字节。
–i 选项指定 KMIP 服务器组的交互式配置。
配置和凭证可以使用 property=value 对来指定。可设置以下属性:
服务器组的可选状态。如果不指定,则状态会设置为启用。
The mandatory, comma-delimited list of IP addresses or host names of the KMIP servers.如果指定 IPv6 地址和端口,必须使用方括号将 IPv6 地址括起来。如果不指定 port_number,则使用缺省端口 5696。
Required KMIP protocol version.If auto is set the best match with the server is applied.Default value is auto.
之后与 KMIP 服务器连接超时的可选秒数。缺省连接超时为 5 秒。
KMIP 协议所传输数据的可选编码格式。唯一支持的值为 TTLV。
server_list 中定义的 KMIP 服务器之间允许的故障转移的可选上界。如果不指定 failover_limit 或将其设置为 0,则故障转移缺省限制为 2。如果将 failover_limit 设置为 -1,那么将禁用故障转移。
KMIP 令牌目录的可选路径。The default value of the property is the concatenated string $KMIPTOKEN_DIR/server_group.
PKCS#12 包的强制性路径。如果指定相对路径,该路径将被解析为与 client_keystore 目录相对的路径。
pkcs11_kmip(7) 对象高速缓存条目的生存时间值。cache_ttl 缺省值为 300 秒。
启用或禁用服务器证书中的主题 CN 验证。TLS 握手期间,某些 KMIP 服务器实现错误地填写在服务器提供的服务器证书的 CN 中。此选项可以解决该问题并且会继续建立 TLS 会话。缺省情况下,server_cert_subj_cn_verify 处于启用状态。
辅助验证的可选类型。如果不指定,将不配置辅助验证参数。如果辅助验证的所选类型为 username-password 或 device,必须附加逗号分隔的配置属性。
username-password-parameters: username, password
device-parameters: device_serial_number, password, device_identifier, network_identifier, machine_identifier, media_identifier
'password' property requires a locator string: password=prompt | file:// | https://
其中:
口令的命令提示。
文件系统中的口令短语文件位置。
The passphrase file location on a secure server.针对 URL 的 GET 只返回口令字符串。服务器提供的证书必须是 libcurl 和 OpenSSL 信任的一个证书。
辅助验证的缺省值为 none。
启用或禁用相应的 PKCS#11 令牌。
销毁 KMIP server_group。如果不指定 server_group,那么将销毁所有服务器组。使用 kmipcfg create 命令填充的所有组件都将从系统中删除。KMIP server_group 表示的 KMIP 令牌将从 PKCS#11 令牌列表中删除。
指定强制删除一个 KMIP 服务器组。如果不指定服务器组,此选项会强制删除所有服务器组。
禁用 KMIP server_group。如果不指定 server_group,那么将禁用所有服务器组。KMIP server_group 表示的 KMIP 令牌会从 PKCS#11 令牌列表中删除。
指定强制禁用所有 KMIP 服务器组。如果指定 server_group,此选项将无效。
启用 KMIP server_group。如果不指定 server_group,那么将启用所有服务器组。KMIP server_group 表示的 KMIP 令牌会重新出现在 PKCS#11 令牌列表中。
指定强制禁用所有 KMIP 服务器组。如果指定 server_group,此选项将无效。
基于现有服务器组配置生成 SMF 配置文件。SMF 配置文件可用于各种安装和配置上下文。有关更多信息,请参见 service_bundle(5), smf(7), installadm(8), sysconfig(8) 和 zoneadm(8) 手册页。
The extracted profile will be stored in filename.如果在执行 extract 子命令时未指定 –p 选项,生成的配置文件将输出到标准输出。
SMF 配置文件必须具有 .xml 扩展名。
此选项将提取敏感信息。For example, encoded certificates, and PKCS#12 bundle PIN.
提取 svc:/system/pkcs11:kmip 服务实例 (pkcs11)、svc:/system/kmip/client:default 服务实例 (libkmip) 或这两个服务实例 (all) 的配置文件。缺省情况下会提取所有配置文件。
在提取的 AI 配置文件中使用其配置的现有服务器组。
基于选项参数中提供的参数生成 SMF 配置文件。
以交互方式请求配置属性。
如果未指定,将使用缺省属性组名称 kmip_client_default。
如果未指定,将使用缺省属性组类型 kmip_client_config。
设置 private_key、cert、ca_cert 和 p12_bundle 属性中存储的数据是否为文件系统中给定文件的路径 (path),或者设置是否读取这些文件、对其进行 Base64 编码、为其建立索引并将其存储到相应的属性值 (raw)。如果未指定,选项缺省为 raw。
客户机私钥的路径。
如果指定相对 path,将相对于 client_keystore 目录解析 path。
客户机证书的路径。
如果指定相对 path,将相对于 client_keystore 目录解析 path。
如果未设置,将使用操作系统随附的 CA 证书验证服务器的证书。如果路径指向某个目录而非文件,则该目录中的文件必须为 PEM 格式的 CA 证书。所有此类证书均会装入且可信。使用 c_rehash (1openssl) 计算证书的散列,并创建指向带证书文件的符号链接。
如果指定相对 path,将相对于 client_keystore 目录解析 path。
如果指定,则提供的 PKCS#12 包应包含客户机密钥、客户机证书和 CA 证书。
如果指定相对 path,将相对于 client_keystore 目录解析 path。
定位器指向 PKCS#12 包口令短语的源。有关定位器的详细信息,请参见 kmipcfg create 命令的 secondary_authentication 属性部分中的口令描述。
此选项设置 kmipcfg create 命令中指定的其余服务器组的特定属性。
有关其余选项,请参见 kmipcfg extract 部分。
输出有关所有子命令或指定子命令的帮助信息。
Connect to the server_group and show supported versions and its capabilities.
Show numeric values for supported operations and objects instead of names.
使用分号作为分隔符以可解析格式列出配置。
此选项输出具有相应属性名称的标题行以及 –H 选项(值)提供的输出。
列出一个具体配置参数。使用逗号分隔多个参数。
列出使用 kmipcfg create 命令配置的参数。If server_group is specified, only configuration parameters of the server_group are listed.
以非交互式 kmipcfg create 命令可以使用的一种格式列出配置参数。不输出敏感信息。口令定位器字符串始终设置为 prompt。–c 选项不能与 –H 选项一起使用。
输出 KMIP 服务器组配置中存储的敏感信息,例如,辅助验证中使用的口令。–s 选项不能与 –c 选项一起使用。
使用分号作为分隔符以可解析格式列出配置。
此选项输出具有相应属性名称的标题行以及 –H 选项(值)提供的输出。
列出一个具体配置参数。使用逗号分隔多个参数。
设置 server_group 的配置参数。有关配置参数列表,请参阅 kmipcfg create 命令。
指定强制设置所有 KMIP 服务器组中的属性。如果指定 server_group,此选项将无效。
将返回以下退出值:
成功完成。
发生了致命错误。
发生了用法错误。
以下命令将创建仅包含一个 KMIP 服务器的服务器组 "KMIP_server"。kmip-server-1_keys.p12 PKCS#12 包中提供用于验证和保护通信的凭证。
% kmipcfg create -o server_list=kmip-server-1.example.com:5696 \ -o p12_bundle=kmip-server-1_keys.p12 KMIP_server示例 2 以交互方式创建 KMIP 服务器组
以下命令将以交互模式配置服务器组 "KMIP_cluster"。要确认缺省属性值,请按 Enter 键。
% kmipcfg create -i KMIP_cluster KMIP server: kmip-server-1.example.com KMIP port [5696]: Add another KMIP server [y|N]: y KMIP server: kmip-server-2.example.com KMIP port [5696]: 5697 Add another KMIP server [y|N]: Required version [auto]: Connection timeout [5]: Cache object time to live [300]: Encode type [TTLV]: TTLV Failover limit [3]: 1 Client keystore [/var/user/jf/kmip/KMIP_cluster]: PKCS#12 bundle: /var/user/jf/kmip/kmip_cluster_credentials.p12 Verify CN in the subject of the server certificate [Y|n]: Secondary authentication [none]: username-password Username: jf_kmip Password locator [prompt]: Disable the respective PKCS#11 token [y|N]: 'username-password' password: *********示例 3 禁用 KMIP 服务器组
以下示例将禁用一个 KMIP 服务器组。
# kmipcfg disable Do you really want to disable server group 'Default KMIP token' [y|N]: y Do you really want to disable all user specific server groups [y|N]: y示例 4 列出配置参数
以下命令将列出 KMIPTOKEN_DIR 路径下所有 KMIP 服务器组(KMIP 令牌)的配置。
% kmipcfg list Server group: KMIP_server State: enabled Hosts: kmip-server-1.example.com:5696 Required version: auto Connection timeout: 5 Cache object time to live: 300 Encode type: TTLV Failover limit: 1 Client keystore: /var/user/jf/kmip/KMIP_server Client PKCS#12 bundle: kmip-server-1_keys.p12 Server certificate subject CN verification: enabled Secondary authentication type: none Server group: KMIP_cluster State: enabled Hosts: kmip-server-1.example.com:5696 kmip-server-2.example.com:5697 Required version: 1.4 Connection timeout: 5 Cache object time to live: 300 Encode type: TTLV Failover limit: 1 Client keystore: /var/user/jf/kmip/KMIP_cluster Client PKCS#12 bundle: /var/user/jf/kmip/kmip_cluser_credentials.p12 Server certificate subject CN verification: enabled Secondary authentication type: username-password Username: jf_kmip Password:示例 5 列出服务器组的配置参数
以下命令将列出一个服务器组的配置以及所有敏感信息。
% kmipcfg list -s KMIP_cluster Server group: KMIP_cluster State: enabled Hosts: kmip-server-1.example.com:5696 kmip-server-2.example.com:5697 Required version: 1.4 Connection timeout: 5 Cache object time to live: 300 Encode type: TTLV Failover limit: 1 Client keystore: /var/user/jf/kmip/KMIP_cluster Client PKCS#12 bundle: /var/user/jf/kmip/kmip_cluser_credentials.p12 Server certificate subject CN verification: enabled Secondary authentication type: username-password Username: jf_kmip Password: changeme示例 6 设置配置参数
以下示例将列出和设置特定 KMIP 服务器组的配置参数。
% kmipcfg list -o connection_timeout KMIP_server Connection timeout: 5 % kmipcfg set -o connection_timeout=10 KMIP_server % kmipcfg list -o connection_timeout KMIP_server Connection timeout: 10示例 7 列出“缺省 KMIP 令牌”配置中存储的 KMIP 客户机证书
以下示例列出“缺省 KMIP 令牌”配置中存储的 KMIP 客户机证书。
# kmipcfg list -o cred_source_type "Default KMIP token" TLS credentials source type: raw # kmipcfg set -o cert=/var/user/jf/kmip/cert.pem "Default KMIP token" # kmipcfg list -o cert -s "Default KMIP token" Client certificate: 1612 Bytes 0 : <client_cert_data_Base64_encoded> 73 : <client_cert_data_Base64_encoded> 1533 : <client_cert_data_Base64_encoded> 1606 : <client_cert_data_Base64_encoded>
Base64 编码的数据可以使用以下命令流水线轻松转换为用户可读形式:
# kmipcfg list -s -o cert -H "Default KMIP token" | base64 -d | \ openssl x509 -noout -text示例 8 生成 SMF 配置文件
以下命令基于从现有服务器组配置的值生成 SMF 配置文件,并且还包含敏感信息。
# kmipcfg extract -s "Default KMIP token"
以下示例以交互方式生成 SMF 配置文件。
# kmipcfg extract -s -i -p ./profile.xml Extract service instance [all]: Libkmip configuration in service instance [svc:/system/kmip/client:default]: Property group name [kmip_client_default]: Property group type [kmip_client_config]: KMIP server: kmip-server-1.example.com KMIP port [5696]: Add another KMIP server [y|N]: Required version [auto]: Connection timeout [5]: Cache object time to live [300]: Encode type [TTLV]: Failover limit [3]: Client keystore [/var/user/root/kmip/]: Credentials source type [raw]: Private key: Certificate: CA certificate: PKCS#12 bundle: /var/user/jf/kmip/kmip_cred_bundle.p12 PKCS#12 bundle password locator [prompt]: 'p12_bundle_pass' password: ******** Verify CN in the subject of the server certificate [Y|n]: Secondary authentication [none]: Disable the respective PKCS#11 token [y|N]: Enable svc:/system/pkcs11:kmip service instance [y|N]: #示例 10 Get information about server capabilities.
Following example shows configured server capabilities.
# kmipcfg info kmip_vbox Enter PIN for kmip_vbox: Server group: kmip_vbox Supported versions: 1.4, 1.3, 1.2, 1.1, 1.0 Server info: Gemalto, Inc. Operations: Create, Create Keypair, Register, Locate, Get, Get Attributes, Get Attribute List, Add Attribute, Modify Attribute, Delete Attribute, Activate, Revoke, Destroy, Query, Rekey, Rekey Keypair, Check, Discover Versions Object types: Symmetric Key, Public Key, Private Key, Secret Data, Opaque Attestation types: NONE Rng params: NONE Profiles: NONE Validations: NONE Capabilities: NONE Client registration methods: NONE
有关下列属性的说明,请参见 attributes(7):
|
pktool(1), attributes(7), pkcs11_kmip(7)
PKCS#11 客户机要求 KMIP 服务器支持密钥管理互操作性协议规范版本 1.1。
PKCS#12 包的最基本内容是客户机的证书和私钥。如果客户机的证书无法使用缺省 CA 证书进行验证,则必须包括各自的 CA 证书。