[comment]: # translation:outdated

[comment]: # ({72ab9926-72ab9926})
# 13 密钥存储

[comment]: # ({/72ab9926-72ab9926})

[comment]: # ({4da69583-5a5d507b})
## 概述

Zabbix 可以配置为从安全保险库中检索敏感信息。支持以下密钥管理服务：HashiCorp Vault KV Secrets Engine - 版本 2、CyberArk Vault CV12。

密钥可用于检索：

-   [vault秘密](/manual/config/macros/secret_macros#vault秘密)
-   数据库访问凭证

Zabbix 提供对保险库中密钥的只读访问权限，假设密钥由其他人员进行管理。

[comment]: # ({/4da69583-5a5d507b})

[comment]: # ({0f1ca980-5cd2f0a1})
有关特定保管库提供程序的配置信息，请参见：

- [HashiCorp configuration](/manual/config/secrets/hashicorp)
- [CyberArk configuration](/manual/config/secrets/cyberark)

[comment]: # ({/0f1ca980-5cd2f0a1})

[comment]: # ({27f44bc0-44c0f649})
## 敏感值的缓存

Vault密钥宏的值由Zabbix server在每次刷新配置数据时检索，然后存储在configuration cache中。Zabbix proxy在每次配置同步时从Zabbix server接收Vault密钥宏的值，并将其存储在自己的configuration cache中。

::: noteimportant
必须在Zabbix server和proxy之间启用加密；否则将记录服务器警告消息。
:::

要手动触发从Vault刷新缓存的密钥值，请使用命令行工具的'secrets_reload' [运行时控制](/manual/concepts/server#运行时控制)。

对于Zabbix前端，默认情况下数据库凭证的缓存是禁用的，但可以通过在zabbix.conf.php中设置选项``$DB['VAULT_CACHE'] = true``来启用。凭证将使用文件系统的临时file目录存储在本地缓存中。Web服务器必须允许在私有临时文件夹中写入（例如，对于Apache，必须设置配置选项``PrivateTmp=True``）。要控制数据缓存刷新/失效的频率，请使用ZBX\_DATA\_CACHE\_TTL [constant](/manual/web_interface/definitions)。

[comment]: # ({/27f44bc0-44c0f649})

[comment]: # ({2922f25e-df569dd2})
## TLS配置

要为 Zabbix 组件与 vault 之间的通信配置 TLS，请将由证书颁发机构 (CA) 签署的证书添加到系统范围的默认 CA 存储中。
要使用其他位置，请在SSLCALocation Zabbix [server](/manual/appendix/config/zabbix_server)/[proxy](/manual/appendix/config/zabbix_proxy) 配置参数中指定目录，
将证书 file 放入该目录中，然后 run 命令行界面（CLI）[command](https://www.openssl.org/docs/manmaster/man1/c_rehash.html)：

    c_rehash .

[comment]: # ({/2922f25e-df569dd2})





