8.4.4.16 密钥环系统变量
MySQL Keyring 插件支持以下系统变量。使用它们来配置密钥环插件操作。这些变量只有在安装了相应的密钥环插件时可用(见第8.4.4.3节,“Keyring Plugin Installation”)。
-
Command-Line Format --兰默年模号=valueSystem Variable 兰默年模号Scope 全局 Dynamic 是 SET_VARHint Applies否 Type 字符串 兰默年模号从AWS KMS 服务器获取的KMS密钥ID,用于兰默年模号插件。这个变量只有在安装了该插件时可用。
这个变量是必需的。如果没有指定,兰默年模号初始化失败。
-
Command-Line Format --兰默年水文=file_nameSystem Variable 兰默年水文Scope 全局 Dynamic 否 SET_VARHint Applies否 Type 文件名 Default Value 兰默平台相关 AWS密钥ring插件的配置文件位置。这变量只有在该插件安装时可用。
在插件启动时,
keyring_aws从配置文件中读取AWS秘密访问密钥ID和密钥。为了使keyring_aws插件成功启动,配置文件必须存在并包含有效的秘密访问密钥信息,按照第8.4.4.7节,“使用AWS密钥ring插件”中的描述初始化。默认文件名为
keyring_aws_conf,位于默认密钥ring文件目录中。 -
Command-Line Format --keyring-aws-data-fileSystem Variable keyring_aws_data_fileScope 全局 Dynamic 否 SET_VARHint Applies否 Type 文件名 Default Value 平台特定AWS密钥ring插件的存储文件位置。这变量只有在该插件安装时可用。
插件启动时,如果将
keyring_aws_data_file赋值为不存在的文件,keyring_aws插件将尝试创建该文件(如果必要,还将创建其父目录)。如果文件已经存在,keyring_aws将从文件中读取并加密的密钥,并将它们缓存在内存中。keyring_aws不在内存中缓存未加密的密钥。默认文件名为
keyring_aws_data,位于默认密钥文件目录中。 -
Command-Line Format --keyring-aws-region=valueSystem Variable keyring_aws_regionScope 全局 Dynamic 是 SET_VARHint Applies否 Type 枚举 Default Value us-east-1Valid Values 非洲南部-1亚洲东部-1亚洲北东部-1亚洲北东部-2亚洲北东部-3亚洲南部-1亚洲南东部-1亚洲南东部-2加拿大中央-1中国北部-1中国北西部-1欧洲中央-1欧洲北部-1欧洲南部-1欧洲西部-1欧洲西部-2欧洲西部-3中东南部-1南美东部-1美国东部-1美国东部-2美国政府东部-1美国ISO东部-1美国ISO西部-1美国ISO北部-东部-1美国西部-1美国西部-2AWS 区域的
keyring_aws插件。该变量只有在安装了该插件时才可用。 -
keyring__hashicorp__auth__pathCommand-Line Format --keyring-_hashicorp-_auth-_path=_valueSystem Variable keyring__hashicorp__auth__pathScope Global Dynamic Yes SET_VARHint AppliesNo Type String Default Value /v1/_auth/_approle/_loginHashiCorp Vault 服务器中 AppRole 认证的认证路径,用于 <code>keyring__hashicorp</code> 插件。该变量只有在安装了该插件时可用。
-
keyring__hashicorp__ca__pathCommand-Line Format --keyring-_hashicorp-ca-path=_file_nameSystem Variable keyring__hashicorp__ca__pathScope Global Dynamic Yes SET_VARHint AppliesNo Type File name Default Value empty stringMySQL 服务器可以访问的本地文件路径名,用于 <code>keyring__hashicorp</code> 插件中的 TLS 证书权威机构。该变量只有在安装了该插件时可用。
如果未设置该变量,
keyring_hashicorp插件将打开 HTTPS 连接,而不使用服务器证书验证,并且信任 HashiCorp Vault 服务器提供的任何证书。为了安全,这必须假设 Vault 服务器不是恶意的,并且没有中间人攻击的可能性。如果这些假设无效,请将keyring_hashicorp_ca_path设置为可信任 CA 证书的路径。例如,在Certificate and Key Preparation 中,这是company.crt文件。 -
Command-Line Format --keyring-hashicorp-caching[={OFF|ON}]System Variable keyring_hashicorp_cachingScope Global Dynamic Yes SET_VARHint AppliesNo Type Boolean Default Value OFF是否启用
keyring_hashicorp插件使用的可选内存密钥缓存,用于缓存来自 HashiCorp Vault 服务器的密钥。这变量在插件安装时不可用。如果启用缓存,插件将在初始化时填充它。否则,插件只在初始化时填充密钥列表。启用缓存是权衡:它改善性能,但保持敏感的密钥信息副本在内存中,这可能对安全性不具备。
-
分稾变作选 关用 分稾变作选 的工 兰作 子中时间开发 分稾变作选 兰作 的工时间开发 分稾变作选 兰作 的工时间开发 分稾变作选 兰作 的工时间开发
-
该变量与
keyring_hashicorp_ca_path相关,从其中获取值在keyring_hashicorp插件初始化时。该变量除非安装了该插件不可用。它反映了如果初始化成功,实际用于插件操作的“committed”值。更多信息,请见keyring_hashicorp 配置 -
keyring_hashicorp_commit_cachingSystem Variable keyring_hashicorp_commit_cachingScope 全局 Dynamic 否 SET_VARHint Applies否 Type 字符串 该变量与
keyring_hashicorp_caching相关,从其中获取值在keyring_hashicorp插件初始化时。该变量除非安装了该插件不可用。它反映了如果初始化成功,实际用于插件操作的“committed”值。更多信息,请见keyring_hashicorp 配置 -
System Variable 分ޣ_hashicorp_议作发值Scope 入本 Dynamic No SET_VARHint AppliesNo Type 简 分ޣ 分ޣ_hashicorp_议作发值 分ޣ_hashicorp_议作发值 分ޣ_hashicorp_议作发值 分ޣ_hashicorp_议作发值 分ޣ_hashicorp_议作发值
-
System Variable 分ޣ_hashicorp_议作发值Scope 入本 Dynamic No SET_VARHint AppliesNo Type 简 该变量与
keyring_hashicorp_server_url相关,从其中获取值在keyring_hashicorp插件初始化时。这一变量只有在安装了该插件时可用。它反映了如果初始化成功,实际用于插件操作的“committed”值。更多信息,请见keyring_hashicorp 配置。 -
keyring_hashicorp_commit_store_pathSystem Variable keyring_hashicorp_commit_store_pathScope 全局 Dynamic 否 SET_VARHint Applies否 Type 字符串 该变量与
keyring_hashicorp_store_path相关,从其中获取值在keyring_hashicorp插件初始化时。这一变量只有在安装了该插件时可用。它反映了如果初始化成功,实际用于插件操作的“committed”值。更多信息,请见keyring_hashicorp 配置。 -
Command-Line Format --keyring-hashicorp-role-id=valueSystem Variable keyring_hashicorp_role_idScope 全局 Dynamic 是 SET_VARHint Applies否 Type 字符串 Default Value 空字符串HashiCorp Vault AppRole认证角色ID,用于keyring_hashicorp插件。除非安装了该插件,该变量不可用。值必须是UUID格式。
该变量是必需的。如果未指定,keyring_hashicorp初始化失败。
-
Command-Line Format --keyring-hashicorp-secret-id=valueSystem Variable keyring_hashicorp_secret_idScope 全局 Dynamic 是 SET_VARHint Applies否 Type 字符串 Default Value 空字符串HashiCorp Vault AppRole认证秘密ID,用于keyring_hashicorp插件。除非安装了该插件,该变量不可用。值必须是UUID格式。
该变量是必需的。如果未指定,keyring_hashicorp初始化失败。
该变量的值敏感,因此在显示时其值将被
*字符mask。 -
Command-Line Format --keyring-hashicorp-server-url=valueSystem Variable keyring_hashicorp_server_urlScope 全局 Dynamic 是 SET_VARHint Applies否 Type 字符串 Default Value https://127.0.0.1:8200HashiCorp Vault 服务器 URL,用于 HashiCorp Vault 插件。该变量只有在安装了该插件时才可用。值必须以
https://开头。 -
Command-Line Format --keyring-hashicorp-store-path=valueSystem Variable keyring_hashicorp_store_pathScope 全局 Dynamic 是 SET_VARHint Applies否 Type 字符串 Default Value HashiCorp Vault 服务器中的存储路径,当使用适当的 AppRole 凭证时可以写入。该变量只有在安装了
keyring_hashicorp插件时才可用。要指定凭证,请设置keyring_hashicorp_role_id和keyring_hashicorp_secret_id系统变量(例如,见keyring_hashicorp 配置)。该变量是必需的。如果未指定,
keyring_hashicorp初始化将失败。 -
Command-Line Format --keyring-okv-conf-dir=dir_nameSystem Variable keyring_okv_conf_dirScope 全局 Dynamic 是 SET_VARHint Applies否 Type 目录名称 Default Value 空字符串keyring_okv 插件使用的配置信息存储路径的名称。这变量只有在安装了 keyring_okv 插件时才可用。该位置应该是 keyring_okv 插件专用的目录,不要将其位于数据目录下。
默认
keyring_okv_conf_dir值为空。为了让keyring_okv插件能够访问Oracle Key Vault,需要将该值设置为包含Oracle Key Vault配置和SSL材料的目录。关于设置此目录的指南,请参阅第8.4.4.6节,“使用 keyring_okv KMIP 插件”。该目录应该具有受限的访问权限,并且只能由用于运行 MySQL 服务器的帐户访问。例如,在 Unix 和 Unix 类系统上,使用
/usr/local/mysql/mysql-keyring-okv目录,可以执行以下命令(作为root)创建目录、设置其权限和所有权:cd /usr/local/mysql mkdir mysql-keyring-okv chmod 750 mysql-keyring-okv chown mysql mysql-keyring-okv chgrp mysql mysql-keyring-okv如果将
keyring_okv_conf_dir分配给的值指定了不存在或不包含启用连接到 Oracle Key Vault 的配置信息的目录,keyring_okv将错误消息写入错误日志。如果对keyring_okv_conf_dir进行 runtime 分配结果出错,变量值和密钥操作将保持不变。 -
System Variable keyring_operationsScope 全局 Dynamic 是 SET_VARHint Applies否 Type 布尔值 Default Value ON是否启用密钥ring操作。这個变量在密钥迁移操作中使用。见第8.4.4.11节,“Migrating Keys Between Keyring Keystores”。修改这个变量所需的权限是
ENCRYPTION_KEY_ADMIN,在加上SYSTEM_VARIABLES_ADMIN或已弃用的SUPER权限。